Make it easy on myself (and make it work as a bonus)
This commit is contained in:
@@ -8,20 +8,12 @@
|
||||
|
||||
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 {
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user