BUG: Remove stringstream implementation, this was a wrong interface anyway.
This commit is contained in:
parent
db116b94e4
commit
55af790ebf
@ -64,7 +64,6 @@ using @KWSYS_NAMESPACE@_ios_namespace::ostream;
|
|||||||
using @KWSYS_NAMESPACE@_ios_namespace::istream;
|
using @KWSYS_NAMESPACE@_ios_namespace::istream;
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::istrstream;
|
using @KWSYS_NAMESPACE@_ios_namespace::istrstream;
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::ostrstream;
|
using @KWSYS_NAMESPACE@_ios_namespace::ostrstream;
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::strstream;
|
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::ios;
|
using @KWSYS_NAMESPACE@_ios_namespace::ios;
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::endl;
|
using @KWSYS_NAMESPACE@_ios_namespace::endl;
|
||||||
using @KWSYS_NAMESPACE@_ios_namespace::ends;
|
using @KWSYS_NAMESPACE@_ios_namespace::ends;
|
||||||
@ -92,9 +91,9 @@ public:
|
|||||||
{
|
{
|
||||||
ostringstream_cleanup cleanup(*this);
|
ostringstream_cleanup cleanup(*this);
|
||||||
ostringstream_cleanup::IgnoreUnusedVariable(cleanup);
|
ostringstream_cleanup::IgnoreUnusedVariable(cleanup);
|
||||||
int count = this->pcount();
|
int pcount = this->pcount();
|
||||||
const char* ptr = this->Superclass::str();
|
const char* ptr = this->Superclass::str();
|
||||||
return kwsys_stl::string(ptr?ptr:"", count);
|
return kwsys_stl::string(ptr?ptr:"", pcount);
|
||||||
}
|
}
|
||||||
void str(const kwsys_stl::string& s)
|
void str(const kwsys_stl::string& s)
|
||||||
{
|
{
|
||||||
@ -135,17 +134,6 @@ private:
|
|||||||
# pragma warning (pop)
|
# pragma warning (pop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class stringstream: public istringstream, public ostringstream
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
stringstream():istringstream(),ostringstream() {}
|
|
||||||
kwsys_stl::string str() const { return istringstream::str(); }
|
|
||||||
kwsys_stl::string str() { return ostringstream::str(); }
|
|
||||||
private:
|
|
||||||
stringstream(const stringstream&);
|
|
||||||
void operator=(const stringstream&);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace @KWSYS_NAMESPACE@_ios
|
} // namespace @KWSYS_NAMESPACE@_ios
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -13,37 +13,8 @@
|
|||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
const char refstring[] = "Hello, World!";
|
|
||||||
kwsys_ios::ostringstream ostr;
|
kwsys_ios::ostringstream ostr;
|
||||||
ostr << refstring;
|
ostr << "Hello, World!";
|
||||||
kwsys_ios::cout << ostr.str() << kwsys_ios::endl;
|
kwsys_ios::cout << ostr.str() << kwsys_ios::endl;
|
||||||
if( ostr.str() != refstring )
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
kwsys_ios::istringstream istr;
|
|
||||||
istr.str( refstring );
|
|
||||||
kwsys_ios::cout << istr.str() << kwsys_ios::endl;
|
|
||||||
if( istr.str() != refstring )
|
|
||||||
{
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
const int val = 12345;
|
|
||||||
const char valstr[] = "12345";
|
|
||||||
kwsys_ios::stringstream sstr;
|
|
||||||
sstr << val;
|
|
||||||
int v = 0;
|
|
||||||
sstr >> v;
|
|
||||||
kwsys_ios::cout << sstr.str() << kwsys_ios::endl;
|
|
||||||
if( /*v != val ||*/ sstr.str() != valstr)
|
|
||||||
{
|
|
||||||
kwsys_ios::cerr << v << " should be " << val << kwsys_ios::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user