diff --git a/include/tclap/CmdLine.h b/include/tclap/CmdLine.h index 6d1244f..2aa3f35 100644 --- a/include/tclap/CmdLine.h +++ b/include/tclap/CmdLine.h @@ -36,8 +36,6 @@ #include #include #include -#include -#include #include namespace TCLAP { diff --git a/include/tclap/CmdLineInterface.h b/include/tclap/CmdLineInterface.h index 331f030..b5852aa 100644 --- a/include/tclap/CmdLineInterface.h +++ b/include/tclap/CmdLineInterface.h @@ -28,10 +28,6 @@ #include #include #include -#include -#include -#include -#include #include namespace TCLAP { diff --git a/include/tclap/MultiArg.h b/include/tclap/MultiArg.h index 1b1c374..fff63c0 100644 --- a/include/tclap/MultiArg.h +++ b/include/tclap/MultiArg.h @@ -25,7 +25,13 @@ #include #include + +#include +#ifdef HAVE_SSTREAM #include +#elif HAVE_SSTREAM +#include +#endif #include @@ -73,7 +79,19 @@ class ValueExtractor int extractValue( const std::string& val ) { T temp; + +#ifdef HAVE_SSTREAM std::istringstream is(val); +#elif HAVE_STRSTREAM + std::istrstream is(val.c_str()); +#else + throw(SpecificationException( + string("Missing sstream or strstream lib, ") + + "without which, nothing will work. " + + "Not even sure how you got this far!", + toString())); +#endif + int valuesRead = 0; while ( is.good() ) @@ -326,7 +344,19 @@ void MultiArg::allowedInit() { for ( unsigned int i = 0; i < _allowed.size(); i++ ) { + +#ifdef HAVE_SSTREAM std::ostringstream os; +#elif HAVE_STRSTREAM + std::ostrstream os; +#else + throw(SpecificationException( + string("Missing sstream or strstream lib, ") + + "without which, nothing will work. " + + "Not even sure how you got this far!", + toString())); +#endif + os << _allowed[i]; std::string temp( os.str() ); diff --git a/include/tclap/PrintSensibly.h b/include/tclap/PrintSensibly.h index ec33c30..7f19fe2 100644 --- a/include/tclap/PrintSensibly.h +++ b/include/tclap/PrintSensibly.h @@ -23,7 +23,7 @@ #ifndef TCLAP_PRINTSENSIBLY_H #define TCLAP_PRINTSENSIBLY_H -#include +#include #include #include diff --git a/include/tclap/SwitchArg.h b/include/tclap/SwitchArg.h index 190291b..0e4576f 100644 --- a/include/tclap/SwitchArg.h +++ b/include/tclap/SwitchArg.h @@ -26,7 +26,6 @@ #include #include -#include #include diff --git a/include/tclap/UnlabeledMultiArg.h b/include/tclap/UnlabeledMultiArg.h index 972f9b2..b35034d 100644 --- a/include/tclap/UnlabeledMultiArg.h +++ b/include/tclap/UnlabeledMultiArg.h @@ -25,7 +25,6 @@ #include #include -#include #include diff --git a/include/tclap/UnlabeledValueArg.h b/include/tclap/UnlabeledValueArg.h index cfbd161..7a98b6b 100644 --- a/include/tclap/UnlabeledValueArg.h +++ b/include/tclap/UnlabeledValueArg.h @@ -26,7 +26,6 @@ #include #include -#include #include diff --git a/include/tclap/ValueArg.h b/include/tclap/ValueArg.h index 64e589c..2eb27cb 100644 --- a/include/tclap/ValueArg.h +++ b/include/tclap/ValueArg.h @@ -25,7 +25,13 @@ #include #include + +#include +#if defined(HAVE_SSTREAM) #include +#elif defined(HAVE_STRSTREAM) +#include +#endif #include @@ -74,8 +80,19 @@ template class ValueExtractor */ int extractValue( const std::string& val ) { - std::istringstream is(val); - + +#ifdef HAVE_SSTREAM + std::istringstream is(val); +#elif HAVE_STRSTREAM + std::istrstream is(val.c_str()); +#else + throw(SpecificationException( + string("Missing sstream or strstream lib, ") + + "without which, nothing will work. " + + "Not even sure how you got this far!", + toString())); +#endif + int valuesRead = 0; while ( is.good() ) { @@ -358,7 +375,19 @@ void ValueArg::allowedInit() { for ( unsigned int i = 0; i < _allowed.size(); i++ ) { + +#ifdef HAVE_SSTREAM std::ostringstream os; +#elif defined(HAVE_STRSTREAM) + std::ostrstream os; +#else + throw(SpecificationException( + string("Missing sstream or strstream lib, ") + + "without which, nothing will work. " + + "Not even sure how you got this far!", + toString())); +#endif + os << _allowed[i]; std::string temp( os.str() ); diff --git a/include/tclap/XorHandler.h b/include/tclap/XorHandler.h index 0b03d47..152bc52 100644 --- a/include/tclap/XorHandler.h +++ b/include/tclap/XorHandler.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include namespace TCLAP {