diff --git a/CMakeLists.txt b/CMakeLists.txt index c1229ff1ddef712703c69e310b094ed9a37b4d74..559ce04b037867da20b3fa90f8e0577b7d337095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -892,23 +892,6 @@ IF(KWSYS_INSTALL_INCLUDE_DIR) ${KWSYS_INSTALL_INCLUDE_OPTIONS}) ENDIF() -#----------------------------------------------------------------------------- -# Create streams header wrappers to give standard names by which they -# may be included. -FOREACH(header iostream fstream sstream iosfwd) - # Configure the header wrapper. - CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_ios_${header}.h.in - ${KWSYS_HEADER_DIR}/ios/${header} - @ONLY IMMEDIATE) - - # Create an install target for the header wrapper. - IF(KWSYS_INSTALL_INCLUDE_DIR) - INSTALL(FILES ${KWSYS_HEADER_DIR}/ios/${header} - DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/ios - ${KWSYS_INSTALL_INCLUDE_OPTIONS}) - ENDIF() -ENDFOREACH() - #----------------------------------------------------------------------------- # Build a list of classes and headers we need to implement the # selected components. Initialize with required components. diff --git a/CommandLineArguments.cxx b/CommandLineArguments.cxx index 9fa98021324582fd556d335adba001568c243ca8..d7494e526a365c09da7694feed6880780b14f05c 100644 --- a/CommandLineArguments.cxx +++ b/CommandLineArguments.cxx @@ -18,8 +18,6 @@ #include KWSYS_HEADER(stl/vector) #include KWSYS_HEADER(stl/map) #include KWSYS_HEADER(stl/set) -#include KWSYS_HEADER(ios/sstream) -#include KWSYS_HEADER(ios/iostream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. @@ -27,10 +25,11 @@ # include "CommandLineArguments.hxx.in" # include "Configure.hxx.in" # include "kwsys_stl.hxx.in" -# include "kwsys_ios_sstream.h.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <sstream> +#include <iostream> + #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -45,7 +44,7 @@ #if 0 # define CommandLineArguments_DEBUG(x) \ - kwsys_ios::cout << __LINE__ << " CLA: " << x << kwsys_ios::endl + std::cout << __LINE__ << " CLA: " << x << std::endl #else # define CommandLineArguments_DEBUG(x) #endif @@ -288,7 +287,7 @@ int CommandLineArguments::Parse() } break; default: - kwsys_ios::cerr << "Got unknown argument type: \"" << cs->ArgumentType << "\"" << kwsys_ios::endl; + std::cerr << "Got unknown argument type: \"" << cs->ArgumentType << "\"" << std::endl; this->Internals->LastArgument --; return 0; } @@ -313,7 +312,7 @@ int CommandLineArguments::Parse() } else { - kwsys_ios::cerr << "Got unknown argument: \"" << arg << "\"" << kwsys_ios::endl; + std::cerr << "Got unknown argument: \"" << arg << "\"" << std::endl; this->Internals->LastArgument --; return 0; } @@ -518,7 +517,7 @@ unsigned int CommandLineArguments::GetLastArgument() //---------------------------------------------------------------------------- void CommandLineArguments::GenerateHelp() { - kwsys_ios::ostringstream str; + std::ostringstream str; // Collapse all arguments into the map of vectors of all arguments that do // the same thing. @@ -604,7 +603,7 @@ void CommandLineArguments::GenerateHelp() CommandLineArguments::Internal::SetOfStrings::iterator sit; for ( sit = mpit->second.begin(); sit != mpit->second.end(); sit++ ) { - str << kwsys_ios::endl; + str << std::endl; char argument[100]; sprintf(argument, "%s", sit->c_str()); switch ( this->Internals->Callbacks[*sit].ArgumentType ) @@ -658,8 +657,8 @@ void CommandLineArguments::GenerateHelp() skip = cc; } } - str.write(ptr, static_cast<kwsys_ios::streamsize>(skip)); - str << kwsys_ios::endl; + str.write(ptr, static_cast<std::streamsize>(skip)); + str << std::endl; ptr += skip; len -= skip; cnt ++; @@ -847,7 +846,7 @@ bool CommandLineArguments::PopulateVariable(CommandLineArgumentsCallbackStructur this->PopulateVariable(static_cast<kwsys_stl::vector<kwsys_stl::string>*>(cs->Variable), var); break; default: - kwsys_ios::cerr << "Got unknown variable type: \"" << cs->VariableType << "\"" << kwsys_ios::endl; + std::cerr << "Got unknown variable type: \"" << cs->VariableType << "\"" << std::endl; this->Internals->LastArgument --; return 0; } diff --git a/CommandLineArguments.hxx.in b/CommandLineArguments.hxx.in index cbf6ee3938d556f3572f92763fdb6f76c13bbb1d..6257870a509a410c29d965f18c2ec562c33a75fd 100644 --- a/CommandLineArguments.hxx.in +++ b/CommandLineArguments.hxx.in @@ -64,7 +64,7 @@ struct CommandLineArgumentsCallbackStructure; * "This is help string for --something"); * if ( !arg.Parse() ) * { - * kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl; + * std::cerr << "Problem parsing arguments" << std::endl; * res = 1; * } * diff --git a/Configure.hxx.in b/Configure.hxx.in index 8f5ace23ba8bba3a322469ba29a224374031a956..56eec31a077db99a99559b2ee5f9399724c7880e 100644 --- a/Configure.hxx.in +++ b/Configure.hxx.in @@ -55,25 +55,6 @@ # define @KWSYS_NAMESPACE@_stl #endif -/* Define the ios namespace macro. */ -#if @KWSYS_NAMESPACE@_IOS_HAVE_STD -# define @KWSYS_NAMESPACE@_ios_namespace std -#else -# define @KWSYS_NAMESPACE@_ios_namespace -#endif -#if @KWSYS_NAMESPACE@_IOS_USE_SSTREAM -# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios_namespace -#else -# define @KWSYS_NAMESPACE@_ios @KWSYS_NAMESPACE@_ios -#endif - -/* Define the ios::binary openmode macro. */ -#if @KWSYS_NAMESPACE@_IOS_HAVE_BINARY -# define @KWSYS_NAMESPACE@_ios_binary @KWSYS_NAMESPACE@_ios::ios::binary -#else -# define @KWSYS_NAMESPACE@_ios_binary 0 -#endif - /* Whether the cstddef header is available. */ #define @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF @KWSYS_CXX_HAS_CSTDDEF@ @@ -142,9 +123,7 @@ #if defined(KWSYS_NAMESPACE) # if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # define kwsys_stl @KWSYS_NAMESPACE@_stl -# define kwsys_ios @KWSYS_NAMESPACE@_ios # define kwsys @KWSYS_NAMESPACE@ -# define kwsys_ios_binary @KWSYS_NAMESPACE@_ios_binary # endif # define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS # define KWSYS_STL_HAVE_STD @KWSYS_NAMESPACE@_STL_HAVE_STD diff --git a/FStream.hxx.in b/FStream.hxx.in index 37055d61767e0317a7ca787fa4243e8971f4ba00..681e4d87069c73764f150bf13e5c251b2166fe36 100644 --- a/FStream.hxx.in +++ b/FStream.hxx.in @@ -12,8 +12,8 @@ #ifndef @KWSYS_NAMESPACE@_FStream_hxx #define @KWSYS_NAMESPACE@_FStream_hxx -#include <@KWSYS_NAMESPACE@/ios/fstream> #include <@KWSYS_NAMESPACE@/Encoding.hxx> +#include <fstream> namespace @KWSYS_NAMESPACE@ { @@ -167,8 +167,8 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits> # undef @KWSYS_NAMESPACE@_FStream_NOEXCEPT #else - using @KWSYS_NAMESPACE@_ios_namespace::ofstream; - using @KWSYS_NAMESPACE@_ios_namespace::ifstream; + using std::ofstream; + using std::ifstream; #endif namespace FStream diff --git a/Glob.cxx b/Glob.cxx index 11bfd16b11ba4f5a1ff3f095e17b121676356118..1567b6429903c7a329ce48868228cbd3a12db263 100644 --- a/Glob.cxx +++ b/Glob.cxx @@ -341,7 +341,7 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start, void Glob::ProcessDirectory(kwsys_stl::string::size_type start, const kwsys_stl::string& dir, GlobMessages* messages) { - //kwsys_ios::cout << "ProcessDirectory: " << dir << kwsys_ios::endl; + //std::cout << "ProcessDirectory: " << dir << std::endl; bool last = ( start == this->Internals->Expressions.size()-1 ); if ( last && this->Recurse ) { @@ -384,10 +384,10 @@ void Glob::ProcessDirectory(kwsys_stl::string::size_type start, fname = kwsys::SystemTools::LowerCase(fname); #endif - //kwsys_ios::cout << "Look at file: " << fname << kwsys_ios::endl; - //kwsys_ios::cout << "Match: " - // << this->Internals->TextExpressions[start].c_str() << kwsys_ios::endl; - //kwsys_ios::cout << "Real name: " << realname << kwsys_ios::endl; + //std::cout << "Look at file: " << fname << std::endl; + //std::cout << "Match: " + // << this->Internals->TextExpressions[start].c_str() << std::endl; + //std::cout << "Real name: " << realname << std::endl; if( (!last && !kwsys::SystemTools::FileIsDirectory(realname)) || (!this->ListDirs && last && @@ -444,8 +444,8 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr, GlobMessages* messages) } if ( last_slash > 0 ) { - //kwsys_ios::cout << "I can skip: " << fexpr.substr(0, last_slash) - // << kwsys_ios::endl; + //std::cout << "I can skip: " << fexpr.substr(0, last_slash) + // << std::endl; skip = last_slash; } if ( skip == 0 ) diff --git a/IOStream.cxx b/IOStream.cxx index a31f8c846a7e936c21d90a1ec8299b8a0e1269e8..770bd704fed8efcb7bf34b27a702239ed10c151a 100644 --- a/IOStream.cxx +++ b/IOStream.cxx @@ -23,14 +23,13 @@ #endif // Include the streams library. -#include KWSYS_HEADER(ios/iostream) +#include <iostream> #include KWSYS_HEADER(IOStream.hxx) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "Configure.hxx.in" -# include "kwsys_ios_iostream.hxx.in" # include "IOStream.hxx.in" #endif @@ -50,7 +49,7 @@ namespace KWSYS_NAMESPACE { // Scan an input stream for an integer value. -static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer) +static int IOStreamScanStream(std::istream& is, char* buffer) { // Prepare to write to buffer. char* out = buffer; @@ -64,10 +63,10 @@ static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer) // detect it from the input. A leading 0x means hex, and a leading // 0 alone means octal. int base = 0; - int flags = is.flags() & kwsys_ios::ios_base::basefield; - if(flags == kwsys_ios::ios_base::oct) { base = 8; } - else if(flags == kwsys_ios::ios_base::dec) { base = 10; } - else if(flags == kwsys_ios::ios_base::hex) { base = 16; } + int flags = is.flags() & std::ios_base::basefield; + if(flags == std::ios_base::oct) { base = 8; } + else if(flags == std::ios_base::dec) { base = 10; } + else if(flags == std::ios_base::hex) { base = 16; } bool foundDigit = false; bool foundNonZero = false; if(is.peek() == '0') @@ -134,17 +133,17 @@ static int IOStreamScanStream(kwsys_ios::istream& is, char* buffer) // Read an integer value from an input stream. template <class T> -kwsys_ios::istream& -IOStreamScanTemplate(kwsys_ios::istream& is, T& value, char type) +std::istream& +IOStreamScanTemplate(std::istream& is, T& value, char type) { - int state = kwsys_ios::ios_base::goodbit; + int state = std::ios_base::goodbit; // Skip leading whitespace. # if KWSYS_IOS_USE_ANSI - kwsys_ios::istream::sentry okay(is); + std::istream::sentry okay(is); # else is.eatwhite(); - kwsys_ios::istream& okay = is; + std::istream& okay = is; # endif if(okay) @@ -174,16 +173,16 @@ IOStreamScanTemplate(kwsys_ios::istream& is, T& value, char type) int success = (sscanf(buffer, format, &result) == 1)?1:0; // Set flags for resulting state. - if(is.peek() == EOF) { state |= kwsys_ios::ios_base::eofbit; } - if(!success) { state |= kwsys_ios::ios_base::failbit; } + if(is.peek() == EOF) { state |= std::ios_base::eofbit; } + if(!success) { state |= std::ios_base::failbit; } else { value = result; } # if KWSYS_IOS_USE_ANSI - } catch(...) { state |= kwsys_ios::ios_base::badbit; } + } catch(...) { state |= std::ios_base::badbit; } # endif } # if KWSYS_IOS_USE_ANSI - is.setstate(kwsys_ios::ios_base::iostate(state)); + is.setstate(std::ios_base::iostate(state)); # else is.clear(state); # endif @@ -192,13 +191,13 @@ IOStreamScanTemplate(kwsys_ios::istream& is, T& value, char type) // Print an integer value to an output stream. template <class T> -kwsys_ios::ostream& -IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type) +std::ostream& +IOStreamPrintTemplate(std::ostream& os, T value, char type) { # if KWSYS_IOS_USE_ANSI - kwsys_ios::ostream::sentry okay(os); + std::ostream::sentry okay(os); # else - kwsys_ios::ostream& okay = os; + std::ostream& okay = os; # endif if(okay) { @@ -209,17 +208,17 @@ IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type) char format[8]; char* f = format; *f++ = '%'; - if(os.flags() & kwsys_ios::ios_base::showpos) { *f++ = '+'; } - if(os.flags() & kwsys_ios::ios_base::showbase) { *f++ = '#'; } + if(os.flags() & std::ios_base::showpos) { *f++ = '+'; } + if(os.flags() & std::ios_base::showbase) { *f++ = '#'; } # if defined(_MSC_VER) *f++ = 'I'; *f++ = '6'; *f++ = '4'; # else *f++ = 'l'; *f++ = 'l'; # endif - long bflags = os.flags() & kwsys_ios::ios_base::basefield; - if(bflags == kwsys_ios::ios_base::oct) { *f++ = 'o'; } - else if(bflags != kwsys_ios::ios_base::hex) { *f++ = type; } - else if(os.flags() & kwsys_ios::ios_base::uppercase) { *f++ = 'X'; } + long bflags = os.flags() & std::ios_base::basefield; + if(bflags == std::ios_base::oct) { *f++ = 'o'; } + else if(bflags != std::ios_base::hex) { *f++ = type; } + else if(os.flags() & std::ios_base::uppercase) { *f++ = 'X'; } else { *f++ = 'x'; } *f = '\0'; @@ -229,7 +228,7 @@ IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type) sprintf(buffer, format, value); os << buffer; # if KWSYS_IOS_USE_ANSI - } catch(...) { os.clear(os.rdstate() | kwsys_ios::ios_base::badbit); } + } catch(...) { os.clear(os.rdstate() | std::ios_base::badbit); } # endif } return os; @@ -237,13 +236,13 @@ IOStreamPrintTemplate(kwsys_ios::ostream& os, T value, char type) # if !KWSYS_IOS_HAS_ISTREAM_LONG_LONG // Implement input stream operator for IOStreamSLL. -kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamSLL& value) +std::istream& IOStreamScan(std::istream& is, IOStreamSLL& value) { return IOStreamScanTemplate(is, value, 'd'); } // Implement input stream operator for IOStreamULL. -kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamULL& value) +std::istream& IOStreamScan(std::istream& is, IOStreamULL& value) { return IOStreamScanTemplate(is, value, 'u'); } @@ -251,13 +250,13 @@ kwsys_ios::istream& IOStreamScan(kwsys_ios::istream& is, IOStreamULL& value) # if !KWSYS_IOS_HAS_OSTREAM_LONG_LONG // Implement output stream operator for IOStreamSLL. -kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream& os, IOStreamSLL value) +std::ostream& IOStreamPrint(std::ostream& os, IOStreamSLL value) { return IOStreamPrintTemplate(os, value, 'd'); } // Implement output stream operator for IOStreamULL. -kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream& os, IOStreamULL value) +std::ostream& IOStreamPrint(std::ostream& os, IOStreamULL value) { return IOStreamPrintTemplate(os, value, 'u'); } diff --git a/IOStream.hxx.in b/IOStream.hxx.in index 2eeedf2ffed78cdaf42c0f69ed763a00976264d7..c10190954eb76118af223decae1c75f042bb6ff1 100644 --- a/IOStream.hxx.in +++ b/IOStream.hxx.in @@ -12,12 +12,11 @@ #ifndef @KWSYS_NAMESPACE@_IOStream_hxx #define @KWSYS_NAMESPACE@_IOStream_hxx -#include <@KWSYS_NAMESPACE@/ios/iosfwd> +#include <iosfwd> /* Define these macros temporarily to keep the code readable. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT -# define kwsys_ios @KWSYS_NAMESPACE@_ios #endif /* Whether istream supports long long. */ @@ -56,10 +55,8 @@ /* Input stream operator implementation functions. */ namespace @KWSYS_NAMESPACE@ { -kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&, - IOStreamSLL&); -kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&, - IOStreamULL&); +kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamSLL&); +kwsysEXPORT std::istream& IOStreamScan(std::istream&, IOStreamULL&); } /* Provide input stream operator for long long. */ @@ -67,8 +64,8 @@ kwsysEXPORT kwsys_ios::istream& IOStreamScan(kwsys_ios::istream&, !defined(KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED) # define KWSYS_IOS_ISTREAM_LONG_LONG_DEFINED # define @KWSYS_NAMESPACE@_IOS_ISTREAM_LONG_LONG_DEFINED -inline kwsys_ios::istream& -operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value) +inline std::istream& +operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value) { return @KWSYS_NAMESPACE@::IOStreamScan(is, value); } @@ -79,8 +76,8 @@ operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamSLL& value) !defined(KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED) # define KWSYS_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED # define @KWSYS_NAMESPACE@_IOS_ISTREAM_UNSIGNED_LONG_LONG_DEFINED -inline kwsys_ios::istream& -operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value) +inline std::istream& +operator>>(std::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value) { return @KWSYS_NAMESPACE@::IOStreamScan(is, value); } @@ -92,10 +89,8 @@ operator>>(kwsys_ios::istream& is, @KWSYS_NAMESPACE@::IOStreamULL& value) /* Output stream operator implementation functions. */ namespace @KWSYS_NAMESPACE@ { -kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&, - IOStreamSLL); -kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&, - IOStreamULL); +kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamSLL); +kwsysEXPORT std::ostream& IOStreamPrint(std::ostream&, IOStreamULL); } /* Provide output stream operator for long long. */ @@ -103,8 +98,8 @@ kwsysEXPORT kwsys_ios::ostream& IOStreamPrint(kwsys_ios::ostream&, !defined(KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED) # define KWSYS_IOS_OSTREAM_LONG_LONG_DEFINED # define @KWSYS_NAMESPACE@_IOS_OSTREAM_LONG_LONG_DEFINED -inline kwsys_ios::ostream& -operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value) +inline std::ostream& +operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value) { return @KWSYS_NAMESPACE@::IOStreamPrint(os, value); } @@ -115,8 +110,8 @@ operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamSLL value) !defined(KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED) # define KWSYS_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED # define @KWSYS_NAMESPACE@_IOS_OSTREAM_UNSIGNED_LONG_LONG_DEFINED -inline kwsys_ios::ostream& -operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value) +inline std::ostream& +operator<<(std::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value) { return @KWSYS_NAMESPACE@::IOStreamPrint(os, value); } @@ -127,7 +122,6 @@ operator<<(kwsys_ios::ostream& os, @KWSYS_NAMESPACE@::IOStreamULL value) /* Undefine temporary macros. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # undef kwsysEXPORT -# undef kwsys_ios #endif /* If building a C++ file in kwsys itself, give the source file diff --git a/SystemInformation.cxx b/SystemInformation.cxx index 6e81b0b8f5ad58532a8d624a71f2b85a57c6350e..55080d3304044d756333bc27d1fee23b11bffe91 100644 --- a/SystemInformation.cxx +++ b/SystemInformation.cxx @@ -37,12 +37,8 @@ #include "kwsysPrivate.h" #include KWSYS_HEADER(stl/string) #include KWSYS_HEADER(stl/vector) -#include KWSYS_HEADER(ios/iosfwd) #include KWSYS_HEADER(SystemInformation.hxx) #include KWSYS_HEADER(Process.h) -#include KWSYS_HEADER(ios/iostream) -#include KWSYS_HEADER(ios/sstream) -#include KWSYS_HEADER(ios/fstream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. @@ -52,12 +48,12 @@ # include "Configure.hxx.in" # include "kwsys_stl.hxx.in" # include "kwsys_stl_vector.in" -# include "kwsys_stl_iosfwd.in" -# include "kwsys_ios_sstream.h.in" -# include "kwsys_ios_iostream.h.in" -# include "kwsys_ios_fstream.h.in" #endif +#include <iostream> +#include <sstream> +#include <fstream> + #if defined(_WIN32) # include <windows.h> # if defined(_MSC_VER) && _MSC_VER >= 1800 @@ -635,7 +631,7 @@ bool SystemInformation::DoesCPUSupportFeature(long int i) kwsys_stl::string SystemInformation::GetCPUDescription() { - kwsys_ios::ostringstream oss; + std::ostringstream oss; oss << this->GetNumberOfPhysicalCPU() << " core "; @@ -725,7 +721,7 @@ int SystemInformation::GetOSIsApple() kwsys_stl::string SystemInformation::GetOSDescription() { - kwsys_ios::ostringstream oss; + std::ostringstream oss; oss << this->GetOSName() << " " @@ -781,7 +777,7 @@ kwsys_stl::string SystemInformation::GetMemoryDescription( const char *hostLimitEnvVarName, const char *procLimitEnvVarName) { - kwsys_ios::ostringstream oss; + std::ostringstream oss; oss << "Host Total: " << iostreamLongLong(this->GetHostMemoryTotal()) @@ -990,7 +986,7 @@ int NameValue( { continue; } - kwsys_ios::istringstream is(lines[i].substr(at+name.size())); + std::istringstream is(lines[i].substr(at+name.size())); is >> value; return 0; } @@ -1085,10 +1081,10 @@ void StacktraceSignalHandler( void * /*sigContext*/) { #if defined(__linux) || defined(__APPLE__) - kwsys_ios::ostringstream oss; + std::ostringstream oss; oss - << kwsys_ios::endl - << "=========================================================" << kwsys_ios::endl + << std::endl + << "=========================================================" << std::endl << "Process id " << getpid() << " "; switch (sigNo) { @@ -1281,11 +1277,11 @@ void StacktraceSignalHandler( break; } oss - << kwsys_ios::endl - << "Program Stack:" << kwsys_ios::endl + << std::endl + << "Program Stack:" << std::endl << SystemInformationImplementation::GetProgramStack(2,0) - << "=========================================================" << kwsys_ios::endl; - kwsys_ios::cerr << oss.str() << kwsys_ios::endl; + << "=========================================================" << std::endl; + std::cerr << oss.str() << std::endl; // restore the previously registered handlers // and abort @@ -1379,17 +1375,17 @@ private: }; // -------------------------------------------------------------------------- -kwsys_ios::ostream &operator<<( - kwsys_ios::ostream &os, +std::ostream &operator<<( + std::ostream &os, const SymbolProperties &sp) { #if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) os - << kwsys_ios::hex << sp.GetAddress() << " : " + << std::hex << sp.GetAddress() << " : " << sp.GetFunction() << " [(" << sp.GetBinary() << ") " << sp.GetSourceFile() << ":" - << kwsys_ios::dec << sp.GetLineNumber() << "]"; + << std::dec << sp.GetLineNumber() << "]"; #elif defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) void *addr = sp.GetAddress(); char **syminfo = backtrace_symbols(&addr,1); @@ -1899,7 +1895,7 @@ const char * SystemInformationImplementation::GetVendorID() /** Return the type ID of the CPU */ kwsys_stl::string SystemInformationImplementation::GetTypeID() { - kwsys_ios::ostringstream str; + std::ostringstream str; str << this->ChipID.Type; return str.str(); } @@ -1907,7 +1903,7 @@ kwsys_stl::string SystemInformationImplementation::GetTypeID() /** Return the family of the CPU present */ kwsys_stl::string SystemInformationImplementation::GetFamilyID() { - kwsys_ios::ostringstream str; + std::ostringstream str; str << this->ChipID.Family; return str.str(); } @@ -1915,7 +1911,7 @@ kwsys_stl::string SystemInformationImplementation::GetFamilyID() // Return the model of CPU present */ kwsys_stl::string SystemInformationImplementation::GetModelID() { - kwsys_ios::ostringstream str; + std::ostringstream str; str << this->ChipID.Model; return str.str(); } @@ -1929,7 +1925,7 @@ kwsys_stl::string SystemInformationImplementation::GetModelName() /** Return the stepping code of the CPU present. */ kwsys_stl::string SystemInformationImplementation::GetSteppingCode() { - kwsys_ios::ostringstream str; + std::ostringstream str; str << this->ChipID.Revision; return str.str(); } @@ -3185,7 +3181,7 @@ bool SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() FILE *fd = fopen("/proc/cpuinfo", "r" ); if ( !fd ) { - kwsys_ios::cout << "Problem opening /proc/cpuinfo" << kwsys_ios::endl; + std::cout << "Problem opening /proc/cpuinfo" << std::endl; return false; } @@ -3645,7 +3641,7 @@ SystemInformationImplementation::GetProcMemoryUsed() #elif defined(__APPLE__) SystemInformation::LongLong memUsed=0; pid_t pid=getpid(); - kwsys_ios::ostringstream oss; + std::ostringstream oss; oss << "ps -o rss= -p " << pid; FILE *file=popen(oss.str().c_str(),"r"); if (file==0) @@ -3670,7 +3666,7 @@ SystemInformationImplementation::GetProcMemoryUsed() { return -2; } - kwsys_ios::istringstream iss(oss.str()); + std::istringstream iss(oss.str()); iss >> memUsed; return memUsed; #else @@ -3752,7 +3748,7 @@ kwsys_stl::string SystemInformationImplementation::GetProgramStack( #endif ; - kwsys_ios::ostringstream oss; + std::ostringstream oss; #if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) void *stackSymbols[256]; int nFrames=backtrace(stackSymbols,256); @@ -3761,7 +3757,7 @@ kwsys_stl::string SystemInformationImplementation::GetProgramStack( SymbolProperties symProps; symProps.SetReportPath(wholePath); symProps.Initialize(stackSymbols[i]); - oss << symProps << kwsys_ios::endl; + oss << symProps << std::endl; } #else (void)firstFrame; @@ -3892,7 +3888,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() int errorFlag = uname(&unameInfo); if( errorFlag!=0 ) { - kwsys_ios::cout << "Problem calling uname(): " << strerror(errno) << kwsys_ios::endl; + std::cout << "Problem calling uname(): " << strerror(errno) << std::endl; return false; } @@ -3916,7 +3912,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() FILE *fd = fopen("/proc/meminfo", "r" ); if ( !fd ) { - kwsys_ios::cout << "Problem opening /proc/meminfo" << kwsys_ios::endl; + std::cout << "Problem opening /proc/meminfo" << std::endl; return false; } @@ -3954,7 +3950,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() } else { - kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl; + std::cout << "Problem parsing /proc/meminfo" << std::endl; fclose(fd); return false; } @@ -3987,7 +3983,7 @@ bool SystemInformationImplementation::QueryLinuxMemory() } else { - kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl; + std::cout << "Problem parsing /proc/meminfo" << std::endl; fclose(fd); return false; } @@ -4644,12 +4640,12 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector< } break; case kwsysProcess_State_Error: { - kwsys_ios::cerr << "Error: Could not run " << args[0] << ":\n"; - kwsys_ios::cerr << kwsysProcess_GetErrorString(gp) << "\n"; + std::cerr << "Error: Could not run " << args[0] << ":\n"; + std::cerr << kwsysProcess_GetErrorString(gp) << "\n"; } break; case kwsysProcess_State_Exception: { - kwsys_ios::cerr << "Error: " << args[0] + std::cerr << "Error: " << args[0] << " terminated with an exception: " << kwsysProcess_GetExceptionString(gp) << "\n"; } break; @@ -4659,14 +4655,14 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector< case kwsysProcess_State_Killed: { // Should not get here. - kwsys_ios::cerr << "Unexpected ending state after running " << args[0] - << kwsys_ios::endl; + std::cerr << "Unexpected ending state after running " << args[0] + << std::endl; } break; } kwsysProcess_Delete(gp); if(result) { - kwsys_ios::cerr << "Error " << args[0] << " returned :" << result << "\n"; + std::cerr << "Error " << args[0] << " returned :" << result << "\n"; } return buffer; } diff --git a/SystemInformation.hxx.in b/SystemInformation.hxx.in index 4acdc4f0a678d5dbc368535c80d7e3e1d77dfd17..9966f4ca6abca009f39eabdef2726b6af5c9f2f7 100644 --- a/SystemInformation.hxx.in +++ b/SystemInformation.hxx.in @@ -16,7 +16,6 @@ /* Define these macros temporarily to keep the code readable. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # define kwsys_stl @KWSYS_NAMESPACE@_stl -# define kwsys_ios @KWSYS_NAMESPACE@_ios #endif #include <@KWSYS_NAMESPACE@/stl/string> #include <stddef.h> /* size_t */ @@ -157,7 +156,6 @@ public: /* Undefine temporary macros. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # undef kwsys_stl -# undef kwsys_ios #endif #endif diff --git a/SystemTools.cxx b/SystemTools.cxx index f12a06c47bd2a9e308175970eed31bc7e14e488b..07aa9f5450c5e80a49eae2757723133e052d3375 100644 --- a/SystemTools.cxx +++ b/SystemTools.cxx @@ -31,9 +31,9 @@ #include KWSYS_HEADER(FStream.hxx) #include KWSYS_HEADER(Encoding.hxx) -#include KWSYS_HEADER(ios/iostream) -#include KWSYS_HEADER(ios/fstream) -#include KWSYS_HEADER(ios/sstream) +#include <iostream> +#include <fstream> +#include <sstream> #include KWSYS_HEADER(stl/set) @@ -44,9 +44,6 @@ # include "Directory.hxx.in" # include "FStream.hxx.in" # include "Encoding.hxx.in" -# include "kwsys_ios_iostream.h.in" -# include "kwsys_ios_fstream.h.in" -# include "kwsys_ios_sstream.h.in" #endif #ifdef _MSC_VER @@ -2308,11 +2305,11 @@ bool SystemTools::FilesDiffer(const kwsys_stl::string& source, #if defined(_WIN32) kwsys::ifstream finSource(source.c_str(), - (kwsys_ios::ios::binary | - kwsys_ios::ios::in)); + (std::ios::binary | + std::ios::in)); kwsys::ifstream finDestination(destination.c_str(), - (kwsys_ios::ios::binary | - kwsys_ios::ios::in)); + (std::ios::binary | + std::ios::in)); #else kwsys::ifstream finSource(source.c_str()); kwsys::ifstream finDestination(destination.c_str()); @@ -2328,13 +2325,13 @@ bool SystemTools::FilesDiffer(const kwsys_stl::string& source, while(nleft > 0) { // Read a block from each file. - kwsys_ios::streamsize nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : static_cast<kwsys_ios::streamsize>(nleft); + std::streamsize nnext = (nleft > KWSYS_ST_BUFFER)? KWSYS_ST_BUFFER : static_cast<std::streamsize>(nleft); finSource.read(source_buf, nnext); finDestination.read(dest_buf, nnext); // If either failed to read assume they are different. - if(static_cast<kwsys_ios::streamsize>(finSource.gcount()) != nnext || - static_cast<kwsys_ios::streamsize>(finDestination.gcount()) != nnext) + if(static_cast<std::streamsize>(finSource.gcount()) != nnext || + static_cast<std::streamsize>(finDestination.gcount()) != nnext) { return true; } @@ -2400,10 +2397,10 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st #if defined(_WIN32) kwsys::ifstream fin(Encoding::ToNarrow( SystemTools::ConvertToWindowsExtendedPath(source)).c_str(), - kwsys_ios::ios::in | kwsys_ios_binary); + std::ios::in | std::ios::binary); #else kwsys::ifstream fin(source.c_str(), - kwsys_ios::ios::in | kwsys_ios_binary); + std::ios::in | std::ios::binary); #endif if(!fin) { @@ -2419,10 +2416,10 @@ bool SystemTools::CopyFileAlways(const kwsys_stl::string& source, const kwsys_st #if defined(_WIN32) kwsys::ofstream fout(Encoding::ToNarrow( SystemTools::ConvertToWindowsExtendedPath(real_destination)).c_str(), - kwsys_ios::ios::out | kwsys_ios::ios::trunc | kwsys_ios_binary); + std::ios::out | std::ios::trunc | std::ios::binary); #else kwsys::ofstream fout(real_destination.c_str(), - kwsys_ios::ios::out | kwsys_ios::ios::trunc | kwsys_ios_binary); + std::ios::out | std::ios::trunc | std::ios::binary); #endif if(!fout) { @@ -3400,7 +3397,7 @@ bool SystemTools::FindProgramPath(const char* argv0, if(!SystemTools::FileExists(self)) { failures.push_back(self); - kwsys_ios::ostringstream msg; + std::ostringstream msg; msg << "Can not find the command line program "; if (exeName) { @@ -4618,7 +4615,7 @@ kwsys_stl::string SystemTools::MakeCidentifier(const kwsys_stl::string& s) // Due to a buggy stream library on the HP and another on Mac OS X, we // need this very carefully written version of getline. Returns true // if any data were read before the end-of-file was reached. -bool SystemTools::GetLineFromStream(kwsys_ios::istream& is, +bool SystemTools::GetLineFromStream(std::istream& is, kwsys_stl::string& line, bool* has_newline /* = 0 */, long sizeLimit /* = -1 */) @@ -4650,7 +4647,7 @@ bool SystemTools::GetLineFromStream(kwsys_ios::istream& is, // been reached. Clear the fail bit just before reading. while(!haveNewline && leftToRead != 0 && - (is.clear(is.rdstate() & ~kwsys_ios::ios::failbit), + (is.clear(is.rdstate() & ~std::ios::failbit), is.getline(buffer, bufferSize), is.gcount() > 0)) { // We have read at least one byte. diff --git a/SystemTools.hxx.in b/SystemTools.hxx.in index 164c5e04530e55eb29ef012477317ad2eb015d52..ffa1354486682250829a031e43ca3a114fbd5d1a 100644 --- a/SystemTools.hxx.in +++ b/SystemTools.hxx.in @@ -12,12 +12,13 @@ #ifndef @KWSYS_NAMESPACE@_SystemTools_hxx #define @KWSYS_NAMESPACE@_SystemTools_hxx -#include <@KWSYS_NAMESPACE@/ios/iosfwd> +#include <@KWSYS_NAMESPACE@/Configure.hxx> + +#include <iosfwd> #include <@KWSYS_NAMESPACE@/stl/string> #include <@KWSYS_NAMESPACE@/stl/vector> #include <@KWSYS_NAMESPACE@/stl/map> -#include <@KWSYS_NAMESPACE@/Configure.h> #include <@KWSYS_NAMESPACE@/String.hxx> #include <sys/types.h> @@ -50,7 +51,6 @@ namespace @KWSYS_NAMESPACE@ /* Define these macros temporarily to keep the code readable. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # define kwsys_stl @KWSYS_NAMESPACE@_stl -# define kwsys_ios @KWSYS_NAMESPACE@_ios #endif namespace @KWSYS_NAMESPACE@ @@ -539,7 +539,7 @@ public: * end-of-file was reached. If the has_newline argument is specified, it will * be true when the line read had a newline character. */ - static bool GetLineFromStream(kwsys_ios::istream& istr, + static bool GetLineFromStream(std::istream& istr, kwsys_stl::string& line, bool* has_newline=0, long sizeLimit=-1); @@ -1008,7 +1008,6 @@ private: /* Undefine temporary macros. */ #if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS # undef kwsys_stl -# undef kwsys_ios #endif #endif diff --git a/kwsys_ios_fstream.h.in b/kwsys_ios_fstream.h.in deleted file mode 100644 index 4b1a8cfcc403d86e2668202ad17fd7c5944541dc..0000000000000000000000000000000000000000 --- a/kwsys_ios_fstream.h.in +++ /dev/null @@ -1,46 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#ifndef @KWSYS_NAMESPACE@_ios_fstream -#define @KWSYS_NAMESPACE@_ios_fstream - -#include <@KWSYS_NAMESPACE@/Configure.hxx> - -#ifdef _MSC_VER -# pragma warning (push, 1) -# pragma warning (disable: 4702) -# pragma warning (disable: 4995) /* Old streams are deprecated. */ -#endif - -#if @KWSYS_NAMESPACE@_IOS_USE_ANSI -# include <fstream> -#else -# include <fstream.h> -#endif - -#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM -namespace @KWSYS_NAMESPACE@_ios -{ - using @KWSYS_NAMESPACE@_ios_namespace::ostream; - using @KWSYS_NAMESPACE@_ios_namespace::istream; - using @KWSYS_NAMESPACE@_ios_namespace::ofstream; - using @KWSYS_NAMESPACE@_ios_namespace::ifstream; - using @KWSYS_NAMESPACE@_ios_namespace::ios; - using @KWSYS_NAMESPACE@_ios_namespace::endl; - using @KWSYS_NAMESPACE@_ios_namespace::flush; -} -#endif - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -#endif diff --git a/kwsys_ios_iosfwd.h.in b/kwsys_ios_iosfwd.h.in deleted file mode 100644 index f4fafebc259cd6eb0dd91b174fa63425e3973b6f..0000000000000000000000000000000000000000 --- a/kwsys_ios_iosfwd.h.in +++ /dev/null @@ -1,49 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#ifndef @KWSYS_NAMESPACE@_ios_iosfwd -#define @KWSYS_NAMESPACE@_ios_iosfwd - -#include <@KWSYS_NAMESPACE@/Configure.hxx> - -#ifdef _MSC_VER -#pragma warning (push, 1) -#pragma warning (disable: 4702) -#endif - -#if @KWSYS_NAMESPACE@_IOS_USE_ANSI -# include <iosfwd> -#else -class fstream; -class ifstream; -class ios; -class istream; -class ofstream; -class ostream; -#endif - -#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM -namespace @KWSYS_NAMESPACE@_ios -{ - using @KWSYS_NAMESPACE@_ios_namespace::fstream; - using @KWSYS_NAMESPACE@_ios_namespace::ifstream; - using @KWSYS_NAMESPACE@_ios_namespace::ios; - using @KWSYS_NAMESPACE@_ios_namespace::istream; - using @KWSYS_NAMESPACE@_ios_namespace::ofstream; - using @KWSYS_NAMESPACE@_ios_namespace::ostream; -} -#endif - -#ifdef _MSC_VER -#pragma warning(pop) -#endif - -#endif diff --git a/kwsys_ios_iostream.h.in b/kwsys_ios_iostream.h.in deleted file mode 100644 index 43fc4d57901cd294c035fd434dcf3334b36b83d6..0000000000000000000000000000000000000000 --- a/kwsys_ios_iostream.h.in +++ /dev/null @@ -1,99 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#ifndef @KWSYS_NAMESPACE@_ios_iostream -#define @KWSYS_NAMESPACE@_ios_iostream - -#include <@KWSYS_NAMESPACE@/Configure.hxx> - -#ifdef _MSC_VER -# pragma warning (push, 1) -# pragma warning (disable: 4702) -# pragma warning (disable: 4995) /* Old streams are deprecated. */ -#endif - -#if @KWSYS_NAMESPACE@_IOS_USE_ANSI -# include <iostream> -#else -# include <iostream.h> -#endif - -// The HP implementation of iostream defines cin, cout, cerr, and clog -// as macros in order to do thread-private streams. -// See /opt/aCC/include/iostream/iostream.h for details. -// This block redefines the macros in a safe way that is also compatible -// with the HP definitions and the using declarations below. - -#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM -# if defined(__HP_aCC) && (defined(HP_THREAD_SAFE) || defined(_THREAD_SAFE)) -# if defined(cin) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CIN) -# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CIN -# undef cin -# define cin __tcin.ref() -# endif -# if defined(cout) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_COUT) -# define @KWSYS_NAMESPACE@_IOS_HP_HACK_COUT -# undef cout -# define cout __tcout.ref() -# endif -# if defined(cerr) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CERR) -# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CERR -# undef cerr -# define cerr __tcerr.ref() -# endif -# if defined(clog) && !defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG) -# define @KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG -# undef clog -# define clog __tclog.ref() -# endif -# endif -#endif - -// If using our own sstream emulation code, put the standard -// streams in the same namespace. -#if !@KWSYS_NAMESPACE@_IOS_USE_SSTREAM -namespace @KWSYS_NAMESPACE@_ios -{ - typedef int streamsize; - typedef int streamoff; - using @KWSYS_NAMESPACE@_ios_namespace::ostream; - using @KWSYS_NAMESPACE@_ios_namespace::istream; - using @KWSYS_NAMESPACE@_ios_namespace::ios; - using @KWSYS_NAMESPACE@_ios_namespace::endl; - using @KWSYS_NAMESPACE@_ios_namespace::flush; -# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CIN) - using @KWSYS_NAMESPACE@_ios_namespace::__tcin; -# else - using @KWSYS_NAMESPACE@_ios_namespace::cin; -# endif -# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_COUT) - using @KWSYS_NAMESPACE@_ios_namespace::__tcout; -# else - using @KWSYS_NAMESPACE@_ios_namespace::cout; -# endif -# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CERR) - using @KWSYS_NAMESPACE@_ios_namespace::__tcerr; -# else - using @KWSYS_NAMESPACE@_ios_namespace::cerr; -# endif -# if defined(@KWSYS_NAMESPACE@_IOS_HP_HACK_CLOG) - using @KWSYS_NAMESPACE@_ios_namespace::__tclog; -# else - using @KWSYS_NAMESPACE@_ios_namespace::clog; -# endif -} -#endif - -#ifdef _MSC_VER -# pragma warning(pop) -#endif - -#endif diff --git a/kwsys_ios_sstream.h.in b/kwsys_ios_sstream.h.in deleted file mode 100644 index 29d250c7a6bbb84a31f5cd530e6dbb99b584ab57..0000000000000000000000000000000000000000 --- a/kwsys_ios_sstream.h.in +++ /dev/null @@ -1,199 +0,0 @@ -/*============================================================================ - KWSys - Kitware System Library - Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - - Distributed under the OSI-approved BSD License (the "License"); - see accompanying file Copyright.txt for details. - - This software is distributed WITHOUT ANY WARRANTY; without even the - implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the License for more information. -============================================================================*/ -#ifndef @KWSYS_NAMESPACE@_ios_sstream -#define @KWSYS_NAMESPACE@_ios_sstream - -#include <@KWSYS_NAMESPACE@/Configure.hxx> - -/* Define this macro temporarily to keep the code readable. */ -#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS -# define kwsys_stl @KWSYS_NAMESPACE@_stl -#endif - -#if @KWSYS_NAMESPACE@_IOS_USE_SSTREAM -# ifdef _MSC_VER -# pragma warning (push, 1) -# pragma warning (disable: 4702) -# endif -# include <sstream> -# ifdef _MSC_VER -# pragma warning(pop) -# endif -#else -# ifdef _MSC_VER -# pragma warning (push, 1) -# pragma warning (disable: 4702) -# pragma warning (disable: 4995) /* Old streams are deprecated. */ -# endif -# if @KWSYS_NAMESPACE@_IOS_USE_ANSI -# include <strstream> -# elif @KWSYS_NAMESPACE@_IOS_USE_STRSTREAM_H -# include <strstream.h> -# elif @KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H -# include <strstrea.h> -# endif -# if @KWSYS_NAMESPACE@_IOS_USE_ANSI -# include <new> // Need placement operator new. -# else -# include <new.h> // Need placement operator new. -# endif -# ifdef _MSC_VER -# pragma warning(pop) -# endif - -// Only have old std strstream classes. Wrap them to look like new -// ostringstream and istringstream classes. - -# include <@KWSYS_NAMESPACE@/stl/string> - -namespace @KWSYS_NAMESPACE@_ios -{ -using @KWSYS_NAMESPACE@_ios_namespace::streambuf; -using @KWSYS_NAMESPACE@_ios_namespace::ostream; -using @KWSYS_NAMESPACE@_ios_namespace::istream; -using @KWSYS_NAMESPACE@_ios_namespace::strstream; -using @KWSYS_NAMESPACE@_ios_namespace::istrstream; -using @KWSYS_NAMESPACE@_ios_namespace::ostrstream; -using @KWSYS_NAMESPACE@_ios_namespace::ios; -using @KWSYS_NAMESPACE@_ios_namespace::endl; -using @KWSYS_NAMESPACE@_ios_namespace::ends; -using @KWSYS_NAMESPACE@_ios_namespace::flush; - -class stringstream_cleanup -{ -public: - stringstream_cleanup(strstream& str): m_StrStream(str) {} - ~stringstream_cleanup() { m_StrStream.rdbuf()->freeze(0); } - static void IgnoreUnusedVariable(const stringstream_cleanup&) {} -protected: - strstream& m_StrStream; -private: - void operator=(stringstream_cleanup const&); -}; - -class stringstream: public strstream -{ -public: - typedef strstream Superclass; - stringstream() {} - stringstream(const kwsys_stl::string& s) { *this << s.c_str(); } - kwsys_stl::string str() - { - stringstream_cleanup cleanup(*this); - stringstream_cleanup::IgnoreUnusedVariable(cleanup); -// Visual Studio 6 has a strstream::pcount, but this is not rdbuf()->pcount() -#if (@KWSYS_NAMESPACE@_IOS_USE_STRSTREA_H) && defined(_MSC_VER) && (_MSC_VER == 1200) - int count = this->pcount(); -#elif defined(__WATCOMC__) - int count = this->rdbuf()->out_waiting(); -#else - int count = this->rdbuf()->pcount(); -#endif - const char* ptr = this->Superclass::str(); - return kwsys_stl::string(ptr?ptr:"", count); - } - void str(const kwsys_stl::string& s) - { - this->~stringstream(); - new (this) stringstream(s); - } -private: - stringstream(const stringstream&); - void operator=(const stringstream&); -}; - -class ostringstream_cleanup -{ -public: - ostringstream_cleanup(ostrstream& ostr): m_OStrStream(ostr) {} - ~ostringstream_cleanup() { m_OStrStream.rdbuf()->freeze(0); } - static void IgnoreUnusedVariable(const ostringstream_cleanup&) {} -protected: - ostrstream& m_OStrStream; -private: - void operator=(ostringstream_cleanup const&); -}; - -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); - ostringstream_cleanup::IgnoreUnusedVariable(cleanup); - int count = this->pcount(); - const char* ptr = this->Superclass::str(); - return kwsys_stl::string(ptr?ptr:"", count); - } - void str(const kwsys_stl::string& s) - { - this->~ostringstream(); - new (this) ostringstream(s); - } -private: - ostringstream(const ostringstream&); - void operator=(const ostringstream&); -}; - -#if defined(_MSC_VER) -# pragma warning (push) -# pragma warning (disable: 4097) /* typedef-name used as synonym for class */ -#endif -#if defined(__WATCOMC__) -// W728: class modifiers for 'A' conflict with class modifiers for 'B' -# pragma warning 728 10 -#endif - -class istringstream: private kwsys_stl::string, public istrstream -{ -public: - typedef kwsys_stl::string StdString; - typedef istrstream IStrStream; - istringstream(): StdString(), - IStrStream(const_cast<char*>(StdString::c_str())) {} - istringstream(const kwsys_stl::string& s): - StdString(s), IStrStream(const_cast<char*>(StdString::c_str())) {} - kwsys_stl::string str() const { return *this; } - void str(const kwsys_stl::string& s) - { - this->~istringstream(); - new (this) istringstream(s); - } - void clear(int flags) - { - this->IStrStream::clear(flags); - } -private: - istringstream(const istringstream&); - void operator=(const istringstream&); -}; - -#if defined(__WATCOMC__) -# pragma warning 728 9 -#endif -#if defined(_MSC_VER) -# pragma warning (pop) -#endif - -} // namespace @KWSYS_NAMESPACE@_ios - -#endif - -/* Undefine temporary macro. */ -#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS -# undef kwsys_stl -#endif - -#endif diff --git a/kwsys_stl_string.hxx.in b/kwsys_stl_string.hxx.in index cd312cb8e38cb6b405a25c9302ea3dc40d19e955..dbc7f6373c6e32c48c63d9eecd425d9e8f8d48d2 100644 --- a/kwsys_stl_string.hxx.in +++ b/kwsys_stl_string.hxx.in @@ -26,20 +26,20 @@ # define KWSYS_STL_STRING_ISTREAM_DEFINED # define @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED # include <ctype.h> // isspace -# include <@KWSYS_NAMESPACE@/ios/iostream> +# include <iostream> # if defined(__WATCOMC__) namespace @KWSYS_NAMESPACE@ { -struct ios_istream_hack: public kwsys_ios::istream -{ void eatwhite() { this->@KWSYS_NAMESPACE@_ios::istream::eatwhite(); } }; +struct ios_istream_hack: public std::istream +{ void eatwhite() { this->std::istream::eatwhite(); } }; } # endif -inline @KWSYS_NAMESPACE@_ios::istream& -operator>>(@KWSYS_NAMESPACE@_ios::istream& is, +inline std::istream& +operator>>(std::istream& is, @KWSYS_NAMESPACE@_stl::string& s) { // Keep track of the resulting state. - int state = @KWSYS_NAMESPACE@_ios::ios::goodbit; + int state = std::ios::goodbit; // Save the width setting and set it back to zero. size_t n = static_cast<size_t>(is.width(0)); @@ -53,7 +53,7 @@ operator>>(@KWSYS_NAMESPACE@_ios::istream& is, #else is.eatwhite(); #endif - @KWSYS_NAMESPACE@_ios::istream& okay = is; + std::istream& okay = is; if(okay) { @@ -73,8 +73,8 @@ operator>>(@KWSYS_NAMESPACE@_ios::istream& is, } // Set flags for resulting state. - if(is.peek() == EOF) { state |= @KWSYS_NAMESPACE@_ios::ios::eofbit; } - if(!success) { state |= @KWSYS_NAMESPACE@_ios::ios::failbit; } + if(is.peek() == EOF) { state |= std::ios::eofbit; } + if(!success) { state |= std::ios::failbit; } } // Set the final result state. @@ -93,9 +93,9 @@ operator>>(@KWSYS_NAMESPACE@_ios::istream& is, #if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_OSTREAM && !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_OSTREAM) && !defined(KWSYS_STL_STRING_OSTREAM_DEFINED) # define KWSYS_STL_STRING_OSTREAM_DEFINED # define @KWSYS_NAMESPACE@_STL_STRING_OSTREAM_DEFINED -# include <@KWSYS_NAMESPACE@/ios/iostream> -inline @KWSYS_NAMESPACE@_ios::ostream& -operator<<(@KWSYS_NAMESPACE@_ios::ostream& os, +# include <iostream> +inline std::ostream& +operator<<(std::ostream& os, @KWSYS_NAMESPACE@_stl::string const& s) { return os << s.c_str(); diff --git a/testCommandLineArguments.cxx b/testCommandLineArguments.cxx index 6a03c0f7684643d04a61115e16ee76916724552b..ab8257f1b60092bee48f5b4f15b0964684082d9d 100644 --- a/testCommandLineArguments.cxx +++ b/testCommandLineArguments.cxx @@ -11,16 +11,16 @@ ============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(CommandLineArguments.hxx) -#include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(stl/vector) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "CommandLineArguments.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <iostream> + #include <stddef.h> /* size_t */ #include <string.h> /* strcmp */ @@ -28,10 +28,10 @@ static void* random_ptr = reinterpret_cast<void*>(0x123); static int argument(const char* arg, const char* value, void* call_data) { - kwsys_ios::cout << "Got argument: \"" << arg << "\" value: \"" << (value?value:"(null)") << "\"" << kwsys_ios::endl; + std::cout << "Got argument: \"" << arg << "\" value: \"" << (value?value:"(null)") << "\"" << std::endl; if ( call_data != random_ptr ) { - kwsys_ios::cerr << "Problem processing call_data" << kwsys_ios::endl; + std::cerr << "Problem processing call_data" << std::endl; return 0; } return 1; @@ -39,10 +39,10 @@ static int argument(const char* arg, const char* value, void* call_data) static int unknown_argument(const char* argument, void* call_data) { - kwsys_ios::cout << "Got unknown argument: \"" << argument << "\"" << kwsys_ios::endl; + std::cout << "Got unknown argument: \"" << argument << "\"" << std::endl; if ( call_data != random_ptr ) { - kwsys_ios::cerr << "Problem processing call_data" << kwsys_ios::endl; + std::cerr << "Problem processing call_data" << std::endl; return 0; } return 1; @@ -122,47 +122,47 @@ int testCommandLineArguments(int argc, char* argv[]) if ( !arg.Parse() ) { - kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl; + std::cerr << "Problem parsing arguments" << std::endl; res = 1; } - kwsys_ios::cout << "Help: " << arg.GetHelp() << kwsys_ios::endl; + std::cout << "Help: " << arg.GetHelp() << std::endl; - kwsys_ios::cout << "Some int variable was set to: " << some_int_variable << kwsys_ios::endl; - kwsys_ios::cout << "Some double variable was set to: " << some_double_variable << kwsys_ios::endl; + std::cout << "Some int variable was set to: " << some_int_variable << std::endl; + std::cout << "Some double variable was set to: " << some_double_variable << std::endl; if ( some_string_variable && strcmp(some_string_variable, "test string with space") == 0) { - kwsys_ios::cout << "Some string variable was set to: " << some_string_variable << kwsys_ios::endl; + std::cout << "Some string variable was set to: " << some_string_variable << std::endl; delete [] some_string_variable; } else { - kwsys_ios::cerr << "Problem setting string variable" << kwsys_ios::endl; + std::cerr << "Problem setting string variable" << std::endl; res = 1; } size_t cc; #define CompareTwoLists(list1, list_valid, lsize) \ if ( list1.size() != lsize ) \ { \ - kwsys_ios::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \ - << " should be: " << lsize << kwsys_ios::endl; \ + std::cerr << "Problem setting " #list1 ". Size is: " << list1.size() \ + << " should be: " << lsize << std::endl; \ res = 1; \ } \ else \ { \ - kwsys_ios::cout << #list1 " argument set:"; \ + std::cout << #list1 " argument set:"; \ for ( cc =0; cc < lsize; ++ cc ) \ { \ - kwsys_ios::cout << " " << list1[cc]; \ + std::cout << " " << list1[cc]; \ if ( !CompareTwoItemsOnList(list1[cc], list_valid[cc]) ) \ { \ - kwsys_ios::cerr << "Problem setting " #list1 ". Value of " \ + std::cerr << "Problem setting " #list1 ". Value of " \ << cc << " is: [" << list1[cc] << "] <> [" \ - << list_valid[cc] << "]" << kwsys_ios::endl; \ + << list_valid[cc] << "]" << std::endl; \ res = 1; \ break; \ } \ } \ - kwsys_ios::cout << kwsys_ios::endl; \ + std::cout << std::endl; \ } CompareTwoLists(numbers_argument, valid_numbers, 10); @@ -171,12 +171,12 @@ int testCommandLineArguments(int argc, char* argv[]) CompareTwoLists(strings_argument, valid_strings, 4); CompareTwoLists(stl_strings_argument, valid_stl_strings, 4); - kwsys_ios::cout << "Some STL String variable was set to: " << some_stl_string_variable << kwsys_ios::endl; - kwsys_ios::cout << "Some bool variable was set to: " << some_bool_variable << kwsys_ios::endl; - kwsys_ios::cout << "Some bool variable was set to: " << some_bool_variable1 << kwsys_ios::endl; - kwsys_ios::cout << "bool_arg1 variable was set to: " << bool_arg1 << kwsys_ios::endl; - kwsys_ios::cout << "bool_arg2 variable was set to: " << bool_arg2 << kwsys_ios::endl; - kwsys_ios::cout << kwsys_ios::endl; + std::cout << "Some STL String variable was set to: " << some_stl_string_variable << std::endl; + std::cout << "Some bool variable was set to: " << some_bool_variable << std::endl; + std::cout << "Some bool variable was set to: " << some_bool_variable1 << std::endl; + std::cout << "bool_arg1 variable was set to: " << bool_arg1 << std::endl; + std::cout << "bool_arg2 variable was set to: " << bool_arg2 << std::endl; + std::cout << std::endl; for ( cc = 0; cc < strings_argument.size(); ++ cc ) { diff --git a/testCommandLineArguments1.cxx b/testCommandLineArguments1.cxx index b65c37f85cead2d8edfd5ba1e8f1a2148a8423c6..1ae2cb1dfa7c7a74bf18c290f893985be4411b57 100644 --- a/testCommandLineArguments1.cxx +++ b/testCommandLineArguments1.cxx @@ -11,16 +11,15 @@ ============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(CommandLineArguments.hxx) -#include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(stl/vector) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "CommandLineArguments.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <iostream> #include <assert.h> /* assert */ #include <string.h> /* strcmp */ @@ -43,27 +42,27 @@ int testCommandLineArguments1(int argc, char* argv[]) if ( !arg.Parse() ) { - kwsys_ios::cerr << "Problem parsing arguments" << kwsys_ios::endl; + std::cerr << "Problem parsing arguments" << std::endl; res = 1; } if ( n != 24 ) { - kwsys_ios::cout << "Problem setting N. Value of N: " << n << kwsys_ios::endl; + std::cout << "Problem setting N. Value of N: " << n << std::endl; res = 1; } if ( !m || strcmp(m, "test value") != 0 ) { - kwsys_ios::cout << "Problem setting M. Value of M: " << m << kwsys_ios::endl; + std::cout << "Problem setting M. Value of M: " << m << std::endl; res = 1; } if ( p != "1" ) { - kwsys_ios::cout << "Problem setting P. Value of P: " << p << kwsys_ios::endl; + std::cout << "Problem setting P. Value of P: " << p << std::endl; res = 1; } - kwsys_ios::cout << "Value of N: " << n << kwsys_ios::endl; - kwsys_ios::cout << "Value of M: " << m << kwsys_ios::endl; - kwsys_ios::cout << "Value of P: " << p << kwsys_ios::endl; + std::cout << "Value of N: " << n << std::endl; + std::cout << "Value of M: " << m << std::endl; + std::cout << "Value of P: " << p << std::endl; if ( m ) { delete [] m; @@ -79,25 +78,25 @@ int testCommandLineArguments1(int argc, char* argv[]) }; if ( newArgc != 9 ) { - kwsys_ios::cerr << "Bad number of unused arguments: " << newArgc << kwsys_ios::endl; + std::cerr << "Bad number of unused arguments: " << newArgc << std::endl; res = 1; } for ( cc = 0; cc < newArgc; ++ cc ) { assert(newArgv[cc]); /* Quiet Clang scan-build. */ - kwsys_ios::cout << "Unused argument[" << cc << "] = [" << newArgv[cc] << "]" - << kwsys_ios::endl; + std::cout << "Unused argument[" << cc << "] = [" << newArgv[cc] << "]" + << std::endl; if ( cc >= 9 ) { - kwsys_ios::cerr << "Too many unused arguments: " << cc << kwsys_ios::endl; + std::cerr << "Too many unused arguments: " << cc << std::endl; res = 1; } else if ( valid_unused_args[cc] && strcmp(valid_unused_args[cc], newArgv[cc]) != 0 ) { - kwsys_ios::cerr << "Bad unused argument [" << cc << "] \"" + std::cerr << "Bad unused argument [" << cc << "] \"" << newArgv[cc] << "\" should be: \"" << valid_unused_args[cc] << "\"" - << kwsys_ios::endl; + << std::endl; res = 1; } } diff --git a/testDynamicLoader.cxx b/testDynamicLoader.cxx index 58adb844b7897131559107b9c4be171e5e920128..0902bfe52dc7dd263b9e6a635e0e242f122966ce 100644 --- a/testDynamicLoader.cxx +++ b/testDynamicLoader.cxx @@ -12,7 +12,6 @@ #include "kwsysPrivate.h" #include KWSYS_HEADER(DynamicLoader.hxx) -#include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(stl/string) #if defined(__BEOS__) || defined(__HAIKU__) @@ -23,10 +22,11 @@ // duplicate the above list of headers. #if 0 # include "DynamicLoader.hxx.in" -# include "kwsys_ios_iostream.h.in" # include "kwsys_stl_string.hxx.in" #endif +#include <iostream> + // Include with <> instead of "" to avoid getting any in-source copy // left on disk. #include <testSystemTools.h> @@ -56,30 +56,30 @@ static kwsys_stl::string GetLibName(const char* lname) */ int TestDynamicLoader(const char* libname, const char* symbol, int r1, int r2, int r3) { - kwsys_ios::cerr << "Testing: " << libname << kwsys_ios::endl; + std::cerr << "Testing: " << libname << std::endl; kwsys::DynamicLoader::LibraryHandle l = kwsys::DynamicLoader::OpenLibrary(libname); // If result is incompatible with expectation just fails (xor): if( (r1 && !l) || (!r1 && l) ) { - kwsys_ios::cerr - << kwsys::DynamicLoader::LastError() << kwsys_ios::endl; + std::cerr + << kwsys::DynamicLoader::LastError() << std::endl; return 1; } kwsys::DynamicLoader::SymbolPointer f = kwsys::DynamicLoader::GetSymbolAddress(l, symbol); if( (r2 && !f) || (!r2 && f) ) { - kwsys_ios::cerr - << kwsys::DynamicLoader::LastError() << kwsys_ios::endl; + std::cerr + << kwsys::DynamicLoader::LastError() << std::endl; return 1; } #ifndef __APPLE__ int s = kwsys::DynamicLoader::CloseLibrary(l); if( (r3 && !s) || (!r3 && s) ) { - kwsys_ios::cerr - << kwsys::DynamicLoader::LastError() << kwsys_ios::endl; + std::cerr + << kwsys::DynamicLoader::LastError() << std::endl; return 1; } #else diff --git a/testEncoding.cxx b/testEncoding.cxx index 094588c1e3e13b6732b088fc74e534ce908ae75f..842b17dd52d738abda1553d3b1aa1aa86b1c5327 100644 --- a/testEncoding.cxx +++ b/testEncoding.cxx @@ -17,8 +17,8 @@ #include KWSYS_HEADER(Encoding.hxx) #include KWSYS_HEADER(Encoding.h) -#include KWSYS_HEADER(ios/iostream) +#include <iostream> #include <locale.h> #include <string.h> #include <stdlib.h> @@ -28,7 +28,6 @@ #if 0 # include "Encoding.hxx.in" # include "Encoding.h.in" -# include "kwsys_ios_iostream.h.in" #endif //---------------------------------------------------------------------------- diff --git a/testFStream.cxx b/testFStream.cxx index 9abfd4caa74ac1d335a171cc66615f31dfddc69b..ac5220ac06bd66fb0d34d583e6d5d706ea3bbf25 100644 --- a/testFStream.cxx +++ b/testFStream.cxx @@ -16,7 +16,6 @@ #endif #include KWSYS_HEADER(FStream.hxx) -#include KWSYS_HEADER(ios/iostream) #include <string.h> #ifdef __BORLANDC__ # include <mem.h> /* memcmp */ @@ -26,9 +25,9 @@ // duplicate the above list of headers. #if 0 # include "FStream.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <iostream> //---------------------------------------------------------------------------- static int testNoFile() @@ -95,20 +94,20 @@ static int testBOM() kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in); if(bom != expected_bom[i]) { - kwsys_ios::cout << "Unexpected BOM " << i << std::endl; + std::cout << "Unexpected BOM " << i << std::endl; return 1; } char data[45]; in.read(data, file_data[i][0]); if(!in.good()) { - kwsys_ios::cout << "Unable to read data " << i << std::endl; + std::cout << "Unable to read data " << i << std::endl; return 1; } if(memcmp(data, file_data[i]+1, file_data[i][0]) != 0) { - kwsys_ios::cout << "Incorrect read data " << i << std::endl; + std::cout << "Incorrect read data " << i << std::endl; return 1; } @@ -125,20 +124,20 @@ static int testBOM() kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in); if(bom != kwsys::FStream::BOM_None) { - kwsys_ios::cout << "Unexpected BOM for none case" << std::endl; + std::cout << "Unexpected BOM for none case" << std::endl; return 1; } char data[45]; in.read(data, file_data[0][0]); if(!in.good()) { - kwsys_ios::cout << "Unable to read data for none case" << std::endl; + std::cout << "Unable to read data for none case" << std::endl; return 1; } if(memcmp(data, file_data[0]+1, file_data[0][0]) != 0) { - kwsys_ios::cout << "Incorrect read data for none case" << std::endl; + std::cout << "Incorrect read data for none case" << std::endl; return 1; } } @@ -156,20 +155,20 @@ static int testBOM() kwsys::FStream::BOM bom = kwsys::FStream::ReadBOM(in); if(bom != kwsys::FStream::BOM_UTF8) { - kwsys_ios::cout << "Unexpected BOM for utf-8 case" << std::endl; + std::cout << "Unexpected BOM for utf-8 case" << std::endl; return 1; } char data[45]; in.read(data, file_data[0][0]); if(!in.good()) { - kwsys_ios::cout << "Unable to read data for utf-8 case" << std::endl; + std::cout << "Unable to read data for utf-8 case" << std::endl; return 1; } if(memcmp(data, file_data[0]+1, file_data[0][0]) != 0) { - kwsys_ios::cout << "Incorrect read data for utf-8 case" << std::endl; + std::cout << "Incorrect read data for utf-8 case" << std::endl; return 1; } } diff --git a/testHashSTL.cxx b/testHashSTL.cxx index ac5cf74f58c1ae742e1166d4ec295f84404f2028..ab1f83e78026abcde42fe44bb646f752f97ecb89 100644 --- a/testHashSTL.cxx +++ b/testHashSTL.cxx @@ -12,7 +12,6 @@ #include "kwsysPrivate.h" #include KWSYS_HEADER(hash_map.hxx) #include KWSYS_HEADER(hash_set.hxx) -#include KWSYS_HEADER(ios/iostream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. @@ -20,9 +19,10 @@ # include "hash_map.hxx.in" # include "hash_set.hxx.in" # include "hashtable.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <iostream> + #if defined(_MSC_VER) # pragma warning (disable:4786) #endif @@ -44,8 +44,8 @@ static bool test_hash_map() int sum = 0; for(mtype::iterator mi = m.begin(); mi != m.end(); ++mi) { - kwsys_ios::cout << "Found entry [" << mi->first << "," << mi->second << "]" - << kwsys_ios::endl; + std::cout << "Found entry [" << mi->first << "," << mi->second << "]" + << std::endl; sum += mi->second; } return sum == 3; @@ -60,7 +60,7 @@ static bool test_hash_set() int sum = 0; for(stype::iterator si = s.begin(); si != s.end(); ++si) { - kwsys_ios::cout << "Found entry [" << *si << "]" << kwsys_ios::endl; + std::cout << "Found entry [" << *si << "]" << std::endl; sum += *si; } return sum == 3; diff --git a/testIOS.cxx b/testIOS.cxx index f0c7f1a7bc193cc373f9c1d6e6448a3b0536a613..63b467a5e3ca48d64ef815af8b9178cdb7cf241d 100644 --- a/testIOS.cxx +++ b/testIOS.cxx @@ -11,157 +11,154 @@ ============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(stl/vector) -#include KWSYS_HEADER(ios/sstream) -#include KWSYS_HEADER(ios/fstream) -#include KWSYS_HEADER(ios/iostream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "kwsys_stl_string.hxx.in" # include "kwsys_stl_vector.h.in" -# include "kwsys_ios_sstream.h.in" -# include "kwsys_ios_fstream.h.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <sstream> +#include <fstream> +#include <iostream> #include <string.h> /* strlen */ int testIOS(int, char*[]) { - kwsys_ios::ostringstream ostr; + std::ostringstream ostr; const char hello[] = "hello"; ostr << hello; if(ostr.str() != hello) { - kwsys_ios::cerr << "failed to write hello to ostr" << kwsys_ios::endl; + std::cerr << "failed to write hello to ostr" << std::endl; return 1; } const char world[] = "world"; - kwsys_ios::ostringstream ostr2; + std::ostringstream ostr2; ostr2.write( hello, strlen(hello) ); /* I could do sizeof */ ostr2.put( '\0' ); ostr2.write( world, strlen(world) ); if(ostr2.str().size() != strlen(hello) + 1 + strlen(world) ) { - kwsys_ios::cerr << "failed to write hello to ostr2" << kwsys_ios::endl; + std::cerr << "failed to write hello to ostr2" << std::endl; return 1; } static const unsigned char array[] = { 0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x2e,0x30,0xff,0x90,0x00,0x0a,0x00,0x00,0x00,0x00,0x06,0x2c,0x00,0x01,0xff,0x93,0xcf,0xb0,0x18,0x08,0x7f,0xc6,0x99,0xbf,0xff,0xc0,0xf8,0xc1,0xc1,0xf3,0x05,0x81,0xf2,0x83,0x0a,0xa5,0xff,0x10,0x90,0xbf,0x2f,0xff,0x04,0xa8,0x7f,0xc0,0xf8,0xc4,0xc1,0xf3,0x09,0x81,0xf3,0x0c,0x19,0x34 }; const size_t narray = sizeof(array); // 180 - kwsys_ios::stringstream strstr; + std::stringstream strstr; strstr.write( (char*)array, narray ); //strstr.seekp( narray / 2 ); // set position of put pointer in mid string if(strstr.str().size() != narray ) { - kwsys_ios::cerr << "failed to write array to strstr" << kwsys_ios::endl; + std::cerr << "failed to write array to strstr" << std::endl; return 1; } - kwsys_ios::istringstream istr(" 10 20 str "); + std::istringstream istr(" 10 20 str "); kwsys_stl::string s; int x; if(istr >> x) { if(x != 10) { - kwsys_ios::cerr << "x != 10" << kwsys_ios::endl; + std::cerr << "x != 10" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read 10 from istr" << kwsys_ios::endl; + std::cerr << "Failed to read 10 from istr" << std::endl; return 1; } if(istr >> x) { if(x != 20) { - kwsys_ios::cerr << "x != 20" << kwsys_ios::endl; + std::cerr << "x != 20" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read 20 from istr" << kwsys_ios::endl; + std::cerr << "Failed to read 20 from istr" << std::endl; return 1; } if(istr >> s) { if(s != "str") { - kwsys_ios::cerr << "s != \"str\"" << kwsys_ios::endl; + std::cerr << "s != \"str\"" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read str from istr" << kwsys_ios::endl; + std::cerr << "Failed to read str from istr" << std::endl; return 1; } if(istr >> s) { - kwsys_ios::cerr << "Able to read past end of stream" << kwsys_ios::endl; + std::cerr << "Able to read past end of stream" << std::endl; return 1; } else { // Clear the failure. - istr.clear(istr.rdstate() & ~kwsys_ios::ios::eofbit); - istr.clear(istr.rdstate() & ~kwsys_ios::ios::failbit); + istr.clear(istr.rdstate() & ~std::ios::eofbit); + istr.clear(istr.rdstate() & ~std::ios::failbit); } istr.str("30"); if(istr >> x) { if(x != 30) { - kwsys_ios::cerr << "x != 30" << kwsys_ios::endl; + std::cerr << "x != 30" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read 30 from istr" << kwsys_ios::endl; + std::cerr << "Failed to read 30 from istr" << std::endl; return 1; } - kwsys_ios::stringstream sstr; + std::stringstream sstr; sstr << "40 str2"; if(sstr >> x) { if(x != 40) { - kwsys_ios::cerr << "x != 40" << kwsys_ios::endl; + std::cerr << "x != 40" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read 40 from sstr" << kwsys_ios::endl; + std::cerr << "Failed to read 40 from sstr" << std::endl; return 1; } if(sstr >> s) { if(s != "str2") { - kwsys_ios::cerr << "s != \"str2\"" << kwsys_ios::endl; + std::cerr << "s != \"str2\"" << std::endl; return 1; } } else { - kwsys_ios::cerr << "Failed to read str2 from sstr" << kwsys_ios::endl; + std::cerr << "Failed to read str2 from sstr" << std::endl; return 1; } // Just try to compile this. if(x == 12345) { - kwsys_ios::ifstream fin("/does_not_exist", - kwsys_ios::ios::in | kwsys_ios_binary); + std::ifstream fin("/does_not_exist", + std::ios::in | std::ios::binary); } - kwsys_ios::cout << "IOS tests passed" << kwsys_ios::endl; + std::cout << "IOS tests passed" << std::endl; return 0; } diff --git a/testSystemInformation.cxx b/testSystemInformation.cxx index fc8ea55d85c4a60863cdeb812e054aa9a6a7b040..c96751ab42aadf51f62ccf336a978329fa51c83b 100644 --- a/testSystemInformation.cxx +++ b/testSystemInformation.cxx @@ -11,15 +11,15 @@ ============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(SystemInformation.hxx) -#include KWSYS_HEADER(ios/iostream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "SystemInformation.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif +#include <iostream> + #if defined(KWSYS_USE_LONG_LONG) # if defined(KWSYS_IOS_HAS_OSTREAM_LONG_LONG) # define iostreamLongLong(x) (x) @@ -36,18 +36,18 @@ # error "No Long Long" #endif -#define printMethod(info, m) kwsys_ios::cout << #m << ": " \ +#define printMethod(info, m) std::cout << #m << ": " \ << info.m() << "\n" -#define printMethod2(info, m, unit) kwsys_ios::cout << #m << ": " \ +#define printMethod2(info, m, unit) std::cout << #m << ": " \ << info.m() << " " << unit << "\n" -#define printMethod3(info, m, unit) kwsys_ios::cout << #m << ": " \ +#define printMethod3(info, m, unit) std::cout << #m << ": " \ << iostreamLongLong(info.m) << " " << unit << "\n" int testSystemInformation(int, char*[]) { - kwsys_ios::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation + std::cout << "CTEST_FULL_OUTPUT\n"; // avoid truncation kwsys::SystemInformation info; info.RunCPUCheck(); @@ -93,16 +93,16 @@ int testSystemInformation(int, char*[]) { if (info.DoesCPUSupportFeature(static_cast<long int>(1) << i)) { - kwsys_ios::cout << "CPU feature " << i << "\n"; + std::cout << "CPU feature " << i << "\n"; } } /* test stack trace */ - kwsys_ios::cout - << "Program Stack:" << kwsys_ios::endl - << kwsys::SystemInformation::GetProgramStack(0,0) << kwsys_ios::endl - << kwsys_ios::endl; + std::cout + << "Program Stack:" << std::endl + << kwsys::SystemInformation::GetProgramStack(0,0) << std::endl + << std::endl; /* test segv handler info.SetStackTraceOnError(1); diff --git a/testSystemTools.cxx b/testSystemTools.cxx index bc9ca5e5bd97f4976b792840b0764ba35c1e71cd..d4852b250ed0058005baaf7561a55aae250367b4 100644 --- a/testSystemTools.cxx +++ b/testSystemTools.cxx @@ -16,19 +16,18 @@ #endif #include KWSYS_HEADER(SystemTools.hxx) -#include KWSYS_HEADER(ios/iostream) // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 # include "SystemTools.hxx.in" -# include "kwsys_ios_iostream.h.in" #endif // Include with <> instead of "" to avoid getting any in-source copy // left on disk. #include <testSystemTools.h> +#include <iostream> #include <string.h> /* strcmp */ #if defined(_WIN32) && !defined(__CYGWIN__) # include <io.h> /* _umask (MSVC) / umask (Borland) */ @@ -70,10 +69,10 @@ static bool CheckConvertToUnixSlashes(kwsys_stl::string input, kwsys::SystemTools::ConvertToUnixSlashes(result); if ( result != output ) { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToUnixSlashes - input: " << input << " output: " << result << " expected: " << output - << kwsys_ios::endl; + << std::endl; return false; } return true; @@ -96,10 +95,10 @@ static bool CheckEscapeChars(kwsys_stl::string input, input.c_str(), chars_to_escape, escape_char); if (result != output) { - kwsys_ios::cerr + std::cerr << "Problem with CheckEscapeChars - input: " << input << " output: " << result << " expected: " << output - << kwsys_ios::endl; + << std::endl; return false; } return true; @@ -124,60 +123,60 @@ static bool CheckFileOperations() if (kwsys::SystemTools::DetectFileType(testNonExistingFile.c_str()) != kwsys::SystemTools::FileTypeUnknown) { - kwsys_ios::cerr + std::cerr << "Problem with DetectFileType - failed to detect type of: " - << testNonExistingFile << kwsys_ios::endl; + << testNonExistingFile << std::endl; res = false; } if (kwsys::SystemTools::DetectFileType(testDotFile.c_str()) != kwsys::SystemTools::FileTypeUnknown) { - kwsys_ios::cerr + std::cerr << "Problem with DetectFileType - failed to detect type of: " - << testDotFile << kwsys_ios::endl; + << testDotFile << std::endl; res = false; } if (kwsys::SystemTools::DetectFileType(testBinFile.c_str()) != kwsys::SystemTools::FileTypeBinary) { - kwsys_ios::cerr + std::cerr << "Problem with DetectFileType - failed to detect type of: " - << testBinFile << kwsys_ios::endl; + << testBinFile << std::endl; res = false; } if (kwsys::SystemTools::DetectFileType(testTxtFile.c_str()) != kwsys::SystemTools::FileTypeText) { - kwsys_ios::cerr + std::cerr << "Problem with DetectFileType - failed to detect type of: " - << testTxtFile << kwsys_ios::endl; + << testTxtFile << std::endl; res = false; } if (kwsys::SystemTools::FileLength(testBinFile) != 766) { - kwsys_ios::cerr + std::cerr << "Problem with FileLength - incorrect length for: " - << testBinFile << kwsys_ios::endl; + << testBinFile << std::endl; res = false; } if (!kwsys::SystemTools::MakeDirectory(testNewDir)) { - kwsys_ios::cerr + std::cerr << "Problem with MakeDirectory for: " - << testNewDir << kwsys_ios::endl; + << testNewDir << std::endl; res = false; } if (!kwsys::SystemTools::Touch(testNewFile.c_str(), true)) { - kwsys_ios::cerr + std::cerr << "Problem with Touch for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } @@ -195,34 +194,34 @@ static bool CheckFileOperations() mode_t origPerm, thisPerm; if (!kwsys::SystemTools::GetPermissions(testNewFile, origPerm)) { - kwsys_ios::cerr + std::cerr << "Problem with GetPermissions (1) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if (!kwsys::SystemTools::SetPermissions(testNewFile, 0)) { - kwsys_ios::cerr + std::cerr << "Problem with SetPermissions (1) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm)) { - kwsys_ios::cerr + std::cerr << "Problem with GetPermissions (2) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if ((thisPerm & fullMask) != 0) { - kwsys_ios::cerr + std::cerr << "SetPermissions failed to set permissions (1) for: " << testNewFile << ": actual = " << thisPerm << "; expected = " - << 0 << kwsys_ios::endl; + << 0 << std::endl; res = false; } @@ -230,70 +229,70 @@ static bool CheckFileOperations() if (kwsys::SystemTools::TestFileAccess(testNewFile, kwsys::TEST_FILE_WRITE)) { - kwsys_ios::cerr + std::cerr << "TestFileAccess incorrectly indicated that this is a writable file:" - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if (!kwsys::SystemTools::TestFileAccess(testNewFile, kwsys::TEST_FILE_OK)) { - kwsys_ios::cerr + std::cerr << "TestFileAccess incorrectly indicated that this file does not exist:" - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } // Test restoring/setting full permissions. if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask)) { - kwsys_ios::cerr + std::cerr << "Problem with SetPermissions (2) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm)) { - kwsys_ios::cerr + std::cerr << "Problem with GetPermissions (3) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if ((thisPerm & fullMask) != fullMask) { - kwsys_ios::cerr + std::cerr << "SetPermissions failed to set permissions (2) for: " << testNewFile << ": actual = " << thisPerm << "; expected = " - << fullMask << kwsys_ios::endl; + << fullMask << std::endl; res = false; } // Test setting file permissions while honoring umask if (!kwsys::SystemTools::SetPermissions(testNewFile, fullMask, true)) { - kwsys_ios::cerr + std::cerr << "Problem with SetPermissions (3) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if (!kwsys::SystemTools::GetPermissions(testNewFile, thisPerm)) { - kwsys_ios::cerr + std::cerr << "Problem with GetPermissions (4) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } if ((thisPerm & fullMask) != 0) { - kwsys_ios::cerr + std::cerr << "SetPermissions failed to honor umask for: " << testNewFile << ": actual = " << thisPerm << "; expected = " - << 0 << kwsys_ios::endl; + << 0 << std::endl; res = false; } @@ -303,18 +302,18 @@ static bool CheckFileOperations() // Restore file permissions if (!kwsys::SystemTools::SetPermissions(testNewFile, origPerm)) { - kwsys_ios::cerr + std::cerr << "Problem with SetPermissions (4) for: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } // Remove the test file if (!kwsys::SystemTools::RemoveFile(testNewFile)) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveFile: " - << testNewFile << kwsys_ios::endl; + << testNewFile << std::endl; res = false; } @@ -322,7 +321,7 @@ static bool CheckFileOperations() if (!kwsys::SystemTools::RemoveFile(testFileMissing)) { std::string const& msg = kwsys::SystemTools::GetLastSystemError(); - kwsys_ios::cerr << + std::cerr << "RemoveFile(\"" << testFileMissing << "\") failed: " << msg << "\n"; res = false; } @@ -331,7 +330,7 @@ static bool CheckFileOperations() if (!kwsys::SystemTools::RemoveFile(testFileMissingDir)) { std::string const& msg = kwsys::SystemTools::GetLastSystemError(); - kwsys_ios::cerr << + std::cerr << "RemoveFile(\"" << testFileMissingDir << "\") failed: " << msg << "\n"; res = false; } @@ -339,9 +338,9 @@ static bool CheckFileOperations() kwsys::SystemTools::Touch(testNewFile.c_str(), true); if (!kwsys::SystemTools::RemoveADirectory(testNewDir)) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveADirectory for: " - << testNewDir << kwsys_ios::endl; + << testNewDir << std::endl; res = false; } @@ -365,34 +364,34 @@ static bool CheckFileOperations() if (!kwsys::SystemTools::MakeDirectory(testNewLongDir)) { - kwsys_ios::cerr + std::cerr << "Problem with MakeDirectory for: " - << testNewLongDir << kwsys_ios::endl; + << testNewLongDir << std::endl; res = false; } if (!kwsys::SystemTools::Touch(testNewLongFile.c_str(), true)) { - kwsys_ios::cerr + std::cerr << "Problem with Touch for: " - << testNewLongFile << kwsys_ios::endl; + << testNewLongFile << std::endl; res = false; } if (!kwsys::SystemTools::RemoveFile(testNewLongFile)) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveFile: " - << testNewLongFile << kwsys_ios::endl; + << testNewLongFile << std::endl; res = false; } kwsys::SystemTools::Touch(testNewLongFile.c_str(), true); if (!kwsys::SystemTools::RemoveADirectory(testNewLongDir)) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveADirectory for: " - << testNewLongDir << kwsys_ios::endl; + << testNewLongDir << std::endl; res = false; } #endif @@ -408,9 +407,9 @@ static bool CheckStringOperations() kwsys_stl::string test = "mary had a little lamb."; if (kwsys::SystemTools::CapitalizedWords(test) != "Mary Had A Little Lamb.") { - kwsys_ios::cerr + std::cerr << "Problem with CapitalizedWords " - << '"' << test << '"' << kwsys_ios::endl; + << '"' << test << '"' << std::endl; res = false; } @@ -418,9 +417,9 @@ static bool CheckStringOperations() if (kwsys::SystemTools::UnCapitalizedWords(test) != "mary had a little lamb.") { - kwsys_ios::cerr + std::cerr << "Problem with UnCapitalizedWords " - << '"' << test << '"' << kwsys_ios::endl; + << '"' << test << '"' << std::endl; res = false; } @@ -428,9 +427,9 @@ static bool CheckStringOperations() if (kwsys::SystemTools::AddSpaceBetweenCapitalizedWords(test) != "Mary Had The Little Lamb.") { - kwsys_ios::cerr + std::cerr << "Problem with AddSpaceBetweenCapitalizedWords " - << '"' << test << '"' << kwsys_ios::endl; + << '"' << test << '"' << std::endl; res = false; } @@ -438,9 +437,9 @@ static bool CheckStringOperations() kwsys::SystemTools::AppendStrings("Mary Had A"," Little Lamb."); if (strcmp(cres,"Mary Had A Little Lamb.")) { - kwsys_ios::cerr + std::cerr << "Problem with AppendStrings " - << "\"Mary Had A\" \" Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A\" \" Little Lamb.\"" << std::endl; res = false; } delete [] cres; @@ -449,18 +448,18 @@ static bool CheckStringOperations() kwsys::SystemTools::AppendStrings("Mary Had"," A ","Little Lamb."); if (strcmp(cres,"Mary Had A Little Lamb.")) { - kwsys_ios::cerr + std::cerr << "Problem with AppendStrings " - << "\"Mary Had\" \" A \" \"Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had\" \" A \" \"Little Lamb.\"" << std::endl; res = false; } delete [] cres; if (kwsys::SystemTools::CountChar("Mary Had A Little Lamb.",'a') != 3) { - kwsys_ios::cerr + std::cerr << "Problem with CountChar " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } @@ -468,9 +467,9 @@ static bool CheckStringOperations() kwsys::SystemTools::RemoveChars("Mary Had A Little Lamb.","aeiou"); if (strcmp(cres,"Mry Hd A Lttl Lmb.")) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveChars " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } delete [] cres; @@ -479,9 +478,9 @@ static bool CheckStringOperations() kwsys::SystemTools::RemoveCharsButUpperHex("Mary Had A Little Lamb."); if (strcmp(cres,"A")) { - kwsys_ios::cerr + std::cerr << "Problem with RemoveCharsButUpperHex " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } delete [] cres; @@ -491,9 +490,9 @@ static bool CheckStringOperations() kwsys::SystemTools::ReplaceChars(cres2,"aeiou",'X'); if (strcmp(cres2,"MXry HXd A LXttlX LXmb.")) { - kwsys_ios::cerr + std::cerr << "Problem with ReplaceChars " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } delete [] cres2; @@ -501,27 +500,27 @@ static bool CheckStringOperations() if (!kwsys::SystemTools::StringStartsWith("Mary Had A Little Lamb.", "Mary ")) { - kwsys_ios::cerr + std::cerr << "Problem with StringStartsWith " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } if (!kwsys::SystemTools::StringEndsWith("Mary Had A Little Lamb.", " Lamb.")) { - kwsys_ios::cerr + std::cerr << "Problem with StringEndsWith " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } cres = kwsys::SystemTools::DuplicateString("Mary Had A Little Lamb."); if (strcmp(cres,"Mary Had A Little Lamb.")) { - kwsys_ios::cerr + std::cerr << "Problem with DuplicateString " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } delete [] cres; @@ -530,9 +529,9 @@ static bool CheckStringOperations() if (kwsys::SystemTools::CropString(test,13) != "Mary ...Lamb.") { - kwsys_ios::cerr + std::cerr << "Problem with CropString " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } @@ -541,9 +540,9 @@ static bool CheckStringOperations() if (lines[0] != "Mary" || lines[1] != "Had" || lines[2] != "A" || lines[3] != "Little" || lines[4] != "Lamb.") { - kwsys_ios::cerr + std::cerr << "Problem with Split " - << "\"Mary Had A Little Lamb.\"" << kwsys_ios::endl; + << "\"Mary Had A Little Lamb.\"" << std::endl; res = false; } @@ -552,10 +551,10 @@ static bool CheckStringOperations() ("L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -563,10 +562,10 @@ static bool CheckStringOperations() ("L:/Local Mojo/Hex Power Pack/Iffy Voodoo") != L"\\\\?\\L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"L:/Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -574,10 +573,10 @@ static bool CheckStringOperations() ("\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") != L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"\\\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -585,70 +584,70 @@ static bool CheckStringOperations() ("//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo") != L"\\\\?\\UNC\\Foo\\Local Mojo\\Hex Power Pack\\Iffy Voodoo") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"//Foo/Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("//") != L"//") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"//\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\") != L"\\\\.\\") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"\\\\.\\\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X") != L"\\\\.\\X") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"\\\\.\\X\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:") != L"\\\\?\\X:") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"\\\\.\\X:\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("\\\\.\\X:\\") != L"\\\\?\\X:\\") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"\\\\.\\X:\\\"" - << kwsys_ios::endl; + << std::endl; res = false; } if (kwsys::SystemTools::ConvertToWindowsExtendedPath("NUL") != L"\\\\.\\NUL") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsExtendedPath " << "\"NUL\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -658,10 +657,10 @@ static bool CheckStringOperations() ("L://Local Mojo/Hex Power Pack/Iffy Voodoo") != "\"L:\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsOutputPath " << "\"L://Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -669,10 +668,10 @@ static bool CheckStringOperations() ("//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo") != "\"\\\\grayson\\Local Mojo\\Hex Power Pack\\Iffy Voodoo\"") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToWindowsOutputPath " << "\"//grayson/Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -680,10 +679,10 @@ static bool CheckStringOperations() ("//Local Mojo/Hex Power Pack/Iffy Voodoo") != "//Local\\ Mojo/Hex\\ Power\\ Pack/Iffy\\ Voodoo") { - kwsys_ios::cerr + std::cerr << "Problem with ConvertToUnixOutputPath " << "\"//Local Mojo/Hex Power Pack/Iffy Voodoo\"" - << kwsys_ios::endl; + << std::endl; res = false; } @@ -696,16 +695,16 @@ static bool CheckPutEnv(const kwsys_stl::string& env, const char* name, const ch { if(!kwsys::SystemTools::PutEnv(env)) { - kwsys_ios::cerr << "PutEnv(\"" << env - << "\") failed!" << kwsys_ios::endl; + std::cerr << "PutEnv(\"" << env + << "\") failed!" << std::endl; return false; } const char* v = kwsys::SystemTools::GetEnv(name); v = v? v : "(null)"; if(strcmp(v, value) != 0) { - kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \"" - << v << "\", not \"" << value << "\"!" << kwsys_ios::endl; + std::cerr << "GetEnv(\"" << name << "\") returned \"" + << v << "\", not \"" << value << "\"!" << std::endl; return false; } return true; @@ -715,14 +714,14 @@ static bool CheckUnPutEnv(const char* env, const char* name) { if(!kwsys::SystemTools::UnPutEnv(env)) { - kwsys_ios::cerr << "UnPutEnv(\"" << env << "\") failed!" - << kwsys_ios::endl; + std::cerr << "UnPutEnv(\"" << env << "\") failed!" + << std::endl; return false; } if(const char* v = kwsys::SystemTools::GetEnv(name)) { - kwsys_ios::cerr << "GetEnv(\"" << name << "\") returned \"" - << v << "\", not (null)!" << kwsys_ios::endl; + std::cerr << "GetEnv(\"" << name << "\") returned \"" + << v << "\", not (null)!" << std::endl; return false; } return true; @@ -751,8 +750,8 @@ static bool CheckRelativePath( kwsys_stl::string result = kwsys::SystemTools::RelativePath(local, remote); if(expected != result) { - kwsys_ios::cerr << "RelativePath(" << local << ", " << remote - << ") yielded " << result << " instead of " << expected << kwsys_ios::endl; + std::cerr << "RelativePath(" << local << ", " << remote + << ") yielded " << result << " instead of " << expected << std::endl; return false; } return true; @@ -776,8 +775,8 @@ static bool CheckCollapsePath( kwsys_stl::string result = kwsys::SystemTools::CollapseFullPath(path); if(expected != result) { - kwsys_ios::cerr << "CollapseFullPath(" << path - << ") yielded " << result << " instead of " << expected << kwsys_ios::endl; + std::cerr << "CollapseFullPath(" << path + << ") yielded " << result << " instead of " << expected << std::endl; return false; } return true;