summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/kwsys_ios_sstream.h.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2005-03-03 17:00:43 (GMT)
committerBrad King <brad.king@kitware.com>2005-03-03 17:00:43 (GMT)
commit5290b40c471ff28a976fdb4d0c6a3315630cbd16 (patch)
treecf720ebe7f810300cef1e8b3253efc596f1c4add /Source/kwsys/kwsys_ios_sstream.h.in
parentade034a74766ea50c14f7beb0778031b964e39fa (diff)
downloadCMake-5290b40c471ff28a976fdb4d0c6a3315630cbd16.zip
CMake-5290b40c471ff28a976fdb4d0c6a3315630cbd16.tar.gz
CMake-5290b40c471ff28a976fdb4d0c6a3315630cbd16.tar.bz2
ENH: Added "ostringstream(const kwsys_stl::string& s)" and "void str(const kwsys_stl::string& s)" compatibility methods.
Diffstat (limited to 'Source/kwsys/kwsys_ios_sstream.h.in')
-rw-r--r--Source/kwsys/kwsys_ios_sstream.h.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/kwsys/kwsys_ios_sstream.h.in b/Source/kwsys/kwsys_ios_sstream.h.in
index aa407d5..f1eb8be 100644
--- a/Source/kwsys/kwsys_ios_sstream.h.in
+++ b/Source/kwsys/kwsys_ios_sstream.h.in
@@ -83,6 +83,7 @@ class ostringstream: public ostrstream
public:
typedef ostrstream Superclass;
ostringstream() {}
+ ostringstream(const kwsys_stl::string& s) { *this << s.c_str(); }
kwsys_stl::string str()
{
ostringstream_cleanup cleanup(*this);
@@ -91,6 +92,11 @@ public:
const char* ptr = this->Superclass::str();
return kwsys_stl::string(ptr?ptr:"", pcount);
}
+ void str(const kwsys_stl::string& s)
+ {
+ this->~ostringstream();
+ new (this) ostringstream(s);
+ }
private:
ostringstream(const ostringstream&);
void operator=(const ostringstream&);