12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- #ifndef FILEMAN_H
- #define FILEMAN_H
- #include <fstream>
- #include <string>
- #include <vector>
- #define BLOCKSIZE 8
- class FileMan {
- private:
- std::ifstream putfile;
- std::ofstream getfile;
- std::string getname, putname;
- const unsigned int max_read_len = 8;
- int putchunks;
- int putsize;
- int putchunksRemaining;
- int getchunks;
- int getchunksRemaining;
- public:
- FileMan();
- ~FileMan();
-
- bool isGetting();
- bool isPutting();
- bool openPut(const std::string &name);
- bool openGet(const std::string &name);
- void closePut();
- void closeGet();
- std::string getPutName();
- std::string getGetName();
- void cancelPut();
- // closes and deletes getfile
- void cancelGet();
- void writeGet(std::vector<char> data);
- void writeBase64(std::string data);
- int getGetChunks();
- int getGetRemainingChunks();
- void setGetChunks(int chunks);
- std::vector<char> readPut();
- std::string readBase64();
- int getPutChunks();
- int getPutChunksRemaining();
- int getPutSize();
-
- };
- #endif
|