]> git.mxchange.org Git - simgear.git/blob - simgear/compatibility/sstream
00463b1fc5dd01e0b1314cb8696ae9c062391679
[simgear.git] / simgear / compatibility / sstream
1
2 #ifndef __SG_SSTREAM
3 #define __SG_SSTREAM 1
4
5 # include <iostream>
6 # include <strstream>
7 # include <string>
8
9 namespace std {
10
11    class ostringstream : public strstreambase, public iostream {
12    private:
13       std::ostrstream *sstr;
14
15    public:
16       ostringstream() { sstr = new std::ostrstream; }
17       ostringstream(const string &str, int mode=ios::out) {
18          sstr = new ostrstream((char *)str.c_str(), str.size(), mode);
19       }
20       ~ostringstream() { delete sstr; }
21       std::string str() { return std::string(sstr->str()); }
22       int pcount() { return sstr->pcount(); }
23    };
24
25    class istringstream : public istrstream {
26    };
27
28 };
29
30 #endif // !__SG_SSTREAM
31