file_.open(temp_path, std::ofstream::app | std::ofstream::binary);
bool is_open = file_.is_open();
- long file_size = 0;
+ uint64_t file_size = 0;
if (is_open) {
LOG(INFO) << "client receive file write open success";
file.open(temp_path, std::ofstream::app | std::ofstream::binary);
bool is_open = file.is_open();
- long file_size = 0;
+ uint64_t file_size = 0;
if (is_open) {
LOG(INFO) << "sever receive file write open success";
if (is_open) {
filepayload_reader.SetReceivedBytes(
- static_cast<long long unsigned int>(file_size));
+ static_cast<uint64_t>(file_size));
parent_->OnPayloadReceived(payload, peer);
} else {
parent_->OnErrorReported(cion::error::CION_ERROR_INVALID_OPERATION, peer);
return path_.substr(pos + 1);
}
-long FilePayload::GetReceivedBytes() {
+uint64_t FilePayload::GetReceivedBytes() {
return received_bytes_;
}
-void FilePayload::SetReceivedBytes(long size) {
+void FilePayload::SetReceivedBytes(uint64_t size) {
received_bytes_ = size;
}
-long FilePayload::GetTotalBytes() {
+uint64_t FilePayload::GetTotalBytes() {
return total_bytes_;
}
LOG(INFO) << "wrong payload type detected" << type;
id_ = parcel->ReadString();
parcel->ReadUInt64(&total);
- total_bytes_ = static_cast<long>(total);
+ total_bytes_ = static_cast<uint64_t>(total);
path_ = parcel->ReadString();
tmp_file_name_ = parcel->ReadString();
}
public:
void SaveAsFile(std::string path);
std::string GetFileName();
- long GetReceivedBytes();
- long GetTotalBytes();
+ uint64_t GetReceivedBytes();
+ uint64_t GetTotalBytes();
void SetFilePath(std::string path);
FilePayload();
std::string& GetID() override;
std::string& GetFilePath();
std::string& GetTemporaryFileName();
void UpdateTemporaryFilePath();
- void SetReceivedBytes(long size);
+ void SetReceivedBytes(uint64_t size);
void SetTemporaryFilePath(std::string path);
void WriteToParcel(tizen_base::Parcel* parcel) const override;
void ReadFromParcel(tizen_base::Parcel* parcel) override;
std::string path_;
std::string tmp_file_name_;
std::string tmp_path_;
- long received_bytes_ = 0;
- long total_bytes_ = 0;
+ uint64_t received_bytes_ = 0;
+ uint64_t total_bytes_ = 0;
std::string id_;
};
fp_->SetTemporaryFilePath(path);
}
-void FilePayloadReaderInternal::SetReceivedBytes(unsigned long long size) {
+void FilePayloadReaderInternal::SetReceivedBytes(uint64_t) {
fp_->SetReceivedBytes(size);
}
FilePayloadReaderInternal(IPayload* payload);
std::string GetTemporaryFileName();
std::string GetFilePath();
- void SetReceivedBytes(unsigned long long size);
+ void SetReceivedBytes(uint64_t size);
void SetTemporaryFilePath(std::string path);
void UpdateTemporaryFilePath();
}
C_EXPORT int cion_payload_get_received_bytes(cion_payload_h payload,
- long* bytes) {
+ uint64_t* bytes) {
if (!payload || !bytes)
return CION_ERROR_INVALID_PARAMETER;
}
C_EXPORT int cion_payload_get_total_bytes(cion_payload_h payload,
- long* bytes) {
+ uint64_t* bytes) {
if (!payload || !bytes)
return CION_ERROR_INVALID_PARAMETER;
/**
* @brief
*/
-int cion_payload_get_received_bytes(cion_payload_h payload, long *bytes);
+int cion_payload_get_received_bytes(cion_payload_h payload, uint64_t *bytes);
/**
* @brief
*/
-int cion_payload_get_total_bytes(cion_payload_h payload, long *bytes);
+int cion_payload_get_total_bytes(cion_payload_h payload, uint64_t *bytes);
/**
* @brief
TEST_F(FilePayloadTest, FiletestEtc) {
int type = 3;
- unsigned long long big = 1000000000;
+ uint64_t big = 1000000000;
std::vector<char> dd;
std::string size;
std::string path = "/dir/mymyfile.txt";