userioman.cpp 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #include "../include/userioman.h"
  2. #include <boost/algorithm/string.hpp>
  3. #include <fstream>
  4. #include <iostream>
  5. #include <vector>
  6. #include <readline/history.h>
  7. #include <readline/readline.h>
  8. using boost::asio::buffer;
  9. bool UserIoMan::parseJson(Json::Value *root, string jsonstring) {
  10. return false;
  11. }
  12. bool UserIoMan::handleJson(Json::Value root) { return false; }
  13. void UserIoMan::printMessage(std::string msg, OutMsgType type) {
  14. msgmutex.lock();
  15. switch (type) {
  16. case normal: {
  17. std::cout << msg << std::endl;
  18. break;
  19. }
  20. case error: {
  21. std::cout << msg << std::endl;
  22. break;
  23. }
  24. case debug: {
  25. std::cerr << msg << std::endl;
  26. break;
  27. }
  28. }
  29. rl_redisplay();
  30. msgmutex.unlock();
  31. }
  32. void UserIoMan::printWelcomeMessage() {
  33. std::cout << "please enter user and password" << std::endl;
  34. }
  35. std::string UserIoMan::getCmdPrompt() { return "ccats> "; }
  36. std::string UserIoMan::getUserPrompt() { return "User: "; }
  37. std::string UserIoMan::getPassPrompt() { return "Pass: "; }