yet another fix for HAVE_SSTREAM stuff

This commit is contained in:
mes5k 2004-10-30 22:26:58 +00:00
parent c40782023a
commit cb1517921f
2 changed files with 15 additions and 27 deletions

View File

@ -38,6 +38,8 @@
#include <sstream> #include <sstream>
#elif defined(HAVE_STRSTREAM) #elif defined(HAVE_STRSTREAM)
#include <strstream> #include <strstream>
#else
#error "Need a stringstream (sstream or strstream) to compile!"
#endif #endif
namespace TCLAP { namespace TCLAP {
@ -85,16 +87,12 @@ class ValueExtractor
{ {
T temp; T temp;
#ifdef HAVE_SSTREAM #if defined(HAVE_SSTREAM)
std::istringstream is(val); std::istringstream is(val);
#elif HAVE_STRSTREAM #elif defined(HAVE_STRSTREAM)
std::istrstream is(val.c_str()); std::istrstream is(val.c_str());
#else #else
throw(SpecificationException( #error "Need a stringstream (sstream or strstream) to compile!"
string("Missing sstream or strstream lib, ") +
"without which, nothing will work. " +
"Not even sure how you got this far!",
toString()));
#endif #endif
int valuesRead = 0; int valuesRead = 0;
@ -350,16 +348,12 @@ void MultiArg<T>::allowedInit()
for ( unsigned int i = 0; i < _allowed.size(); i++ ) for ( unsigned int i = 0; i < _allowed.size(); i++ )
{ {
#ifdef HAVE_SSTREAM #if defined(HAVE_SSTREAM)
std::ostringstream os; std::ostringstream os;
#elif HAVE_STRSTREAM #elif defined(HAVE_STRSTREAM)
std::ostrstream os; std::ostrstream os;
#else #else
throw(SpecificationException( #error "Need a stringstream (sstream or strstream) to compile!"
string("Missing sstream or strstream lib, ") +
"without which, nothing will work. " +
"Not even sure how you got this far!",
toString()));
#endif #endif
os << _allowed[i]; os << _allowed[i];

View File

@ -38,6 +38,8 @@
#include <sstream> #include <sstream>
#elif defined(HAVE_STRSTREAM) #elif defined(HAVE_STRSTREAM)
#include <strstream> #include <strstream>
#else
#error "Need a stringstream (sstream or strstream) to compile!"
#endif #endif
namespace TCLAP { namespace TCLAP {
@ -86,16 +88,12 @@ template<class T> class ValueExtractor
int extractValue( const std::string& val ) int extractValue( const std::string& val )
{ {
#ifdef HAVE_SSTREAM #if defined(HAVE_SSTREAM)
std::istringstream is(val); std::istringstream is(val);
#elif HAVE_STRSTREAM #elif defined(HAVE_STRSTREAM)
std::istrstream is(val.c_str()); std::istrstream is(val.c_str());
#else #else
throw(SpecificationException( #error "Need a stringstream (sstream or strstream) to compile!"
string("Missing sstream or strstream lib, ") +
"without which, nothing will work. " +
"Not even sure how you got this far!",
toString()));
#endif #endif
int valuesRead = 0; int valuesRead = 0;
@ -381,16 +379,12 @@ void ValueArg<T>::allowedInit()
for ( unsigned int i = 0; i < _allowed.size(); i++ ) for ( unsigned int i = 0; i < _allowed.size(); i++ )
{ {
#ifdef HAVE_SSTREAM #if defined(HAVE_SSTREAM)
std::ostringstream os; std::ostringstream os;
#elif defined(HAVE_STRSTREAM) #elif defined(HAVE_STRSTREAM)
std::ostrstream os; std::ostrstream os;
#else #else
throw(SpecificationException( #error "Need a stringstream (sstream or strstream) to compile!"
string("Missing sstream or strstream lib, ") +
"without which, nothing will work. " +
"Not even sure how you got this far!",
toString()));
#endif #endif
os << _allowed[i]; os << _allowed[i];