Commit 15a16826 authored by Brad King's avatar Brad King

Remove include <kwsys/ios/*> and kwsys_ios:: compatibility layer

Use the standard headers and namespace instead.  We no longer support
compilers without them.

Change-Id: Iafb19d28462e9302df06eecc8ae42b48a9577a21
parent cdaf522c
......@@ -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.
......
......@@ -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;
}
......
......@@ -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;
* }
*
......
......@@ -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
......
......@@ -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
......
......@@ -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 )
......
......@@ -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');
}
......
......@@ -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
......
......@@ -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;
}
......
......@@ -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