ENH: Added "ostringstream(const kwsys_stl::string& s)" and "void str(const kwsys_stl::string& s)" compatibility methods.
This commit is contained in:
parent
ade034a747
commit
5290b40c47
|
@ -83,6 +83,7 @@ class ostringstream: public ostrstream
|
||||||
public:
|
public:
|
||||||
typedef ostrstream Superclass;
|
typedef ostrstream Superclass;
|
||||||
ostringstream() {}
|
ostringstream() {}
|
||||||
|
ostringstream(const kwsys_stl::string& s) { *this << s.c_str(); }
|
||||||
kwsys_stl::string str()
|
kwsys_stl::string str()
|
||||||
{
|
{
|
||||||
ostringstream_cleanup cleanup(*this);
|
ostringstream_cleanup cleanup(*this);
|
||||||
|
@ -91,6 +92,11 @@ public:
|
||||||
const char* ptr = this->Superclass::str();
|
const char* ptr = this->Superclass::str();
|
||||||
return kwsys_stl::string(ptr?ptr:"", pcount);
|
return kwsys_stl::string(ptr?ptr:"", pcount);
|
||||||
}
|
}
|
||||||
|
void str(const kwsys_stl::string& s)
|
||||||
|
{
|
||||||
|
this->~ostringstream();
|
||||||
|
new (this) ostringstream(s);
|
||||||
|
}
|
||||||
private:
|
private:
|
||||||
ostringstream(const ostringstream&);
|
ostringstream(const ostringstream&);
|
||||||
void operator=(const ostringstream&);
|
void operator=(const ostringstream&);
|
||||||
|
|
Loading…
Reference in New Issue