1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef USERIOMAN_H
- #define USERIOMAN_H
- #include "ioman.h"
- /**
- * @class UserIoMan
- *
- * Provides specific implementations of IoMan outputs and prompts
- * for interactive user sessions
- */
- class UserIoMan : public IoMan {
- private:
- /**
- * Map containing pointers to the appropriate member functions for printing
- * formatted json output
- */
- map<string, void (UserIoMan::*)(Json::Value)> printmap;
- /**
- * Class-wide json functionality
- */
- Json::CharReader *reader;
- Json::StreamWriterBuilder wbuilder;
- string jsonerror;
- /**
- * Format and pretty print json for terminal output
- */
- void printJson(Json::Value root);
- /**
- * Method prototypes for printing json output
- */
- /* printing commands go here */
- void printError(Json::Value root);
- void printConnect(Json::Value root);
- void printHelp(Json::Value root);
- void printStatus(Json::Value root);
- void printDisconnect(Json::Value root);
- void printPut(Json::Value root);
- void printGet(Json::Value root);
- void printList(Json::Value root);
- void printVersion(Json::Value root);
- void printLogin(Json::Value root);
- void printSignup(Json::Value root);
- void printPutdata(Json::Value root);
- void printGetdata(Json::Value root);
- void printListdata(Json::Value root);
- void printHead(Json::Value root);
- void printDeleteme(Json::Value root);
- void printKeyfile(Json::Value root);
- void printClosekey(Json::Value root);
- /**
- * Mutex for synchronized message output
- */
- std::recursive_mutex msgmutex;
- public:
- /**
- * Constructor and destructor
- */
- UserIoMan(char *ipcstring);
- UserIoMan(char *ipcstring, bool usessl);
- ~UserIoMan();
- protected:
- /**
- * Specific implementations for printing messages
- */
- void printMessage(std::string msg, OutMsgType type);
- void printWelcomeMessage();
- /**
- * Return the specific prompt strings for IoMan prompts
- */
- std::string getCmdPrompt();
- std::string getUserPrompt();
- std::string getPassPrompt();
- };
- #endif
|