Commit 5f3fd465 authored by Brad King's avatar Brad King

Remove support for pre-C++98 STL

Drop "kwsys/stl/*" and "kwsys_stl::" and use the standard headers and
namespace instead.  Drop the now-unused KWSYS_STL_HAVE_STD check.

Change-Id: I6105fd32cd8f0e487e03f58927976e824a53f0d8
parent 2a581c30
......@@ -342,14 +342,9 @@ 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)
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_HAS_ITERATOR_TRAITS
"Checking whether stl has iterator_traits" DIRECT)
IF(KWSYS_STL_HAS_ITERATOR_TRAITS)
......@@ -769,41 +764,6 @@ IF(KWSYS_INSTALL_DOC_DIR)
ENDIF()
#-----------------------------------------------------------------------------
# Create STL header wrappers to block warnings in the STL headers and
# give standard names by which they may be included.
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}")
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
......
This diff is collapsed.
......@@ -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@
{
......@@ -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);
void PopulateVariable(kwsys_stl::string* variable, const kwsys_stl::string& value);
void PopulateVariable(kwsys_stl::vector<bool>* variable, const kwsys_stl::string& value);
void PopulateVariable(kwsys_stl::vector<int>* variable, const kwsys_stl::string& value);
void PopulateVariable(kwsys_stl::vector<double>* variable, const kwsys_stl::string& value);
void PopulateVariable(kwsys_stl::vector<char*>* variable, const kwsys_stl::string& value);
void PopulateVariable(kwsys_stl::vector<kwsys_stl::string>* variable, const kwsys_stl::string& value);
void PopulateVariable(bool* variable, const std::string& value);
void PopulateVariable(int* variable, const std::string& value);
void PopulateVariable(double* variable, const std::string& value);
void PopulateVariable(char** variable, const std::string& value);
void PopulateVariable(std::string* variable, const std::string& value);
void PopulateVariable(std::vector<bool>* variable, const std::string& value);
void PopulateVariable(std::vector<int>* variable, const std::string& value);
void PopulateVariable(std::vector<double>* variable, const std::string& value);
void PopulateVariable(std::vector<char*>* variable, const std::string& value);
void PopulateVariable(std::vector<std::string>* variable, const std::string& value);
typedef CommandLineArgumentsInternal Internal;
Internal* Internals;
kwsys_stl::string Help;
std::string Help;
unsigned int LineLength;
......@@ -273,11 +268,6 @@ protected:
} // namespace @KWSYS_NAMESPACE@
/* Undefine temporary macro. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsys_stl
#endif
#endif
......
......@@ -15,19 +15,9 @@
/* Include C configuration. */
#include <@KWSYS_NAMESPACE@/Configure.h>
/* Whether STL is in std namespace. */
#define @KWSYS_NAMESPACE@_STL_HAVE_STD @KWSYS_STL_HAVE_STD@
/* Whether wstring is available. */
#define @KWSYS_NAMESPACE@_STL_HAS_WSTRING @KWSYS_STL_HAS_WSTRING@
/* Define the stl namespace macro. */
#if @KWSYS_NAMESPACE@_STL_HAVE_STD
# define @KWSYS_NAMESPACE@_stl std
#else
# define @KWSYS_NAMESPACE@_stl
#endif
/* Whether the cstddef header is available. */
#define @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF @KWSYS_CXX_HAS_CSTDDEF@
......@@ -95,11 +85,9 @@
access to the macros without a configured namespace. */
#if defined(KWSYS_NAMESPACE)
# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsys_stl @KWSYS_NAMESPACE@_stl
# define kwsys @KWSYS_NAMESPACE@
# endif
# define KWSYS_NAME_IS_KWSYS @KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define KWSYS_STL_HAVE_STD @KWSYS_NAMESPACE@_STL_HAVE_STD
# define KWSYS_STAT_HAS_ST_MTIM @KWSYS_NAMESPACE@_STAT_HAS_ST_MTIM
# define KWSYS_CXX_HAS_CSTDDEF @KWSYS_NAMESPACE@_CXX_HAS_CSTDDEF
# define KWSYS_CXX_NULL_TEMPLATE_ARGS @KWSYS_NAMESPACE@_CXX_NULL_TEMPLATE_ARGS
......
......@@ -16,19 +16,17 @@
#include KWSYS_HEADER(Encoding.hxx)
#include KWSYS_HEADER(stl/string)
#include KWSYS_HEADER(stl/vector)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
#if 0
# include "Directory.hxx.in"
# include "Configure.hxx.in"
# include "Encoding.hxx.in"
# include "kwsys_stl.hxx.in"
# include "kwsys_stl_vector.hxx.in"
#endif
#include <string>
#include <vector>
namespace KWSYS_NAMESPACE
{
......@@ -37,10 +35,10 @@ class DirectoryInternals
{
public:
// Array of Files
kwsys_stl::vector<kwsys_stl::string> Files;
std::vector<std::string> Files;
// Path to Open'ed directory
kwsys_stl::string Path;
std::string Path;
};
//----------------------------------------------------------------------------
......@@ -102,7 +100,7 @@ void Directory::Clear()
namespace KWSYS_NAMESPACE
{
bool Directory::Load(const kwsys_stl::string& name)
bool Directory::Load(const std::string& name)
{
this->Clear();
#if _MSC_VER < 1300
......@@ -152,7 +150,7 @@ bool Directory::Load(const kwsys_stl::string& name)
return _findclose(srchHandle) != -1;
}
unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& name)
unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
{
#if _MSC_VER < 1300
long srchHandle;
......@@ -219,7 +217,7 @@ unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& na
namespace KWSYS_NAMESPACE
{
bool Directory::Load(const kwsys_stl::string& name)
bool Directory::Load(const std::string& name)
{
this->Clear();
......@@ -239,7 +237,7 @@ bool Directory::Load(const kwsys_stl::string& name)
return 1;
}
unsigned long Directory::GetNumberOfFilesInDirectory(const kwsys_stl::string& name)
unsigned long Directory::GetNumberOfFilesInDirectory(const std::string& name)
{
DIR* dir = opendir(name.c_str());
......
......@@ -13,12 +13,7 @@
#define @KWSYS_NAMESPACE@_Directory_hxx
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/stl/string>
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsys_stl @KWSYS_NAMESPACE@_stl
#endif
#include <string>
namespace @KWSYS_NAMESPACE@
{
......@@ -44,7 +39,7 @@ public:
* in that directory. 0 is returned if the directory can not be
* opened, 1 if it is opened.
*/
bool Load(const kwsys_stl::string&);
bool Load(const std::string&);
/**
* Return the number of files in the current directory.
......@@ -55,7 +50,7 @@ public:
* Return the number of files in the specified directory.
* A higher performance static method.
*/
static unsigned long GetNumberOfFilesInDirectory(const kwsys_stl::string&);
static unsigned long GetNumberOfFilesInDirectory(const std::string&);
/**
* Return the file at the given index, the indexing is 0 based
......@@ -83,9 +78,4 @@ private:
} // namespace @KWSYS_NAMESPACE@
/* Undefine temporary macros. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsys_stl
#endif
#endif
......@@ -40,7 +40,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return shl_load(libname.c_str(), BIND_DEFERRED | DYNAMIC_PATH, 0L);
}
......@@ -57,7 +57,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer
DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::GetSymbolAddress(DynamicLoader::LibraryHandle lib, const std::string& sym)
{
void* addr;
int status;
......@@ -115,7 +115,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
NSObjectFileImageReturnCode rc;
NSObjectFileImage image = 0;
......@@ -146,7 +146,7 @@ int DynamicLoader::CloseLibrary( DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
void *result=0;
// Need to prepend symbols with '_' on Apple-gcc compilers
......@@ -187,7 +187,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname)
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname)
{
DynamicLoader::LibraryHandle lh;
int length = MultiByteToWideChar(CP_UTF8, 0, libname.c_str(), -1, NULL, 0);
......@@ -207,7 +207,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// TODO: The calling convention affects the name of the symbol. We
// should have a tool to help get the symbol with the desired
......@@ -302,7 +302,7 @@ namespace KWSYS_NAMESPACE
static image_id last_dynamic_err = B_OK;
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
// image_id's are integers, errors are negative. Add one just in case we
// get a valid image_id of zero (is that even possible?).
......@@ -340,7 +340,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
......@@ -393,7 +393,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return 0;
}
......@@ -411,7 +411,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
return 0;
}
......@@ -437,7 +437,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
char *name = (char *)calloc(1, libname.size() + 1);
dld_init(program_invocation_name);
......@@ -456,7 +456,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
......@@ -489,7 +489,7 @@ namespace KWSYS_NAMESPACE
{
//----------------------------------------------------------------------------
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const kwsys_stl::string& libname )
DynamicLoader::LibraryHandle DynamicLoader::OpenLibrary(const std::string& libname )
{
return dlopen(libname.c_str(), RTLD_LAZY);
}
......@@ -508,7 +508,7 @@ int DynamicLoader::CloseLibrary(DynamicLoader::LibraryHandle lib)
//----------------------------------------------------------------------------
DynamicLoader::SymbolPointer DynamicLoader::GetSymbolAddress(
DynamicLoader::LibraryHandle lib, const kwsys_stl::string& sym)
DynamicLoader::LibraryHandle lib, const std::string& sym)
{
// Hack to cast pointer-to-data to pointer-to-function.
union
......
......@@ -12,8 +12,8 @@
#ifndef @KWSYS_NAMESPACE@_DynamicLoader_hxx
#define @KWSYS_NAMESPACE@_DynamicLoader_hxx
#include <@KWSYS_NAMESPACE@/Configure.h>
#include <@KWSYS_NAMESPACE@/stl/string>
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <string>
#if defined(__hpux)
#include <dl.h>
......@@ -28,11 +28,6 @@
#include <be/kernel/image.h>
#endif
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# define kwsys_stl @KWSYS_NAMESPACE@_stl
#endif
namespace @KWSYS_NAMESPACE@
{
/** \class DynamicLoader
......@@ -83,14 +78,14 @@ public:
/** Load a dynamic library into the current process.
* The returned LibraryHandle can be used to access the symbols in the
* library. */
static LibraryHandle OpenLibrary(const kwsys_stl::string&);
static LibraryHandle OpenLibrary(const std::string&);
/** Attempt to detach a dynamic library from the
* process. A value of true is returned if it is sucessful. */
static int CloseLibrary(LibraryHandle);
/** Find the address of the symbol in the given library. */
static SymbolPointer GetSymbolAddress(LibraryHandle, const kwsys_stl::string&);
static SymbolPointer GetSymbolAddress(LibraryHandle, const std::string&);
/** Return the default module prefix for the current platform. */
static const char* LibPrefix() { return "@KWSYS_DynamicLoader_PREFIX@"; }
......@@ -104,9 +99,4 @@ public:
} // namespace @KWSYS_NAMESPACE@
/* Undefine temporary macros. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsys_stl
#endif
#endif
......@@ -13,13 +13,8 @@
#define @KWSYS_NAMESPACE@_Encoding_hxx
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/stl/string>
#include <@KWSYS_NAMESPACE@/stl/vector>
/* Define these macros 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@
{
......@@ -65,23 +60,18 @@ public:
// Convert a narrow string to a wide string.
// On Windows, UTF-8 is assumed, and on other platforms,
// the current locale is assumed.
static kwsys_stl::wstring ToWide(const kwsys_stl::string& str);
static kwsys_stl::wstring ToWide(const char* str);
static std::wstring ToWide(const std::string& str);
static std::wstring ToWide(const char* str);
// Convert a wide string to a narrow string.
// On Windows, UTF-8 is assumed, and on other platforms,
// the current locale is assumed.
static kwsys_stl::string ToNarrow(const kwsys_stl::wstring& str);
static kwsys_stl::string ToNarrow(const wchar_t* str);
static std::string ToNarrow(const std::wstring& str);
static std::string ToNarrow(const wchar_t* str);
#endif // @KWSYS_NAMESPACE@_STL_HAS_WSTRING
}; // class Encoding
} // namespace @KWSYS_NAMESPACE@
/* Undefine temporary macros. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
# undef kwsys_stl
#endif
#endif
......@@ -19,7 +19,6 @@
#include "kwsysPrivate.h"
#include KWSYS_HEADER(Encoding.hxx)
#include KWSYS_HEADER(Encoding.h)
#include KWSYS_HEADER(stl/vector)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
......@@ -28,6 +27,7 @@
# include "Encoding.h.in"
#endif
#include <vector>
#include <stdlib.h>
#include <string.h>
......@@ -140,23 +140,23 @@ char const* const* Encoding::CommandLineArguments::argv() const
#if KWSYS_STL_HAS_WSTRING
kwsys_stl::wstring Encoding::ToWide(const kwsys_stl::string& str)
std::wstring Encoding::ToWide(const std::string& str)
{
return ToWide(str.c_str());
}
kwsys_stl::string Encoding::ToNarrow(const kwsys_stl::wstring& str)
std::string Encoding::ToNarrow(const std::wstring& str)
{
return ToNarrow(str.c_str());
}
kwsys_stl::wstring Encoding::ToWide(const char* cstr)
std::wstring Encoding::ToWide(const char* cstr)
{
kwsys_stl::wstring wstr;
std::wstring wstr;
size_t length = kwsysEncoding_mbstowcs(0, cstr, 0) + 1;
if(length > 0)
{
kwsys_stl::vector<wchar_t> wchars(length);
std::vector<wchar_t> wchars(length);
if(kwsysEncoding_mbstowcs(&wchars[0], cstr, length) > 0)
{
wstr = &wchars[0];
......@@ -165,9 +165,9 @@ kwsys_stl::wstring Encoding::ToWide(const char* cstr)
return wstr;
}
kwsys_stl::string Encoding::ToNarrow(const wchar_t* wcstr)
std::string Encoding::ToNarrow(const wchar_t* wcstr)
{
kwsys_stl::string str;
std::string str;
size_t length = kwsysEncoding_wcstombs(0, wcstr, 0) + 1;
if(length > 0)
{
......
......@@ -17,9 +17,6 @@
#include KWSYS_HEADER(RegularExpression.hxx)
#include KWSYS_HEADER(SystemTools.hxx)
#include KWSYS_HEADER(Directory.hxx)
#include KWSYS_HEADER(stl/string)
#include KWSYS_HEADER(stl/vector)
#include KWSYS_HEADER(stl/algorithm)
// Work-around CMake dependency scanning limitation. This must
// duplicate the above list of headers.
......@@ -29,11 +26,12 @@
# include "Configure.hxx.in"
# include "RegularExpression.hxx.in"
# include "SystemTools.hxx.in"
# include "kwsys_stl.hxx.in"
# include "kwsys_stl_vector.hxx.in"
# include "kwsys_stl_algorithm.hxx.in"
#endif
#include <string>
#include <vector>
#include <algorithm>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
......@@ -53,8 +51,8 @@ namespace KWSYS_NAMESPACE
class GlobInternals
{
public:
kwsys_stl::vector<kwsys_stl::string> Files;
kwsys_stl::vector<kwsys::RegularExpression> Expressions;
std::vector<std::string> Files;
std::vector<kwsys::RegularExpression> Expressions;
};
//----------------------------------------------------------------------------
......@@ -81,21 +79,21 @@ Glob::~Glob()
}
//----------------------------------------------------------------------------
kwsys_stl::vector<kwsys_stl::string>& Glob::GetFiles()
std::vector<std::string>& Glob::GetFiles()
{
return this->Internals->Files;
}
//----------------------------------------------------------------------------
kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
std::string Glob::PatternToRegex(const std::string& pattern,
bool require_whole_string,
bool preserve_case)
{
// Incrementally build the regular expression from the pattern.
kwsys_stl::string regex = require_whole_string? "^" : "";
kwsys_stl::string::const_iterator pattern_first = pattern.begin();
kwsys_stl::string::const_iterator pattern_last = pattern.end();
for(kwsys_stl::string::const_iterator i = pattern_first;
std::string regex = require_whole_string? "^" : "";
std::string::const_iterator pattern_first = pattern.begin();
std::string::const_iterator pattern_last = pattern.end();
for(std::string::const_iterator i = pattern_first;
i != pattern_last; ++i)
{
int c = *i;
......@@ -119,8 +117,8 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
{
// Parse out the bracket expression. It begins just after the
// opening character.
kwsys_stl::string::const_iterator bracket_first = i+1;
kwsys_stl::string::const_iterator bracket_last = bracket_first;
std::string::const_iterator bracket_first = i+1;
std::string::const_iterator bracket_last = bracket_first;
// The first character may be complementation '!' or '^'.
if(bracket_last != pattern_last &&
......@@ -152,7 +150,7 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
else
{
// Convert the bracket string to its regex equivalent.
kwsys_stl::string::const_iterator k = bracket_first;
std::string::const_iterator k = bracket_first;
// Open the regex block.
regex += "[";
......@@ -220,8 +218,8 @@ kwsys_stl::string Glob::PatternToRegex(const kwsys_stl::string& pattern,
}
//----------------------------------------------------------------------------
bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
const kwsys_stl::string& dir, GlobMessages* messages)
bool Glob::RecurseDirectory(std::string::size_type start,
const std::string& dir, GlobMessages* messages)
{
kwsys::Directory d;
if ( !d.Load(dir) )
......@@ -229,8 +227,8 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
return true;
}
unsigned long cc;
kwsys_stl::string realname;
kwsys_stl::string fname;
std::string realname;
std::string fname;
for ( cc = 0; cc < d.GetNumberOfFiles(); cc ++ )
{
fname = d.GetFile(cc);
......@@ -261,8 +259,8 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
if (isSymLink)
{
++this->FollowedSymlinkCount;
kwsys_stl::string realPathErrorMessage;
kwsys_stl::string canonicalPath(SystemTools::GetRealPath(dir,
std::string realPathErrorMessage;
std::string canonicalPath(SystemTools::GetRealPath(dir,
&realPathErrorMessage));
if(!realPathErrorMessage.empty())
......@@ -276,7 +274,7 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
return false;
}
if(kwsys_stl::find(this->VisitedSymlinks.begin(),
if(std::find(this->VisitedSymlinks.begin(),
this->VisitedSymlinks.end(),
canonicalPath) == this->VisitedSymlinks.end())
{
......@@ -298,9 +296,9 @@ bool Glob::RecurseDirectory(kwsys_stl::string::size_type start,
// else we have already visited this symlink - prevent cyclic recursion
else if(messages)
{
kwsys_stl::string message;
for(kwsys_stl::vector<kwsys_stl::string>::const_iterator
pathIt = kwsys_stl::find(this->VisitedSymlinks.begin(),
std::string message;
for(std::vector<std::string>::const_iterator
pathIt = std::find(this->VisitedSymlinks.begin(),
this->VisitedSymlinks.end(),
canonicalPath);