ioman.h 814 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifndef IOMAN_H
  2. #define IOMAN_H
  3. #include "netman.h"
  4. #include "cmdman.h"
  5. #include "fileman.h"
  6. #include <string>
  7. #define BLOCKSIZE 8
  8. class IoMan {
  9. private:
  10. const std::string protoVersion = "0.2";
  11. protected:
  12. NetMan netman;
  13. CmdMan cmdman;
  14. FileMan fileman;
  15. bool loggedin;
  16. std::string promptcmd = "";
  17. std::string promptuser = "";
  18. std::string promptpass = "";
  19. virtual bool parseJson(Json::Value *root, string jsonstring) = 0;
  20. virtual bool handleJson(Json::Value root) = 0;
  21. virtual void printErrorMessage(std::string msg) = 0;
  22. virtual void printWelcomeMessage() = 0;
  23. public:
  24. // Basic constructor
  25. IoMan(char *ipcstring);
  26. // destructor to clean up all generic stuff
  27. ~IoMan();
  28. // enters loop to handle further interaction based on derived class
  29. void run();
  30. // setup stuff
  31. bool init();
  32. };
  33. #endif