Commit 1b79433a authored by Kitware Robot's avatar Kitware Robot Committed by Brad King
Browse files

KWSys 2015-08-28 (dc3fdd7f)

Extract upstream KWSys using the following shell commands.

$ git archive --prefix=upstream-kwsys/ dc3fdd7f | tar x
$ git shortlog --no-merges --abbrev=8 --format='%h %s' cdaf522c..dc3fdd7f
Brad King (9):
      15a16826 Remove include <kwsys/ios/*> and kwsys_ios:: compatibility layer
      a5799c17 Remove unused KWSYS_IOS_USE_{SSTREAM,STRSTREAM_H,STRSTREA_H} checks
      198957cf Remove unused KWSYS_IOS_USE_SSTREAM check
      24d2b60e Remove support for pre-C++98 streams
      2a581c30 Remove support for pre-C++98 std::string missing operators
      5f3fd465 Remove support for pre-C++98 STL
      cded1574 Remove support for pre-C++98 STL from hash_map and hash_set
      f130a3ab Remove kwsys/cstddef compatibility header
      dc3fdd7f Remove support for pre-C++98 template capabilities
parent ca96be22
......@@ -35,15 +35,6 @@
# SET(KWSYS_HEADER_ROOT ${PROJECT_BINARY_DIR})
# INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
#
# KWSYS_IOS_FORCE_OLD = Force use of old non-ANSI C++ streams even if
# new streams are available. This may be used
# by projects that cannot configure their
# streams library.
# Example:
#
# SET(KWSYS_IOS_FORCE_OLD 1)
#
#
# Optional settings to setup install rules are as follows:
#
# KWSYS_INSTALL_BIN_DIR = The installation target directories into
......@@ -351,105 +342,6 @@ ENDIF()
# capabilities and parent project's request. Enforce 0/1 as only
# possible values for configuration into Configure.hxx.
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAVE_STD
"Checking whether STL classes are in std namespace" DIRECT)
IF(KWSYS_IOS_FORCE_OLD)
SET(KWSYS_IOS_USE_ANSI 0)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_ANSI
"Checking whether ANSI stream headers are available" DIRECT)
ENDIF()
IF(KWSYS_IOS_USE_ANSI)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAVE_STD
"Checking whether ANSI streams are in std namespace" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_SSTREAM
"Checking whether ANSI string stream is available" DIRECT)
ELSE()
SET(KWSYS_IOS_HAVE_STD 0)
SET(KWSYS_IOS_USE_SSTREAM 0)
ENDIF()
IF(KWSYS_IOS_USE_SSTREAM)
SET(KWSYS_IOS_USE_STRSTREAM_H 0)
SET(KWSYS_IOS_USE_STRSTREA_H 0)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_STRSTREAM_H
"Checking whether strstream.h is available" DIRECT)
IF(KWSYS_IOS_USE_STRSTREAM_H)
SET(KWSYS_IOS_USE_STRSTREA_H 0)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_USE_STRSTREA_H
"Checking whether strstrea.h is available" DIRECT)
ENDIF()
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_CSTDDEF
"Checking whether header cstddef is available" DIRECT)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_STL_HAVE_STD=${KWSYS_STL_HAVE_STD})
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_NEQ_CHAR
"Checking whether stl string has operator!= for char*" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ITERATOR_TRAITS
"Checking whether stl has iterator_traits" DIRECT)
IF(KWSYS_STL_HAS_ITERATOR_TRAITS)
SET(KWSYS_STL_HAS_ITERATOR_CATEGORY 0)
SET(KWSYS_STL_HAS___ITERATOR_CATEGORY 0)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ITERATOR_CATEGORY
"Checking whether stl has old iterator_category" DIRECT)
IF(KWSYS_STL_HAS_ITERATOR_CATEGORY)
SET(KWSYS_STL_HAS___ITERATOR_CATEGORY 0)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS___ITERATOR_CATEGORY
"Checking whether stl has internal __iterator_category" DIRECT)
ENDIF()
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_TEMPLATE
"Checking whether stl has standard template allocator" DIRECT)
IF(KWSYS_STL_HAS_ALLOCATOR_TEMPLATE)
SET(KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE 0)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_REBIND
"Checking for rebind member of stl allocator" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
"Checking for non-standard argument to stl allocator<>::max_size" DIRECT)
ELSE()
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE
"Checking whether stl has old non-template allocator" DIRECT)
SET(KWSYS_STL_HAS_ALLOCATOR_REBIND 0)
SET(KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT 0)
ENDIF()
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_HAS_ALLOCATOR_OBJECTS
"Checking whether stl containers support allocator objects." DIRECT)
IF(KWSYS_IOS_USE_ANSI AND NOT WATCOM)
# ANSI streams always have string operators.
SET(KWSYS_STL_STRING_HAVE_OSTREAM 1)
SET(KWSYS_STL_STRING_HAVE_ISTREAM 1)
ELSE()
# There may not be string operators for old streams.
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_OSTREAM
"Checking whether stl string has ostream operator<<" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STL_STRING_HAVE_ISTREAM
"Checking whether stl string has istream operator>>" DIRECT)
ENDIF()
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
-DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD})
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAVE_BINARY
"Checking whether ios has binary openmode" DIRECT)
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS
"Checking whether \"<>\" is needed for template friends" INVERT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_MEMBER_TEMPLATES
"Checking for member template support" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_FULL_SPECIALIZATION
"Checking for standard template specialization syntax" DIRECT)
KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
"Checking whether argument dependent lookup is supported" DIRECT)
IF(UNIX)
KWSYS_PLATFORM_CXX_TEST(KWSYS_STAT_HAS_ST_MTIM
"Checking whether struct stat has st_mtim member" DIRECT)
......@@ -558,9 +450,6 @@ ENDIF()
IF(KWSYS_USE_IOStream)
# Determine whether iostreams support long long.
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES
-DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI}
-DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD})
IF(KWSYS_CXX_HAS_LONG_LONG)
KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_ISTREAM_LONG_LONG
"Checking if istream supports long long" DIRECT)
......@@ -579,7 +468,6 @@ IF(KWSYS_USE_IOStream)
SET(KWSYS_IOS_HAS_ISTREAM___INT64 0)
SET(KWSYS_IOS_HAS_OSTREAM___INT64 0)
ENDIF()
SET(KWSYS_PLATFORM_CXX_TEST_DEFINES)
ENDIF()
IF(KWSYS_NAMESPACE MATCHES "^kwsys$")
......@@ -831,84 +719,6 @@ IF(KWSYS_INSTALL_DOC_DIR)
${KWSYS_INSTALL_LICENSE_OPTIONS})
ENDIF()
#-----------------------------------------------------------------------------
# Create STL header wrappers to block warnings in the STL headers and
# give standard names by which they may be included.
SET(KWSYS_STL_HEADER_EXTRA_string 1)
FOREACH(header
algorithm
deque
exception
functional
iterator
list
map
memory
new
numeric
queue
set
stack
stdexcept
string
utility
vector
)
# Configure the header wrapper.
SET(KWSYS_STL_HEADER "${header}")
IF(KWSYS_STL_HEADER_EXTRA_${header})
SET(KWSYS_STL_HEADER_EXTRA
"#define ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n# include <${KWSYS_NAMESPACE}/stl/${header}.hxx>\n#undef ${KWSYS_NAMESPACE}_stl_${header}_including_hxx\n")
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl_${header}.hxx.in
${KWSYS_HEADER_DIR}/stl/${header}.hxx
@ONLY IMMEDIATE)
IF(KWSYS_INSTALL_INCLUDE_DIR)
INSTALL(FILES ${KWSYS_HEADER_DIR}/stl/${header}.hxx
DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl
${KWSYS_INSTALL_INCLUDE_OPTIONS})
ENDIF()
ELSE()
SET(KWSYS_STL_HEADER_EXTRA "")
ENDIF()
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_stl.hxx.in
${KWSYS_HEADER_DIR}/stl/${header}
@ONLY IMMEDIATE)
# Create an install target for the header wrapper.
IF(KWSYS_INSTALL_INCLUDE_DIR)
INSTALL(FILES ${KWSYS_HEADER_DIR}/stl/${header}
DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}/stl
${KWSYS_INSTALL_INCLUDE_OPTIONS})
ENDIF()
ENDFOREACH()
# Provide cstddef header.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/kwsys_cstddef.hxx.in
${KWSYS_HEADER_DIR}/cstddef
@ONLY IMMEDIATE)
IF(KWSYS_INSTALL_INCLUDE_DIR)
INSTALL(FILES ${KWSYS_HEADER_DIR}/cstddef
DESTINATION ${KWSYS_INSTALL_INCLUDE_DIR}/${KWSYS_NAMESPACE}
${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.
......
......@@ -15,22 +15,19 @@
#include KWSYS_HEADER(Configure.hxx)
#include KWSYS_HEADER(String.hxx)
#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.
#if 0
# 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 <vector>
#include <map>
#include <set>
#include <sstream>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
......@@ -45,7 +42,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
......@@ -67,11 +64,11 @@ struct CommandLineArgumentsCallbackStructure
};
class CommandLineArgumentsVectorOfStrings :
public kwsys_stl::vector<kwsys::String> {};
public std::vector<kwsys::String> {};
class CommandLineArgumentsSetOfStrings :
public kwsys_stl::set<kwsys::String> {};
public std::set<kwsys::String> {};
class CommandLineArgumentsMapOfStrucs :
public kwsys_stl::map<kwsys::String,
public std::map<kwsys::String,
CommandLineArgumentsCallbackStructure> {};
class CommandLineArgumentsInternal
......@@ -152,8 +149,8 @@ void CommandLineArguments::ProcessArgument(const char* arg)
//----------------------------------------------------------------------------
bool CommandLineArguments::GetMatchedArguments(
kwsys_stl::vector<kwsys_stl::string>* matches,
const kwsys_stl::string& arg)
std::vector<std::string>* matches,
const std::string& arg)
{
matches->clear();
CommandLineArguments::Internal::CallbacksMap::iterator it;
......@@ -184,15 +181,15 @@ bool CommandLineArguments::GetMatchedArguments(
//----------------------------------------------------------------------------
int CommandLineArguments::Parse()
{
kwsys_stl::vector<kwsys_stl::string>::size_type cc;
kwsys_stl::vector<kwsys_stl::string> matches;
std::vector<std::string>::size_type cc;
std::vector<std::string> matches;
if ( this->StoreUnusedArgumentsFlag )
{
this->Internals->UnusedArguments.clear();
}
for ( cc = 0; cc < this->Internals->Argv.size(); cc ++ )
{
const kwsys_stl::string& arg = this->Internals->Argv[cc];
const std::string& arg = this->Internals->Argv[cc];
CommandLineArguments_DEBUG("Process argument: " << arg);
this->Internals->LastArgument = cc;
if ( this->GetMatchedArguments(&matches, arg) )
......@@ -214,7 +211,7 @@ int CommandLineArguments::Parse()
// additional value
CommandLineArgumentsCallbackStructure *cs
= &this->Internals->Callbacks[matches[maxidx]];
const kwsys_stl::string& sarg = matches[maxidx];
const std::string& sarg = matches[maxidx];
if ( cs->Argument != sarg )
{
abort();
......@@ -267,7 +264,7 @@ int CommandLineArguments::Parse()
CommandLineArguments_DEBUG("This is a multi argument: " << arg);
for (cc++; cc < this->Internals->Argv.size(); ++ cc )
{
const kwsys_stl::string& marg = this->Internals->Argv[cc];
const std::string& marg = this->Internals->Argv[cc];
CommandLineArguments_DEBUG(" check multi argument value: " << marg);
if ( this->GetMatchedArguments(&matches, marg) )
{
......@@ -288,7 +285,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 +310,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;
}
......@@ -430,13 +427,13 @@ CommandLineArgumentsAddArgumentMacro(BOOL, bool)
CommandLineArgumentsAddArgumentMacro(INT, int)
CommandLineArgumentsAddArgumentMacro(DOUBLE, double)
CommandLineArgumentsAddArgumentMacro(STRING, char*)
CommandLineArgumentsAddArgumentMacro(STL_STRING, kwsys_stl::string)
CommandLineArgumentsAddArgumentMacro(STL_STRING, std::string)
CommandLineArgumentsAddArgumentMacro(VECTOR_BOOL, kwsys_stl::vector<bool>)
CommandLineArgumentsAddArgumentMacro(VECTOR_INT, kwsys_stl::vector<int>)
CommandLineArgumentsAddArgumentMacro(VECTOR_DOUBLE, kwsys_stl::vector<double>)
CommandLineArgumentsAddArgumentMacro(VECTOR_STRING, kwsys_stl::vector<char*>)
CommandLineArgumentsAddArgumentMacro(VECTOR_STL_STRING, kwsys_stl::vector<kwsys_stl::string>)
CommandLineArgumentsAddArgumentMacro(VECTOR_BOOL, std::vector<bool>)
CommandLineArgumentsAddArgumentMacro(VECTOR_INT, std::vector<int>)
CommandLineArgumentsAddArgumentMacro(VECTOR_DOUBLE, std::vector<double>)
CommandLineArgumentsAddArgumentMacro(VECTOR_STRING, std::vector<char*>)
CommandLineArgumentsAddArgumentMacro(VECTOR_STL_STRING, std::vector<std::string>)
//----------------------------------------------------------------------------
#define CommandLineArgumentsAddBooleanArgumentMacro(type, ctype) \
......@@ -451,7 +448,7 @@ CommandLineArgumentsAddBooleanArgumentMacro(BOOL, bool)
CommandLineArgumentsAddBooleanArgumentMacro(INT, int)
CommandLineArgumentsAddBooleanArgumentMacro(DOUBLE, double)
CommandLineArgumentsAddBooleanArgumentMacro(STRING, char*)
CommandLineArgumentsAddBooleanArgumentMacro(STL_STRING, kwsys_stl::string)
CommandLineArgumentsAddBooleanArgumentMacro(STL_STRING, std::string)
//----------------------------------------------------------------------------
void CommandLineArguments::SetClientData(void* client_data)
......@@ -518,12 +515,12 @@ 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.
CommandLineArguments::Internal::CallbacksMap::iterator it;
typedef kwsys_stl::map<CommandLineArguments::Internal::String,
typedef std::map<CommandLineArguments::Internal::String,
CommandLineArguments::Internal::SetOfStrings > MapArgs;
MapArgs mp;
MapArgs::iterator mpit, smpit;
......@@ -604,7 +601,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 +655,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 ++;
......@@ -680,7 +677,7 @@ void CommandLineArguments::GenerateHelp()
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
bool* variable, const kwsys_stl::string& value)
bool* variable, const std::string& value)
{
if ( value == "1" || value == "ON" || value == "on" || value == "On" ||
value == "TRUE" || value == "true" || value == "True" ||
......@@ -696,7 +693,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
int* variable, const kwsys_stl::string& value)
int* variable, const std::string& value)
{
char* res = 0;
*variable = static_cast<int>(strtol(value.c_str(), &res, 10));
......@@ -708,7 +705,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
double* variable, const kwsys_stl::string& value)
double* variable, const std::string& value)
{
char* res = 0;
*variable = strtod(value.c_str(), &res);
......@@ -720,7 +717,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
char** variable, const kwsys_stl::string& value)
char** variable, const std::string& value)
{
if ( *variable )
{
......@@ -733,14 +730,14 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::string* variable, const kwsys_stl::string& value)
std::string* variable, const std::string& value)
{
*variable = value;
}
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::vector<bool>* variable, const kwsys_stl::string& value)
std::vector<bool>* variable, const std::string& value)
{
bool val = false;
if ( value == "1" || value == "ON" || value == "on" || value == "On" ||
......@@ -754,7 +751,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::vector<int>* variable, const kwsys_stl::string& value)
std::vector<int>* variable, const std::string& value)
{
char* res = 0;
variable->push_back(static_cast<int>(strtol(value.c_str(), &res, 10)));
......@@ -766,7 +763,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::vector<double>* variable, const kwsys_stl::string& value)
std::vector<double>* variable, const std::string& value)
{
char* res = 0;
variable->push_back(strtod(value.c_str(), &res));
......@@ -778,7 +775,7 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::vector<char*>* variable, const kwsys_stl::string& value)
std::vector<char*>* variable, const std::string& value)
{
char* var = new char[ value.size() + 1 ];
strcpy(var, value.c_str());
......@@ -787,8 +784,8 @@ void CommandLineArguments::PopulateVariable(
//----------------------------------------------------------------------------
void CommandLineArguments::PopulateVariable(
kwsys_stl::vector<kwsys_stl::string>* variable,
const kwsys_stl::string& value)
std::vector<std::string>* variable,
const std::string& value)
{
variable->push_back(value);
}
......@@ -809,7 +806,7 @@ bool CommandLineArguments::PopulateVariable(CommandLineArgumentsCallbackStructur
CommandLineArguments_DEBUG("Set argument: " << cs->Argument << " to " << value);
if ( cs->Variable )
{
kwsys_stl::string var = "1";
std::string var = "1";
if ( value )
{
var = value;
......@@ -826,28 +823,28 @@ bool CommandLineArguments::PopulateVariable(CommandLineArgumentsCallbackStructur
this->PopulateVariable(static_cast<char**>(cs->Variable), var);
break;
case CommandLineArguments::STL_STRING_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::string*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::string*>(cs->Variable), var);
break;
case CommandLineArguments::BOOL_TYPE:
this->PopulateVariable(static_cast<bool*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_BOOL_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::vector<bool>*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::vector<bool>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_INT_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::vector<int>*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::vector<int>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_DOUBLE_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::vector<double>*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::vector<double>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_STRING_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::vector<char*>*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::vector<char*>*>(cs->Variable), var);
break;
case CommandLineArguments::VECTOR_STL_STRING_TYPE:
this->PopulateVariable(static_cast<kwsys_stl::vector<kwsys_stl::string>*>(cs->Variable), var);
this->PopulateVariable(static_cast<std::vector<std::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;
}
......
......@@ -15,13 +15,8 @@
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/stl/string>
#include <@KWSYS_NAMESPACE@/stl/vector>
/* 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
#include <string>
#include <vector>
namespace @KWSYS_NAMESPACE@
{
......@@ -64,7 +59,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;
* }
*
......@@ -155,7 +150,7 @@ public:
void AddArgument(const char* argument, ArgumentTypeEnum type,
char** variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::string* variable, const char* help);
std::string* variable, const char* help);
/**
* Add handler for argument which is going to set the variable to the
......@@ -163,15 +158,15 @@ public:
* appropriate type. This will handle the multi argument values.
*/
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<bool>* variable, const char* help);
std::vector<bool>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<int>* variable, const char* help);
std::vector<int>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<double>* variable, const char* help);
std::vector<double>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<char*>* variable, const char* help);
std::vector<char*>* variable, const char* help);
void AddArgument(const char* argument, ArgumentTypeEnum type,
kwsys_stl::vector<kwsys_stl::string>* variable, const char* help);
std::vector<std::string>* variable, const char* help);
/**
* Add handler for boolean argument. The argument does not take any option
......@@ -187,7 +182,7 @@ public:
void AddBooleanArgument(const char* argument,
char** variable, const char* help);
void AddBooleanArgument(const char* argument,
kwsys_stl::string* variable, const char* help);
std::string* variable, const char* help);
/**
* Set the callbacks for error handling.
......@@ -243,28 +238,28 @@ protected:
void AddArgument(const char* argument, ArgumentTypeEnum type,
VariableTypeEnum vtype, void* variable, const char* help);
bool GetMatchedArguments(kwsys_stl::vector<kwsys_stl::string>* matches,
const kwsys_stl::string& arg);
bool GetMatchedArguments(std::vector<std::string>* matches,
const std::string& arg);
//! Populate individual variables
bool PopulateVariable(CommandLineArgumentsCallbackStructure* cs,
const char* value);
//! Populate individual variables of type ...
void PopulateVariable(bool* variable, const kwsys_stl::string& value);
void PopulateVariable(int* variable, const kwsys_stl::string& value);
void PopulateVariable(double* variable, const kwsys_stl::string& value);
void PopulateVariable(char** variable, const kwsys_stl::string& value);