namespace std {
- class ostringstream : public strstreambase, public iostream {
- private:
- std::ostrstream *sstr;
-
+ class ostringstream : public ostrstream {
public:
- ostringstream() { sstr = new std::ostrstream; }
- ostringstream(const string &str, int mode=ios::out) {
- sstr = new ostrstream((char *)str.c_str(), str.size(), mode);
- }
- ~ostringstream() { delete sstr; }
- std::string str() { return std::string(sstr->str()); }
- int pcount() { return sstr->pcount(); }
+ std::string str() { return string(ostrstream::str()) + '\0'; }
};
+
class istringstream : public istrstream {
};