Feature: File copy/paste support in remote control
This commit is contained in:
34
common/file_upload.h
Normal file
34
common/file_upload.h
Normal file
@@ -0,0 +1,34 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct FileChunkPacket
|
||||
{
|
||||
unsigned char cmd; // COMMAND_SEND_FILE
|
||||
uint32_t fileIndex; // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint32_t totalNum; // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD>
|
||||
uint64_t fileSize; // <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD>С
|
||||
uint64_t offset; // <20><>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD><C4BC>е<EFBFBD>ƫ<EFBFBD><C6AB>
|
||||
uint64_t dataLength; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><DDB3><EFBFBD>
|
||||
uint64_t nameLength; // <20>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȣ<EFBFBD><C8A3><EFBFBD><EFBFBD><EFBFBD> '\0'<27><>
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
int InitFileUpload(const std::string hmac, int chunkSizeKb = 64, int sendDurationMs = 50);
|
||||
|
||||
int UninitFileUpload();
|
||||
|
||||
std::vector<std::string> GetClipboardFiles();
|
||||
|
||||
bool GetCurrentFolderPath(std::string& outDir);
|
||||
|
||||
typedef bool (*OnTransform)(void* user, FileChunkPacket* chunk, unsigned char* data, int size);
|
||||
|
||||
typedef void (*OnFinish)(void* user);
|
||||
|
||||
int FileBatchTransferWorker(const std::vector<std::string>& files, const std::string& targetDir,
|
||||
void* user, OnTransform f, OnFinish finish, const std::string& hash, const std::string& hmac);
|
||||
|
||||
int RecvFileChunk(char* buf, size_t len, void* user, OnFinish f, const std::string& hash, const std::string& hmac);
|
||||
Reference in New Issue
Block a user