2017-10-17 18:04:04 -04:00
|
|
|
#include "retroshare/rsfiles.h"
|
|
|
|
|
|
|
|
class FileTreeImpl: public FileTree
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FileTreeImpl() {}
|
|
|
|
|
|
|
|
virtual std::string toRadix64() const ;
|
|
|
|
virtual bool getDirectoryContent(uint32_t index,std::vector<uint32_t>& subdirs,std::vector<FileData>& subfiles) const ;
|
|
|
|
virtual void print() const ;
|
|
|
|
|
|
|
|
bool serialise(unsigned char *& data,uint32_t& data_size) const ;
|
|
|
|
bool deserialise(unsigned char* data, uint32_t data_size) ;
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void recurs_print(uint32_t index,const std::string& indent) const;
|
|
|
|
|
2017-10-18 16:32:15 -04:00
|
|
|
static void recurs_buildFileTree(FileTreeImpl& ft,uint32_t index,const DirDetails& dd,bool remote);
|
|
|
|
|
2017-10-17 18:04:04 -04:00
|
|
|
struct DirData {
|
|
|
|
std::string name;
|
|
|
|
std::vector<uint32_t> subdirs ;
|
|
|
|
std::vector<uint32_t> subfiles ;
|
|
|
|
};
|
|
|
|
std::vector<FileData> mFiles ;
|
|
|
|
std::vector<DirData> mDirs ;
|
2017-10-18 16:32:15 -04:00
|
|
|
|
|
|
|
friend class FileTree ;
|
2017-10-17 18:04:04 -04:00
|
|
|
};
|