Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ------------- Interactive.h ------------
- #ifndef INTERACTIVE_H
- #define INTERACTIVE_H
- #include <iostream>
- #include <string>
- #include <sstream>
- class Interactive
- {
- private:
- std::stringstream m_sin;
- public:
- void read(std::string input);
- void write(std::string output);
- void parseCommand(std::string input);
- };
- #endif
- -------------Interactive.cpp ---------------
- #include "Interactive.h"
- #include <string>
- #include <sstream>
- #include <iostream>
- void Interactive::parseCommand(std::string input)
- {
- m_sin >> input;
- std::cout << m_sin.str();
- }
- void Interactive::read(std::string input){}
- void Interactive::write(std::string output){}
- ------------- main.cpp -----------------
- #include "Interactive.h"
- int main()
- {
- Interactive interface;
- interface.parseCommand("ahoj");
- return 0;
- }
Add Comment
Please, Sign In to add comment