add PICli to pift
fix relative path in PIFileTransfer git-svn-id: svn://db.shs.com.ru/pip@67 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -14,6 +14,10 @@ public:
|
||||
~PIFileTransfer();
|
||||
|
||||
enum StepType {pft_None, pft_Description, pft_Data};
|
||||
struct PFTFileInfo : public PIFile::FileInfo {
|
||||
PFTFileInfo(const PIFile::FileInfo &fi = PIFile::FileInfo()) : PIFile::FileInfo(fi) {}
|
||||
PIString dest_path;
|
||||
};
|
||||
|
||||
#pragma pack(push,1)
|
||||
struct PFTHeader {
|
||||
@@ -58,7 +62,7 @@ public:
|
||||
|
||||
private:
|
||||
static const char sign[];
|
||||
PIVector<PIFile::FileInfo> files_;
|
||||
PIVector<PFTFileInfo> files_;
|
||||
PIString cur_file_string;
|
||||
llong bytes_file_all, bytes_file_cur;
|
||||
PFTHeader pftheader;
|
||||
@@ -66,7 +70,7 @@ private:
|
||||
PIFile work_file;
|
||||
PIByteArray desc;
|
||||
|
||||
bool sendFiles(const PIVector<PIFile::FileInfo> &files);
|
||||
bool sendFiles(const PIVector<PFTFileInfo> &files);
|
||||
void processFile(int id, ullong start, PIByteArray &data);
|
||||
virtual void receivePart(Part fi, PIByteArray ba, PIByteArray pheader);
|
||||
virtual PIByteArray buildPacket(Part fi);
|
||||
@@ -80,9 +84,9 @@ private:
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const PIFileTransfer::PFTHeader & v) {s << v.raw_sig << v.step << v.session_id; return s;}
|
||||
inline PIByteArray & operator >>(PIByteArray & s, PIFileTransfer::PFTHeader & v) {s >> v.raw_sig >> v.step >> v.session_id; return s;}
|
||||
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const PIFile::FileInfo & v) {s << v.path << v.size << v.time_access << v.time_modification <<
|
||||
inline PIByteArray & operator <<(PIByteArray & s, const PIFileTransfer::PFTFileInfo & v) {s << v.dest_path << v.size << v.time_access << v.time_modification <<
|
||||
(int)v.flags << v.id_user << v.id_group << v.perm_user.raw << v.perm_group.raw << v.perm_other.raw; return s;}
|
||||
inline PIByteArray & operator >>(PIByteArray & s, PIFile::FileInfo & v) {s >> v.path >> v.size >> v.time_access >> v.time_modification >>
|
||||
inline PIByteArray & operator >>(PIByteArray & s, PIFileTransfer::PFTFileInfo & v) {s >> v.dest_path >> v.size >> v.time_access >> v.time_modification >>
|
||||
*(int*)(&(v.flags)) >> v.id_user >> v.id_group >> v.perm_user.raw >> v.perm_group.raw >> v.perm_other.raw; return s;}
|
||||
|
||||
#endif // PIFILETRANSFER_H
|
||||
|
||||
Reference in New Issue
Block a user