Guest User

Untitled

a guest
Apr 20th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. ------------- Interactive.h ------------
  2. #ifndef INTERACTIVE_H
  3. #define INTERACTIVE_H
  4.  
  5. #include <iostream>
  6. #include <string>
  7. #include <sstream>
  8.  
  9. class Interactive
  10. {
  11. private:
  12. std::stringstream m_sin;
  13. public:
  14. void read(std::string input);
  15. void write(std::string output);
  16. void parseCommand(std::string input);
  17. };
  18.  
  19. #endif
  20.  
  21.  
  22.  
  23. -------------Interactive.cpp ---------------
  24.  
  25. #include "Interactive.h"
  26. #include <string>
  27. #include <sstream>
  28. #include <iostream>
  29.  
  30. void Interactive::parseCommand(std::string input)
  31. {
  32. m_sin >> input;
  33. std::cout << m_sin.str();
  34. }
  35.  
  36. void Interactive::read(std::string input){}
  37. void Interactive::write(std::string output){}
  38.  
  39. ------------- main.cpp -----------------
  40. #include "Interactive.h"
  41.  
  42. int main()
  43. {
  44. Interactive interface;
  45.  
  46. interface.parseCommand("ahoj");
  47.  
  48. return 0;
  49. }
Add Comment
Please, Sign In to add comment