Commit | Line | Data |
---|---|---|
c51bd067 JM |
1 | #ifndef _STRINGSTREAM_H_ |
2 | #define _STRINGSTREAM_H_ | |
3 | ||
4 | #include "StreamOutput.h" | |
5 | ||
6 | #include <string> | |
7 | ||
8 | class StringStream : public StreamOutput { | |
9 | public: | |
10 | StringStream() {} | |
11 | int puts(const char *str){ output.append(str); return strlen(str); } | |
12 | void clear() { output.clear(); } | |
13 | std::string getOutput() const { return output; } | |
14 | ||
15 | private: | |
16 | std::string output; | |
17 | }; | |
18 | ||
19 | #endif |