mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-08-04 02:06:29 -04:00
cleaned up some includes and added ifdefs for sstream
This commit is contained in:
parent
54d1326da9
commit
cf64287c40
@ -36,8 +36,6 @@
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
namespace TCLAP {
|
||||
|
@ -28,10 +28,6 @@
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <iostream>
|
||||
#include <ostream>
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include <iomanip>
|
||||
#include <algorithm>
|
||||
|
||||
namespace TCLAP {
|
||||
|
@ -25,7 +25,13 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <config.h>
|
||||
#ifdef HAVE_SSTREAM
|
||||
#include <sstream>
|
||||
#elif HAVE_SSTREAM
|
||||
#include <strstream>
|
||||
#endif
|
||||
|
||||
#include <tclap/Arg.h>
|
||||
|
||||
@ -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<T>::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() );
|
||||
|
@ -23,7 +23,7 @@
|
||||
#ifndef TCLAP_PRINTSENSIBLY_H
|
||||
#define TCLAP_PRINTSENSIBLY_H
|
||||
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <string>
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include <tclap/Arg.h>
|
||||
|
||||
|
@ -25,7 +25,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include <tclap/MultiArg.h>
|
||||
|
||||
|
@ -26,7 +26,6 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
|
||||
#include <tclap/ValueArg.h>
|
||||
|
||||
|
@ -25,7 +25,13 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <config.h>
|
||||
#if defined(HAVE_SSTREAM)
|
||||
#include <sstream>
|
||||
#elif defined(HAVE_STRSTREAM)
|
||||
#include <strstream>
|
||||
#endif
|
||||
|
||||
#include <tclap/Arg.h>
|
||||
|
||||
@ -74,8 +80,19 @@ template<class T> 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<T>::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() );
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
#include <ostream>
|
||||
#include <iostream>
|
||||
|
||||
namespace TCLAP {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user