[Cmake-commits] [cmake-commits] hoffman committed Configure.h NONE 1.1 Configure.hxx NONE 1.1 DateStamp.h NONE 1.1 Directory.hxx NONE 1.1 Glob.hxx NONE 1.1 Process.h NONE 1.1 RegularExpression.hxx NONE 1.1 String.h NONE 1.1 String.hxx NONE 1.1 System.h NONE 1.1 SystemTools.hxx NONE 1.1 auto_ptr.hxx NONE 1.1

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Apr 23 11:09:40 EDT 2009


Update of /cvsroot/CMake/CMake/VMSbuild/cmsys
In directory public:/mounts/ram/cvs-serv24424/VMSbuild/cmsys

Added Files:
	Configure.h Configure.hxx DateStamp.h Directory.hxx Glob.hxx 
	Process.h RegularExpression.hxx String.h String.hxx System.h 
	SystemTools.hxx auto_ptr.hxx 
Log Message:
ENH: check in almost building VMS stuff with VMSBuild directory since the bootstrap script will not work on VMS


--- NEW FILE: System.h ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: System.h,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_System_h
#define cmsys_System_h

#include <cmsys/Configure.h>

/* Redefine all public interface symbol names to be in the proper
   namespace.  These macros are used internally to kwsys only, and are
   not visible to user code.  Use kwsysHeaderDump.pl to reproduce
   these macros after making changes to the interface.  */
#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif
#if !cmsys_NAME_IS_KWSYS
# define kwsysSystem_Shell_GetArgumentForWindows      kwsys_ns(System_Shell_GetArgumentForWindows)
# define kwsysSystem_Shell_GetArgumentForUnix         kwsys_ns(System_Shell_GetArgumentForUnix)
# define kwsysSystem_Shell_GetArgumentSizeForWindows  kwsys_ns(System_Shell_GetArgumentSizeForWindows)
# define kwsysSystem_Shell_GetArgumentSizeForUnix     kwsys_ns(System_Shell_GetArgumentSizeForUnix)
# define kwsysSystem_Shell_Flag_e                     kwsys_ns(System_Shell_Flag_e)
# define kwsysSystem_Shell_Flag_Make                  kwsys_ns(System_Shell_Flag_Make)
# define kwsysSystem_Shell_Flag_VSIDE                 kwsys_ns(System_Shell_Flag_VSIDE)
# define kwsysSystem_Shell_Flag_EchoWindows           kwsys_ns(System_Shell_Flag_EchoWindows)
# define kwsysSystem_Shell_Flag_WatcomWMake           kwsys_ns(System_Shell_Flag_WatcomWMake)
# define kwsysSystem_Shell_Flag_MinGWMake             kwsys_ns(System_Shell_Flag_MinGWMake)
# define kwsysSystem_Shell_Flag_NMake                 kwsys_ns(System_Shell_Flag_NMake)
# define kwsysSystem_Shell_Flag_AllowMakeVariables    kwsys_ns(System_Shell_Flag_AllowMakeVariables)
#endif

#ifdef __VMS
#define cmsysSystem_Shell_GetArgumentForUnix \
   cmsysSystem_Shell_UnixGA
#define cmsysSystem_Shell_GetArgumentSizeForUnix \
   cmsysSystem_Shell_UnixGAS
#define cmsysSystem_Shell_GetArgumentForWindows \
   cmsysSystem_Shell_WindowsGA
#endif

#if defined(__cplusplus)
extern "C"
{
#endif

/**
 * Transform the given command line argument for use in a Windows or
 * Unix shell.  Returns a pointer to the end of the command line
 * argument in the provided output buffer.  Flags may be passed to
 * modify the generated quoting and escape sequences to work under
 * alternative environments.
 */
kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForWindows(const char* in,
                                                          char* out,
                                                          int flags);
kwsysEXPORT char* kwsysSystem_Shell_GetArgumentForUnix(const char* in,
                                                       char* out,
                                                       int flags);

/**
 * Compute the size of the buffer required to store the output from
 * kwsysSystem_Shell_GetArgumentForWindows or
 * kwsysSystem_Shell_GetArgumentForUnix.  The flags passed must be
 * identical between the two calls.
 */
kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForWindows(const char* in,
                                                            int flags);
kwsysEXPORT int kwsysSystem_Shell_GetArgumentSizeForUnix(const char* in,
                                                         int flags);

/**
 * Flags to pass to kwsysSystem_Shell_GetArgumentForWindows or
 * kwsysSystem_Shell_GetArgumentForUnix.  These modify the generated
 * quoting and escape sequences to work under alternative
 * environments.
 */
enum kwsysSystem_Shell_Flag_e
{
  /** The target shell is in a makefile.  */
  kwsysSystem_Shell_Flag_Make               = (1<<0),

  /** The target shell is in a VS project file.  Do not use with
      Shell_Flag_Make.  */
  kwsysSystem_Shell_Flag_VSIDE              = (1<<1),

  /** In a windows shell the argument is being passed to "echo".  */
  kwsysSystem_Shell_Flag_EchoWindows        = (1<<2),

  /** The target shell is in a Watcom WMake makefile.  */
  kwsysSystem_Shell_Flag_WatcomWMake        = (1<<3),

  /** The target shell is in a MinGW Make makefile.  */
  kwsysSystem_Shell_Flag_MinGWMake          = (1<<4),

  /** The target shell is in a NMake makefile.  */
  kwsysSystem_Shell_Flag_NMake              = (1<<6),

  /** Make variable reference syntax $(MAKEVAR) should not be escaped
      to allow a build tool to replace it.  Replacement values
      containing spaces, quotes, backslashes, or other
      non-alphanumeric characters that have significance to some makes
      or shells produce undefined behavior.  */
  kwsysSystem_Shell_Flag_AllowMakeVariables = (1<<5)
};

#if defined(__cplusplus)
} /* extern "C" */
#endif

/* If we are building a kwsys .c or .cxx file, let it use these macros.
   Otherwise, undefine them to keep the namespace clean.  */
#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# if !defined(KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
#  undef kwsysSystem_Shell_GetArgumentForWindows
#  undef kwsysSystem_Shell_GetArgumentForUnix
#  undef kwsysSystem_Shell_GetArgumentSizeForWindows
#  undef kwsysSystem_Shell_GetArgumentSizeForUnix
#  undef kwsysSystem_Shell_Flag_e
#  undef kwsysSystem_Shell_Flag_Make
#  undef kwsysSystem_Shell_Flag_VSIDE
#  undef kwsysSystem_Shell_Flag_EchoWindows
#  undef kwsysSystem_Shell_Flag_WatcomWMake
#  undef kwsysSystem_Shell_Flag_MinGWMake
#  undef kwsysSystem_Shell_Flag_NMake
#  undef kwsysSystem_Shell_Flag_AllowMakeVariables
# endif
#endif

#endif

--- NEW FILE: Process.h ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: Process.h,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_Process_h
#define cmsys_Process_h

#include <cmsys/Configure.h>

/* Redefine all public interface symbol names to be in the proper
   namespace.  These macros are used internally to kwsys only, and are
   not visible to user code.  Use kwsysHeaderDump.pl to reproduce
   these macros after making changes to the interface.  */
#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif
#if !cmsys_NAME_IS_KWSYS
# define kwsysProcess                     kwsys_ns(Process)
# define kwsysProcess_s                   kwsys_ns(Process_s)
# define kwsysProcess_New                 kwsys_ns(Process_New)
# define kwsysProcess_Delete              kwsys_ns(Process_Delete)
# define kwsysProcess_SetCommand          kwsys_ns(Process_SetCommand)
# define kwsysProcess_AddCommand          kwsys_ns(Process_AddCommand)
# define kwsysProcess_SetTimeout          kwsys_ns(Process_SetTimeout)
# define kwsysProcess_SetWorkingDirectory kwsys_ns(Process_SetWorkingDirectory)
# define kwsysProcess_SetPipeFile         kwsys_ns(Process_SetPipeFile)
# define kwsysProcess_SetPipeNative       kwsys_ns(Process_SetPipeNative)
# define kwsysProcess_SetPipeShared       kwsys_ns(Process_SetPipeShared)
# define kwsysProcess_Option_Detach       kwsys_ns(Process_Option_Detach)
# define kwsysProcess_Option_HideWindow   kwsys_ns(Process_Option_HideWindow)
# define kwsysProcess_Option_Verbatim     kwsys_ns(Process_Option_Verbatim)
# define kwsysProcess_GetOption           kwsys_ns(Process_GetOption)
# define kwsysProcess_SetOption           kwsys_ns(Process_SetOption)
# define kwsysProcess_Option_e            kwsys_ns(Process_Option_e)
# define kwsysProcess_State_Starting      kwsys_ns(Process_State_Starting)
# define kwsysProcess_State_Error         kwsys_ns(Process_State_Error)
# define kwsysProcess_State_Exception     kwsys_ns(Process_State_Exception)
# define kwsysProcess_State_Executing     kwsys_ns(Process_State_Executing)
# define kwsysProcess_State_Exited        kwsys_ns(Process_State_Exited)
# define kwsysProcess_State_Expired       kwsys_ns(Process_State_Expired)
# define kwsysProcess_State_Killed        kwsys_ns(Process_State_Killed)
# define kwsysProcess_State_Disowned      kwsys_ns(Process_State_Disowned)
# define kwsysProcess_GetState            kwsys_ns(Process_GetState)
# define kwsysProcess_State_e             kwsys_ns(Process_State_e)
# define kwsysProcess_Exception_None      kwsys_ns(Process_Exception_None)
# define kwsysProcess_Exception_Fault     kwsys_ns(Process_Exception_Fault)
# define kwsysProcess_Exception_Illegal   kwsys_ns(Process_Exception_Illegal)
# define kwsysProcess_Exception_Interrupt kwsys_ns(Process_Exception_Interrupt)
# define kwsysProcess_Exception_Numerical kwsys_ns(Process_Exception_Numerical)
# define kwsysProcess_Exception_Other     kwsys_ns(Process_Exception_Other)
# define kwsysProcess_GetExitException    kwsys_ns(Process_GetExitException)
# define kwsysProcess_Exception_e         kwsys_ns(Process_Exception_e)
# define kwsysProcess_GetExitCode         kwsys_ns(Process_GetExitCode)
# define kwsysProcess_GetExitValue        kwsys_ns(Process_GetExitValue)
# define kwsysProcess_GetErrorString      kwsys_ns(Process_GetErrorString)
# define kwsysProcess_GetExceptionString  kwsys_ns(Process_GetExceptionString)
# define kwsysProcess_Execute             kwsys_ns(Process_Execute)
# define kwsysProcess_Disown              kwsys_ns(Process_Disown)
# define kwsysProcess_WaitForData         kwsys_ns(Process_WaitForData)
# define kwsysProcess_Pipes_e             kwsys_ns(Process_Pipes_e)
# define kwsysProcess_Pipe_None           kwsys_ns(Process_Pipe_None)
# define kwsysProcess_Pipe_STDIN          kwsys_ns(Process_Pipe_STDIN)
# define kwsysProcess_Pipe_STDOUT         kwsys_ns(Process_Pipe_STDOUT)
# define kwsysProcess_Pipe_STDERR         kwsys_ns(Process_Pipe_STDERR)
# define kwsysProcess_Pipe_Timeout        kwsys_ns(Process_Pipe_Timeout)
# define kwsysProcess_Pipe_Handle         kwsys_ns(Process_Pipe_Handle)
# define kwsysProcess_WaitForExit         kwsys_ns(Process_WaitForExit)
# define kwsysProcess_Kill                kwsys_ns(Process_Kill)
#endif

#if defined(__cplusplus)
extern "C"
{
#endif

/**
 * Process control data structure.
 */
typedef struct kwsysProcess_s kwsysProcess;

/* Platform-specific pipe handle type.  */
#if defined(_WIN32) && !defined(__CYGWIN__)
typedef void* kwsysProcess_Pipe_Handle;
#else
typedef int kwsysProcess_Pipe_Handle;
#endif

/**
 * Create a new Process instance.
 */
kwsysEXPORT kwsysProcess* kwsysProcess_New(void);

/**
 * Delete an existing Process instance.  If the instance is currently
 * executing a process, this blocks until the process terminates.
 */
kwsysEXPORT void kwsysProcess_Delete(kwsysProcess* cp);

/**
 * Set the command line to be executed.  Argument is an array of
 * pointers to the command and each argument.  The array must end with
 * a NULL pointer.  Any previous command lines are removed.  Returns
 * 1 for success and 0 otherwise.
 */
kwsysEXPORT int kwsysProcess_SetCommand(kwsysProcess* cp,
                                        char const* const* command);

/**
 * Add a command line to be executed.  Argument is an array of
 * pointers to the command and each argument.  The array must end with
 * a NULL pointer.  If this is not the first command added, its
 * standard input will be connected to the standard output of the
 * previous command.  Returns 1 for success and 0 otherwise.
 */
kwsysEXPORT int kwsysProcess_AddCommand(kwsysProcess* cp,
                                        char const* const* command);

/**
 * Set the timeout in seconds for the child process.  The timeout
 * period begins when the child is executed.  If the child has not
 * terminated when the timeout expires, it will be killed.  A
 * non-positive (<= 0) value will disable the timeout.
 */
kwsysEXPORT void kwsysProcess_SetTimeout(kwsysProcess* cp, double timeout);

/**
 * Set the working directory for the child process.  The working
 * directory can be absolute or relative to the current directory.
 * Returns 1 for success and 0 for failure.
 */
kwsysEXPORT int kwsysProcess_SetWorkingDirectory(kwsysProcess* cp,
                                                 const char* dir);

/**
 * Set the name of a file to be attached to the given pipe.  Returns 1
 * for success and 0 for failure.
 */
kwsysEXPORT int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe,
                                         const char* file);

/**
 * Set whether the given pipe in the child is shared with the parent
 * process.  The default is no for Pipe_STDOUT and Pipe_STDERR and yes
 * for Pipe_STDIN.
 */
kwsysEXPORT void kwsysProcess_SetPipeShared(kwsysProcess* cp, int pipe,
                                            int shared);

/**
 * Specify a platform-specific native pipe for use as one of the child
 * interface pipes.  The native pipe is specified by an array of two
 * descriptors or handles.  The first entry in the array (index 0)
 * should be the read end of the pipe.  The second entry in the array
 * (index 1) should be the write end of the pipe.  If a null pointer
 * is given the option will be disabled.
 *
 * For Pipe_STDIN the native pipe is connected to the first child in
 * the pipeline as its stdin.  After the children are created the
 * write end of the pipe will be closed in the child process and the
 * read end will be closed in the parent process.
 *
 * For Pipe_STDOUT and Pipe_STDERR the pipe is connected to the last
 * child as its stdout or stderr.  After the children are created the
 * write end of the pipe will be closed in the parent process and the
 * read end will be closed in the child process.
 */
kwsysEXPORT void kwsysProcess_SetPipeNative(kwsysProcess* cp, int pipe,
                                            kwsysProcess_Pipe_Handle p[2]);

/**
 * Get/Set a possibly platform-specific option.  Possible options are:
 *
 *  kwsysProcess_Option_Detach = Whether to detach the process.
 *         0 = No (default)
 *         1 = Yes
 *
 *  kwsysProcess_Option_HideWindow = Whether to hide window on Windows.
 *         0 = No (default)
 *         1 = Yes
 *
 *  kwsysProcess_Option_Verbatim = Whether SetCommand and AddCommand
 *                                 should treat the first argument
 *                                 as a verbatim command line
 *                                 and ignore the rest of the arguments.
 *         0 = No (default)
 *         1 = Yes
 */
kwsysEXPORT int kwsysProcess_GetOption(kwsysProcess* cp, int optionId);
kwsysEXPORT void kwsysProcess_SetOption(kwsysProcess* cp, int optionId,
                                        int value);
enum kwsysProcess_Option_e
{
  kwsysProcess_Option_HideWindow,
  kwsysProcess_Option_Detach,
  kwsysProcess_Option_Verbatim
};

/**
 * Get the current state of the Process instance.  Possible states are:
 *
 *  kwsysProcess_State_Starting  = Execute has not yet been called.
 *  kwsysProcess_State_Error     = Error administrating the child process.
 *  kwsysProcess_State_Exception = Child process exited abnormally.
 *  kwsysProcess_State_Executing = Child process is currently running.
 *  kwsysProcess_State_Exited    = Child process exited normally.
 *  kwsysProcess_State_Expired   = Child process's timeout expired.
 *  kwsysProcess_State_Killed    = Child process terminated by Kill method.
 *  kwsysProcess_State_Disowned  = Child is no longer managed by this object.
 */
kwsysEXPORT int kwsysProcess_GetState(kwsysProcess* cp);
enum kwsysProcess_State_e
{
  kwsysProcess_State_Starting,
  kwsysProcess_State_Error,
  kwsysProcess_State_Exception,
  kwsysProcess_State_Executing,
  kwsysProcess_State_Exited,
  kwsysProcess_State_Expired,
  kwsysProcess_State_Killed,
  kwsysProcess_State_Disowned
};

/**
 * When GetState returns "Exception", this method returns a
 * platform-independent description of the exceptional behavior that
 * caused the child to terminate abnormally.  Possible exceptions are:
 *
 *  kwsysProcess_Exception_None      = No exceptional behavior occurred.
 *  kwsysProcess_Exception_Fault     = Child crashed with a memory fault.
 *  kwsysProcess_Exception_Illegal   = Child crashed with an illegal instruction.
 *  kwsysProcess_Exception_Interrupt = Child was interrupted by user (Cntl-C/Break).
 *  kwsysProcess_Exception_Numerical = Child crashed with a numerical exception.
 *  kwsysProcess_Exception_Other     = Child terminated for another reason.
 */
kwsysEXPORT int kwsysProcess_GetExitException(kwsysProcess* cp);
enum kwsysProcess_Exception_e
{
  kwsysProcess_Exception_None,
  kwsysProcess_Exception_Fault,
  kwsysProcess_Exception_Illegal,
  kwsysProcess_Exception_Interrupt,
  kwsysProcess_Exception_Numerical,
  kwsysProcess_Exception_Other
};

/**
 * When GetState returns "Exited" or "Exception", this method returns
 * the platform-specific raw exit code of the process.  UNIX platforms
 * should use WIFEXITED/WEXITSTATUS and WIFSIGNALED/WTERMSIG to access
 * this value.  Windows users should compare the value to the various
 * EXCEPTION_* values.
 *
 * If GetState returns "Exited", use GetExitValue to get the
 * platform-independent child return value.
 */
kwsysEXPORT int kwsysProcess_GetExitCode(kwsysProcess* cp);

/**
 * When GetState returns "Exited", this method returns the child's
 * platform-independent exit code (such as the value returned by the
 * child's main).
 */
kwsysEXPORT int kwsysProcess_GetExitValue(kwsysProcess* cp);

/**
 * When GetState returns "Error", this method returns a string
 * describing the problem.  Otherwise, it returns NULL.
 */
kwsysEXPORT const char* kwsysProcess_GetErrorString(kwsysProcess* cp);

/**
 * When GetState returns "Exception", this method returns a string
 * describing the problem.  Otherwise, it returns NULL.
 */
kwsysEXPORT const char* kwsysProcess_GetExceptionString(kwsysProcess* cp);

/**
 * Start executing the child process.
 */
kwsysEXPORT void kwsysProcess_Execute(kwsysProcess* cp);

/**
 * Stop management of a detached child process.  This closes any pipes
 * being read.  If the child was not created with the
 * kwsysProcess_Option_Detach option, this method does nothing.  This
 * is because disowning a non-detached process will cause the child
 * exit signal to be left unhandled until this process exits.
 */
kwsysEXPORT void kwsysProcess_Disown(kwsysProcess* cp);

/**
 * Block until data are available on a pipe, a timeout expires, or the
 * child process terminates.  Arguments are as follows:
 *
 *  data    = If data are read, the pointer to which this points is
 *            set to point to the data.
 *  length  = If data are read, the integer to which this points is
 *            set to the length of the data read.
 *  timeout = Specifies the maximum time this call may block.  Upon
 *            return after reading data, the time elapsed is subtracted
 *            from the timeout value.  If this timeout expires, the
 *            value is set to 0.  A NULL pointer passed for this argument
 *            indicates no timeout for the call.  A negative or zero
 *            value passed for this argument may be used for polling
 *            and will always return immediately.
 *
 * Return value will be one of:
 *
 *   Pipe_None    = No more data will be available from the child process,
 *    ( == 0)       or no process has been executed.  WaitForExit should
 *                  be called to wait for the process to terminate.
 *   Pipe_STDOUT  = Data have been read from the child's stdout pipe.
 *   Pipe_STDERR  = Data have been read from the child's stderr pipe.
 *   Pipe_Timeout = No data available within timeout specified for the
 *                  call.  Time elapsed has been subtracted from timeout
 *                  argument.
 */
kwsysEXPORT int kwsysProcess_WaitForData(kwsysProcess* cp, char** data,
                                         int* length, double* timeout);
enum kwsysProcess_Pipes_e
{
  kwsysProcess_Pipe_None,
  kwsysProcess_Pipe_STDIN,
  kwsysProcess_Pipe_STDOUT,
  kwsysProcess_Pipe_STDERR,
  kwsysProcess_Pipe_Timeout=255
};

/**
 * Block until the child process terminates or the given timeout
 * expires.  If no process is running, returns immediatly.  The
 * argument is:
 *
 *  timeout = Specifies the maximum time this call may block.  Upon
 *            returning due to child termination, the elapsed time
 *            is subtracted from the given value.  A NULL pointer
 *            passed for this argument indicates no timeout for the
 *            call.
 *
 * Return value will be one of:
 *
 *    0 = Child did not terminate within timeout specified for
 *        the call.  Time elapsed has been subtracted from timeout
 *        argument.
 *    1 = Child has terminated or was not running.
 */
kwsysEXPORT int kwsysProcess_WaitForExit(kwsysProcess* cp, double* timeout);

/**
 * Forcefully terminate the child process that is currently running.
 * The caller should call WaitForExit after this returns to wait for
 * the child to terminate.
 */
kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp);

#if defined(__cplusplus)
} /* extern "C" */
#endif

/* If we are building a kwsys .c or .cxx file, let it use these macros.
   Otherwise, undefine them to keep the namespace clean.  */
#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# if !cmsys_NAME_IS_KWSYS
#  undef kwsysProcess
#  undef kwsysProcess_s
#  undef kwsysProcess_New
#  undef kwsysProcess_Delete
#  undef kwsysProcess_SetCommand
#  undef kwsysProcess_AddCommand
#  undef kwsysProcess_SetTimeout
#  undef kwsysProcess_SetWorkingDirectory
#  undef kwsysProcess_SetPipeFile
#  undef kwsysProcess_SetPipeNative
#  undef kwsysProcess_SetPipeShared
#  undef kwsysProcess_Option_Detach
#  undef kwsysProcess_Option_HideWindow
#  undef kwsysProcess_Option_Verbatim
#  undef kwsysProcess_GetOption
#  undef kwsysProcess_SetOption
#  undef kwsysProcess_Option_e
#  undef kwsysProcess_State_Starting
#  undef kwsysProcess_State_Error
#  undef kwsysProcess_State_Exception
#  undef kwsysProcess_State_Executing
#  undef kwsysProcess_State_Exited
#  undef kwsysProcess_State_Expired
#  undef kwsysProcess_State_Killed
#  undef kwsysProcess_State_Disowned
#  undef kwsysProcess_GetState
#  undef kwsysProcess_State_e
#  undef kwsysProcess_Exception_None
#  undef kwsysProcess_Exception_Fault
#  undef kwsysProcess_Exception_Illegal
#  undef kwsysProcess_Exception_Interrupt
#  undef kwsysProcess_Exception_Numerical
#  undef kwsysProcess_Exception_Other
#  undef kwsysProcess_GetExitException
#  undef kwsysProcess_Exception_e
#  undef kwsysProcess_GetExitCode
#  undef kwsysProcess_GetExitValue
#  undef kwsysProcess_GetErrorString
#  undef kwsysProcess_GetExceptionString
#  undef kwsysProcess_Execute
#  undef kwsysProcess_Disown
#  undef kwsysProcess_WaitForData
#  undef kwsysProcess_Pipes_e
#  undef kwsysProcess_Pipe_None
#  undef kwsysProcess_Pipe_STDIN
#  undef kwsysProcess_Pipe_STDOUT
#  undef kwsysProcess_Pipe_STDERR
#  undef kwsysProcess_Pipe_Timeout
#  undef kwsysProcess_Pipe_Handle
#  undef kwsysProcess_WaitForExit
#  undef kwsysProcess_Kill
# endif
#endif

#endif

--- NEW FILE: Glob.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: Glob.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_Glob_hxx
#define cmsys_Glob_hxx

#include <cmsys/Configure.h>
#include <cmsys/Configure.hxx>

#include <cmsys/stl/string>
#include <cmsys/stl/vector>

/* Define this macro temporarily to keep the code readable.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# define kwsys_stl cmsys_stl
#endif

namespace cmsys
{

class GlobInternals;

/** \class Glob
 * \brief Portable globbing searches.
 *
 * Globbing expressions are much simpler than regular
 * expressions. This class will search for files using
 * globbing expressions.
 *
 * Finds all files that match a given globbing expression.
 */
class cmsys_EXPORT Glob
{
public:
  Glob();
  ~Glob();

  //! Find all files that match the pattern.
  bool FindFiles(const kwsys_stl::string& inexpr);

  //! Return the list of files that matched.
  kwsys_stl::vector<kwsys_stl::string>& GetFiles();

  //! Set recurse to true to match subdirectories.
  void RecurseOn() { this->SetRecurse(true); }
  void RecurseOff() { this->SetRecurse(false); }
  void SetRecurse(bool i) { this->Recurse = i; }
  bool GetRecurse() { return this->Recurse; }

  //! Set recurse through symlinks to true if recursion should traverse the
  // linked-to directories
  void RecurseThroughSymlinksOn() { this->SetRecurseThroughSymlinks(true); }
  void RecurseThroughSymlinksOff() { this->SetRecurseThroughSymlinks(false); }
  void SetRecurseThroughSymlinks(bool i) { this->RecurseThroughSymlinks = i; }
  bool GetRecurseThroughSymlinks() { return this->RecurseThroughSymlinks; }

  //! Get the number of symlinks followed through recursion
  unsigned int GetFollowedSymlinkCount() { return this->FollowedSymlinkCount; }

  //! Set relative to true to only show relative path to files.
  void SetRelative(const char* dir);
  const char* GetRelative();

  /** Convert the given globbing pattern to a regular expression.
      There is no way to quote meta-characters.  The
      require_whole_string argument specifies whether the regex is
      automatically surrounded by "^" and "$" to match the whole
      string.  This is on by default because patterns always match
      whole strings, but may be disabled to support concatenating
      expressions more easily (regex1|regex2|etc).  */
  static kwsys_stl::string PatternToRegex(const kwsys_stl::string& pattern,
                                          bool require_whole_string = true);

protected:
  //! Process directory
  void ProcessDirectory(kwsys_stl::string::size_type start,
    const kwsys_stl::string& dir, bool dir_only);

  //! Process last directory, but only when recurse flags is on. That is
  // effectively like saying: /path/to/file/**/file
  void RecurseDirectory(kwsys_stl::string::size_type start,
    const kwsys_stl::string& dir, bool dir_only);

  //! Add regular expression
  void AddExpression(const char* expr);

  //! Add a file to the list
  void AddFile(kwsys_stl::vector<kwsys_stl::string>& files, const char* file);

  GlobInternals* Internals;
  bool Recurse;
  kwsys_stl::string Relative;
  bool RecurseThroughSymlinks;
  unsigned int FollowedSymlinkCount;

private:
  Glob(const Glob&);  // Not implemented.
  void operator=(const Glob&);  // Not implemented.
};

} // namespace cmsys

/* Undefine temporary macro.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# undef kwsys_stl
#endif

#endif

--- NEW FILE: RegularExpression.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: RegularExpression.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
// Original Copyright notice:
// Copyright (C) 1991 Texas Instruments Incorporated.
//
// Permission is granted to any individual or institution to use, copy, modify,
// and distribute this software, provided that this complete copyright and
// permission notice is maintained, intact, in all copies and supporting
// documentation.
//
// Texas Instruments Incorporated provides this software "as is" without
// express or implied warranty.
//
// Created: MNF 06/13/89  Initial Design and Implementation
// Updated: LGO 08/09/89  Inherit from Generic
// Updated: MBN 09/07/89  Added conditional exception handling
// Updated: MBN 12/15/89  Sprinkled "const" qualifiers all over the place!
// Updated: DLS 03/22/91  New lite version
//

#ifndef cmsys_RegularExpression_hxx
#define cmsys_RegularExpression_hxx

#include <cmsys/Configure.h>
#include <cmsys/Configure.hxx>

#include <cmsys/stl/string>

/* Define this macro temporarily to keep the code readable.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# define kwsys_stl cmsys_stl
#endif

namespace cmsys
{

/** \class RegularExpression
 * \brief Implements pattern matching with regular expressions.
 *
 * This is the header file for the regular expression class.  An object of
 * this class contains a regular expression, in a special "compiled" format.
 * This compiled format consists of several slots all kept as the objects
 * private data.  The RegularExpression class provides a convenient way to
 * represent regular expressions.  It makes it easy to search for the same
 * regular expression in many different strings without having to compile a
 * string to regular expression format more than necessary.
 *
 * This class implements pattern matching via regular expressions.
 * A regular expression allows a programmer to specify  complex
 * patterns  that  can  be searched for and matched against the
 * character string of a string object. In its simplest form, a
 * regular  expression  is  a  sequence  of  characters used to
 * search for exact character matches. However, many times  the
 * exact  sequence to be found is not known, or only a match at
 * the beginning or end of a string is desired. The RegularExpression regu-
 * lar  expression  class implements regular expression pattern
 * matching as is found and implemented in many  UNIX  commands
 * and utilities.
 *
 * Example: The perl code
 * 
 *    $filename =~ m"([a-z]+)\.cc";
 *    print $1;
 *    
 * Is written as follows in C++
 *
 *    RegularExpression re("([a-z]+)\\.cc");
 *    re.find(filename);
 *    cerr << re.match(1);
 *
 *
 * The regular expression class provides a convenient mechanism
 * for  specifying  and  manipulating  regular expressions. The
 * regular expression object allows specification of such  pat-
 * terns  by using the following regular expression metacharac-
 * ters:
 *
 *  ^        Matches at beginning of a line
 *
 *  $        Matches at end of a line
 *
 * .         Matches any single character
 *
 * [ ]       Matches any character(s) inside the brackets
 *
 * [^ ]      Matches any character(s) not inside the brackets
 *
 *  -        Matches any character in range on either side of a dash
 *
 *  *        Matches preceding pattern zero or more times
 *
 *  +        Matches preceding pattern one or more times
 *
 *  ?        Matches preceding pattern zero or once only
 *
 * ()        Saves a matched expression and uses it in a  later match
 *
 * Note that more than one of these metacharacters can be  used
 * in  a  single  regular expression in order to create complex
 * search patterns. For example, the pattern [^ab1-9]  says  to
 * match  any  character  sequence that does not begin with the
 * characters "ab"  followed  by  numbers  in  the  series  one
 * through nine.
 *
 * There are three constructors for RegularExpression.  One just creates an
 * empty RegularExpression object.  Another creates a RegularExpression
 * object and initializes it with a regular expression that is given in the
 * form of a char*.  The third takes a reference to a RegularExpression
 * object as an argument and creates an object initialized with the
 * information from the given RegularExpression object.
 *
 * The  find  member function  finds   the  first  occurence   of  the regualr
 * expression of that object in the string given to find as an argument.  Find
 * returns a boolean, and  if true,  mutates  the private  data appropriately.
 * Find sets pointers to the beginning and end of  the thing last  found, they
 * are pointers into the actual string  that was searched.   The start and end
 * member functions return indicies  into the searched string that  correspond
 * to the beginning   and  end pointers  respectively.   The    compile member
 * function takes a char* and puts the  compiled version of the char* argument
 * into the object's private data fields.  The == and  != operators only check
 * the  to see  if   the compiled  regular  expression   is the same, and  the
 * deep_equal functions also checks  to see if the  start and end pointers are
 * the same.  The is_valid  function returns false if  program is set to NULL,
 * (i.e. there is no valid compiled exression).  The set_invalid function sets
 * the  program to NULL  (Warning: this deletes the compiled  expression). The
 * following examples may help clarify regular expression usage:
 *
 *   *  The regular expression  "^hello" matches  a "hello"  only at  the
 *      beginning of a  line.  It would match "hello  there" but not "hi,
 *      hello there".
 *
 *   *  The regular expression "long$" matches a  "long"  only at the end
 *      of a line. It would match "so long\0", but not "long ago".
 *
 *   *  The regular expression "t..t..g"  will match anything that  has a
 *      "t" then any two characters, another "t", any  two characters and
 *      then a "g".   It will match  "testing", or "test again" but would
 *      not match "toasting"
 *
 *   *  The regular  expression "[1-9ab]" matches any  number one through
 *      nine, and the characters  "a" and  "b".  It would match "hello 1"
 *      or "begin", but would not match "no-match".
 *
 *   *  The  regular expression "[^1-9ab]"  matches any character that is
 *      not a number one  through nine, or  an "a" or "b".   It would NOT
 *      match "hello 1" or "begin", but would match "no-match".
 *
 *   *  The regular expression "br* " matches  something that begins with
 *      a "b", is followed by zero or more "r"s, and ends in a space.  It
 *      would match "brrrrr ", and "b ", but would not match "brrh ".
 *
 *   *  The regular expression "br+ " matches something  that begins with
 *      a "b", is followed by one or more "r"s, and ends in  a space.  It
 *      would match "brrrrr ",  and  "br ", but would not  match "b  " or
 *      "brrh ".
 *
 *   *  The regular expression "br? " matches  something that begins with
 *      a "b", is followed by zero or one "r"s, and ends in  a space.  It
 *      would  match  "br ", and "b  ", but would not match  "brrrr "  or
 *      "brrh ".
 *
 *   *  The regular expression "(..p)b" matches  something ending with pb
 *      and beginning with whatever the two characters before the first p
 *      encounterd in the line were.  It would find  "repb" in "rep drepa
 *      qrepb".  The regular expression "(..p)a"  would find "repa qrepb"
 *      in "rep drepa qrepb"
 *
 *   *  The regular expression "d(..p)" matches something ending  with p,
 *      beginning with d, and having  two characters  in between that are
 *      the same as the two characters before  the first p  encounterd in
 *      the line.  It would match "drepa qrepb" in "rep drepa qrepb".
 *
 */
class cmsys_EXPORT RegularExpression 
{
public:
  /**
   * Instantiate RegularExpression with program=NULL.
   */
  inline RegularExpression ();        

  /**
   * Instantiate RegularExpression with compiled char*.
   */
  inline RegularExpression (char const*);
  
  /**
   * Instantiate RegularExpression as a copy of another regular expression.
   */
  RegularExpression (RegularExpression const&);

  /**
   * Destructor.
   */
  inline ~RegularExpression();

  /**
   * Compile a regular expression into internal code
   * for later pattern matching.
   */
  bool compile (char const*);

  /**
   * Matches the regular expression to the given string.
   * Returns true if found, and sets start and end indexes accordingly.
   */
  bool find (char const*);

  /**
   * Matches the regular expression to the given std string.
   * Returns true if found, and sets start and end indexes accordingly.
   */
  bool find (kwsys_stl::string const&);               

  /**
   * Index to start of first find.
   */
  inline kwsys_stl::string::size_type start() const;

  /**
   * Index to end of first find.
   */
  inline kwsys_stl::string::size_type end() const;

  /**
   * Copy the given regular expression.
   */
  RegularExpression& operator= (const RegularExpression& rxp);

  /**
   * Returns true if two regular expressions have the same
   * compiled program for pattern matching.
   */
  bool operator== (RegularExpression const&) const;

  /**
   * Returns true if two regular expressions have different
   * compiled program for pattern matching.
   */
  inline bool operator!= (RegularExpression const&) const;

  /**
   * Returns true if have the same compiled regular expressions
   * and the same start and end pointers.
   */
  bool deep_equal (RegularExpression const&) const;
  
  /**
   * True if the compiled regexp is valid.
   */
  inline bool is_valid() const;

  /**
   * Marks the regular expression as invalid.
   */
  inline void set_invalid();            

  /**
   * Destructor.
   */
  // awf added
  kwsys_stl::string::size_type start(int n) const;
  kwsys_stl::string::size_type end(int n) const;
  kwsys_stl::string match(int n) const;
  
  enum { NSUBEXP = 10 };
private: 
  const char* startp[NSUBEXP];
  const char* endp[NSUBEXP];
  char  regstart;                       // Internal use only
  char  reganch;                        // Internal use only
  const char* regmust;                  // Internal use only
  kwsys_stl::string::size_type regmlen;                // Internal use only
  char* program;   
  int   progsize;
  const char* searchstring;
};

/**
 * Create an empty regular expression.
 */
inline RegularExpression::RegularExpression () 
{ 
  this->program = 0;
}

/**
 * Creates a regular expression from string s, and
 * compiles s.
 */
inline RegularExpression::RegularExpression (const char* s) 
{  
  this->program = 0;
  if ( s )
    {
    this->compile(s);
    }
}

/**
 * Destroys and frees space allocated for the regular expression.
 */
inline RegularExpression::~RegularExpression () 
{
//#ifndef WIN32
  delete [] this->program;
//#endif
}

/**
 * Set the start position for the regular expression.
 */
inline kwsys_stl::string::size_type RegularExpression::start () const 
{
  return static_cast<kwsys_stl::string::size_type>(
    this->startp[0] - searchstring);
}


/**
 * Returns the start/end index of the last item found.
 */
inline kwsys_stl::string::size_type RegularExpression::end () const 
{
  return static_cast<kwsys_stl::string::size_type>(
    this->endp[0] - searchstring);
}

/**
 * Returns true if two regular expressions have different
 * compiled program for pattern matching.
 */
inline bool RegularExpression::operator!= (const RegularExpression& r) const 
{
  return(!(*this == r));
}

/**
 * Returns true if a valid regular expression is compiled
 * and ready for pattern matching.
 */
inline bool RegularExpression::is_valid () const 
{
  return (this->program != 0);
}


inline void RegularExpression::set_invalid () 
{
//#ifndef WIN32
  delete [] this->program;
//#endif
  this->program = 0;
}

/**
 * Return start index of nth submatch. start(0) is the start of the full match.
 */
inline kwsys_stl::string::size_type RegularExpression::start(int n) const
{
  return static_cast<kwsys_stl::string::size_type>(
    this->startp[n] - searchstring);
}


/**
 * Return end index of nth submatch. end(0) is the end of the full match.
 */
inline kwsys_stl::string::size_type RegularExpression::end(int n) const
{
  return static_cast<kwsys_stl::string::size_type>(
    this->endp[n] - searchstring);
}

/**
 * Return nth submatch as a string.
 */
inline kwsys_stl::string RegularExpression::match(int n) const
{
  if (this->startp[n]==0)
    {
    return kwsys_stl::string("");
    }
  else
    {
    return kwsys_stl::string(this->startp[n],
                             static_cast<kwsys_stl::string::size_type>(
                               this->endp[n] - this->startp[n]));
    }
}

} // namespace cmsys

/* Undefine temporary macro.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# undef kwsys_stl
#endif

#endif

--- NEW FILE: SystemTools.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: SystemTools.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_SystemTools_hxx
#define cmsys_SystemTools_hxx

#include <cmsys/ios/iosfwd>
#include <cmsys/stl/string>
#include <cmsys/stl/vector>
#include <cmsys/stl/map>

#include <cmsys/Configure.h>
#include <cmsys/String.hxx>

#include <sys/types.h>

// Required for va_list
#include <stdarg.h>
#if cmsys_STL_HAVE_STD && !defined(va_list)
// Some compilers move va_list into the std namespace and there is no way to
// tell that this has been done. Playing with things being included before or
// after stdarg.h does not solve things because we do not have control over
// what the user does. This hack solves this problem by moving va_list to our
// own namespace that is local for kwsys.
namespace std {} // Required for platforms that do not have std namespace
namespace cmsys_VA_LIST
{
  using namespace std;
  typedef va_list hack_va_list;
}
namespace cmsys
{
  typedef cmsys_VA_LIST::hack_va_list va_list;
}
#endif // va_list

#if defined( _MSC_VER )
typedef unsigned short mode_t;
#endif

/* Define these macros temporarily to keep the code readable.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# define kwsys_stl cmsys_stl
# define kwsys_ios cmsys_ios
#endif

namespace cmsys
{

class SystemToolsTranslationMap;
/** \class SystemToolsManager
 * \brief Use to make sure SystemTools is initialized before it is used
 * and is the last static object destroyed
 */
class cmsys_EXPORT SystemToolsManager
{
public:
  SystemToolsManager();
  ~SystemToolsManager();
};

// This instance will show up in any translation unit that uses
// SystemTools. It will make sure SystemTools is initialized 
// before it is used and is the last static object destroyed.
static SystemToolsManager SystemToolsManagerInstance;

/** \class SystemTools
 * \brief A collection of useful platform-independent system functions.
 */
class cmsys_EXPORT SystemTools
{
public:

  /** -----------------------------------------------------------------
   *               String Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Replace symbols in str that are not valid in C identifiers as
   * defined by the 1999 standard, ie. anything except [A-Za-z0-9_].
   * They are replaced with `_' and if the first character is a digit
   * then an underscore is prepended.  Note that this can produce
   * identifiers that the standard reserves (_[A-Z].* and __.*).
   */
  static kwsys_stl::string MakeCindentifier(const char* s);
  
  /**
   * Replace replace all occurences of the string in the source string.
   */
  static void ReplaceString(kwsys_stl::string& source,
                            const char* replace,
                            const char* with);

  /**
   * Return a capitalized string (i.e the first letter is uppercased,
   * all other are lowercased).
   */
  static kwsys_stl::string Capitalized(const kwsys_stl::string&);
  
  /**
   * Return a 'capitalized words' string (i.e the first letter of each word
   * is uppercased all other are left untouched though).
   */
  static kwsys_stl::string CapitalizedWords(const kwsys_stl::string&);
  
  /**
   * Return a 'uncapitalized words' string (i.e the first letter of each word
   * is lowercased all other are left untouched though).
   */
  static kwsys_stl::string UnCapitalizedWords(const kwsys_stl::string&);
  
  /**
   * Return a lower case string
   */
  static kwsys_stl::string LowerCase(const kwsys_stl::string&);
  
  /**
   * Return a lower case string
   */
  static kwsys_stl::string UpperCase(const kwsys_stl::string&);
  
  /**
   * Count char in string
   */
  static size_t CountChar(const char* str, char c);
  
  /**
   * Remove some characters from a string.
   * Return a pointer to the new resulting string (allocated with 'new')
   */
  static char* RemoveChars(const char* str, const char *toremove);

  /**
   * Remove remove all but 0->9, A->F characters from a string.
   * Return a pointer to the new resulting string (allocated with 'new')
   */
  static char* RemoveCharsButUpperHex(const char* str);
  
  /**
   * Replace some characters by another character in a string (in-place)
   * Return a pointer to string
   */
  static char* ReplaceChars(char* str, const char *toreplace,char replacement);
  
  /**
   * Returns true if str1 starts (respectively ends) with str2
   */
  static bool StringStartsWith(const char* str1, const char* str2);
  static bool StringEndsWith(const char* str1, const char* str2);

  /**
   * Returns a pointer to the last occurence of str2 in str1
   */
  static const char* FindLastString(const char* str1, const char* str2);
  
  /**
   * Make a duplicate of the string similar to the strdup C function
   * but use new to create the 'new' string, so one can use
   * 'delete' to remove it. Returns 0 if the input is empty.
   */
  static char* DuplicateString(const char* str);
  
  /**
   * Return the string cropped to a given length by removing chars in the
   * center of the string and replacing them with an ellipsis (...)
   */
  static kwsys_stl::string CropString(const kwsys_stl::string&,size_t max_len);
  
  /** split a path by separator into an array of strings, default is /.
      If isPath is true then the string is treated like a path and if
      s starts with a / then the first element of the returned array will
      be /, so /foo/bar will be [/, foo, bar]
  */  
  static kwsys_stl::vector<String> SplitString(const char* s, char separator = '/', 
                                               bool isPath = false);
  /**
   * Perform a case-independent string comparison
   */
  static int Strucmp(const char *s1, const char *s2);

  /** 
   * Convert a string in __DATE__ or __TIMESTAMP__ format into a time_t.
   * Return false on error, true on success
   */
  static bool ConvertDateMacroString(const char *str, time_t *tmt);
  static bool ConvertTimeStampMacroString(const char *str, time_t *tmt);

  /**
   * Split a string on its newlines into multiple lines
   * Return false only if the last line stored had no newline
   */
  static bool Split(const char* s, kwsys_stl::vector<kwsys_stl::string>& l);
  static bool Split(const char* s, kwsys_stl::vector<kwsys_stl::string>& l, char separator);
  
  /** 
   * Return string with space added between capitalized words
   * (i.e. EatMyShorts becomes Eat My Shorts )
   * (note that IEatShorts becomes IEat Shorts) 
   */
  static kwsys_stl::string AddSpaceBetweenCapitalizedWords(
    const kwsys_stl::string&);

  /**
   * Append two or more strings and produce new one.
   * Programmer must 'delete []' the resulting string, which was allocated
   * with 'new'.
   * Return 0 if inputs are empty or there was an error
   */
  static char* AppendStrings(
    const char* str1, const char* str2);
  static char* AppendStrings(
    const char* str1, const char* str2, const char* str3);

  /**
   * Estimate the length of the string that will be produced
   * from printing the given format string and arguments.  The
   * returned length will always be at least as large as the string
   * that will result from printing.
   * WARNING: since va_arg is called to iterate of the argument list,
   * you will not be able to use this 'ap' anymore from the beginning.
   * It's up to you to call va_end though.
   */
  static int EstimateFormatLength(const char *format, va_list ap);

  /**
   * Escape specific characters in 'str'.
   */
  static kwsys_stl::string EscapeChars(
    const char *str, const char *chars_to_escape, char escape_char = '\\');

  /** -----------------------------------------------------------------
   *               Filename Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Replace Windows file system slashes with Unix-style slashes.
   */
  static void ConvertToUnixSlashes(kwsys_stl::string& path);
  
  /**
   * For windows this calls ConvertToWindowsOutputPath and for unix
   * it calls ConvertToUnixOutputPath
   */
  static kwsys_stl::string ConvertToOutputPath(const char*);

  /**
   * Convert the path to a string that can be used in a unix makefile.
   * double slashes are removed, and spaces are escaped.
   */
  static kwsys_stl::string ConvertToUnixOutputPath(const char*);

  /**
   * Convert the path to string that can be used in a windows project or
   * makefile.   Double slashes are removed if they are not at the start of
   * the string, the slashes are converted to windows style backslashes, and
   * if there are spaces in the string it is double quoted.
   */
  static kwsys_stl::string ConvertToWindowsOutputPath(const char*);

  /**
   * Return true if a file exists in the current directory.
   * If isFile = true, then make sure the file is a file and 
   * not a directory.  If isFile = false, then return true
   * if it is a file or a directory.
   */
  static bool FileExists(const char* filename, bool isFile=false);

  /**
   * Return file length
   */
  static unsigned long FileLength(const char *filename);

  /**
     Change the modification time or create a file
  */
  static bool Touch(const char* filename, bool create);
  
  /**
   *  Compare file modification times.
   *  Return true for successful comparison and false for error.
   *  When true is returned, result has -1, 0, +1 for
   *  f1 older, same, or newer than f2.
   */
  static bool FileTimeCompare(const char* f1, const char* f2,
                              int* result);

  /**
   *  Get the file extension (including ".") needed for an executable
   *  on the current platform ("" for unix, ".exe" for Windows).
   */
  static const char* GetExecutableExtension();

  /**
   *  Given a path that exists on a windows machine, return the
   *  actuall case of the path as it was created.  If the file
   *  does not exist path is returned unchanged.  This does nothing
   *  on unix but return path.
   */
  static kwsys_stl::string GetActualCaseForPath(const char* path);

  /**
   * Given the path to a program executable, get the directory part of
   * the path with the file stripped off.  If there is no directory
   * part, the empty string is returned.
   */
  static kwsys_stl::string GetProgramPath(const char*);
  static bool SplitProgramPath(const char* in_name,
                               kwsys_stl::string& dir,
                               kwsys_stl::string& file,
                               bool errorReport = true);

  /**
   *  Given argv[0] for a unix program find the full path to a running
   *  executable.  argv0 can be null for windows WinMain programs
   *  in this case GetModuleFileName will be used to find the path
   *  to the running executable.  If argv0 is not a full path,
   *  then this will try to find the full path.  If the path is not
   *  found false is returned, if found true is returned.  An error
   *  message of the attempted paths is stored in errorMsg.  
   *  exeName is the name of the executable.
   *  buildDir is a possibly null path to the build directory.
   *  installPrefix is a possibly null pointer to the install directory.
   */
  static bool FindProgramPath(const char* argv0,
                              kwsys_stl::string& pathOut,
                              kwsys_stl::string& errorMsg,
                              const char* exeName = 0,
                              const char* buildDir = 0,
                              const char* installPrefix = 0);

  /**
   * Given a path to a file or directory, convert it to a full path.
   * This collapses away relative paths relative to the cwd argument
   * (which defaults to the current working directory).  The full path
   * is returned.
   */
  static kwsys_stl::string CollapseFullPath(const char* in_relative);
  static kwsys_stl::string CollapseFullPath(const char* in_relative,
                                            const char* in_base);

  /** 
   * Get the real path for a given path, removing all symlinks.  In
   * the event of an error (non-existent path, permissions issue,
   * etc.) the original path is returned.
   */
  static kwsys_stl::string GetRealPath(const char* path);

  /**
   * Split a path name into its root component and the rest of the
   * path.  The root component is one of the following:
   *    "/"   = UNIX full path
   *    "c:/" = Windows full path (can be any drive letter)
   *    "c:"  = Windows drive-letter relative path (can be any drive letter)
   *    "//"  = Network path
   *    "~"   = Home path for current user
   *    "~u"  = Home path for user 'u'
   *    ""    = Relative path
   *
   * A pointer to the rest of the path after the root component is
   * returned.  The root component is stored in the "root" string if
   * given.
   */
  static const char* SplitPathRootComponent(const char* p,
                                            kwsys_stl::string* root=0);

  /**
   * Split a path name into its basic components.  The first component
   * is one of the roots returned by SplitPathRootComponent.
   * The remaining components form the path.  If there is a trailing
   * slash then the last component is the empty string.  The
   * components can be recombined as "c[0]c[1]/c[2]/.../c[n]" to
   * produce the original path.  Home directory references are
   * automatically expanded if expand_home_dir is true and this
   * platform supports them.
   */
  static void SplitPath(const char* p,
                        kwsys_stl::vector<kwsys_stl::string>& components,
                        bool expand_home_dir = true);

  /**
   * Join components of a path name into a single string.  See
   * SplitPath for the format of the components.
   */
  static kwsys_stl::string JoinPath(
    const kwsys_stl::vector<kwsys_stl::string>& components);
  static kwsys_stl::string JoinPath(
    kwsys_stl::vector<kwsys_stl::string>::const_iterator first,
    kwsys_stl::vector<kwsys_stl::string>::const_iterator last);

  /**
   * Compare a path or components of a path.
   */
  static bool ComparePath(const char* c1, const char* c2);


  /**
   * Return path of a full filename (no trailing slashes)
   */
  static kwsys_stl::string GetFilenamePath(const kwsys_stl::string&);

  /**
   * Return file name of a full filename (i.e. file name without path)
   */
  static kwsys_stl::string GetFilenameName(const kwsys_stl::string&);

  /**
   * Split a program from its arguments and handle spaces in the paths
   */
  static void SplitProgramFromArgs(
    const char* path,
    kwsys_stl::string& program, kwsys_stl::string& args);

  /**
   * Return longest file extension of a full filename (dot included)
   */
  static kwsys_stl::string GetFilenameExtension(const kwsys_stl::string&);

  /**
   * Return shortest file extension of a full filename (dot included)
   */
  static kwsys_stl::string GetFilenameLastExtension(
    const kwsys_stl::string& filename);
  
  /**
   * Return file name without extension of a full filename
   */
  static kwsys_stl::string GetFilenameWithoutExtension(
    const kwsys_stl::string&);
  
  /**
   * Return file name without its last (shortest) extension
   */
  static kwsys_stl::string GetFilenameWithoutLastExtension(
    const kwsys_stl::string&);
  
  /**
   * Return whether the path represents a full path (not relative)
   */
  static bool FileIsFullPath(const char*);
  
  /**
   * For windows return the short path for the given path,
   * Unix just a pass through
   */
  static bool GetShortPath(const char* path, kwsys_stl::string& result);
  
  /**
   * Read line from file. Make sure to get everything. 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. 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, 
                                kwsys_stl::string& line,
                                bool* has_newline=0,
                                long sizeLimit=-1);

  /**
   * Get the parent directory of the directory or file
   */
  static kwsys_stl::string GetParentDirectory(const char* fileOrDir);

  /**
   * Check if the given file or directory is in subdirectory of dir
   */
  static bool IsSubDirectory(const char* fileOrDir, const char* dir);

  /** -----------------------------------------------------------------
   *               File Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Make a new directory if it is not there.  This function
   * can make a full path even if none of the directories existed
   * prior to calling this function.  
   */
  static bool MakeDirectory(const char* path);

  /**
   * Copy the source file to the destination file only
   * if the two files differ. If the "copyPermissions"
   * argument is true, the permissions of the copy are
   * set to be the same as the permissions of the
   * original.
   */
  static bool CopyFileIfDifferent(const char* source,
                                  const char* destination,
                                  bool copyPermissions = true);

  /**
   * Compare the contents of two files.  Return true if different
   */
  static bool FilesDiffer(const char* source, const char* destination);

  /**
   * Return true if the two files are the same file
   */
  static bool SameFile(const char* file1, const char* file2);

  /**
   * Copy a file. If the "copyPermissions" argument is true, the
   * permissions of the copy are set to be the same as the permissions
   * of the original.
   */
  static bool CopyFileAlways(const char* source, const char* destination,
                             bool copyPermissions = true);

  /**
   * Copy a file.  If the "always" argument is true the file is always
   * copied.  If it is false, the file is copied only if it is new or
   * has changed. If the "copyPermissions" argument is true, the
   * permissions of the copy are set to be the same as the permissions
   * of the original.
   */
  static bool CopyAFile(const char* source, const char* destination,
                        bool always = true, bool copyPermissions = true);

  /**
   * Copy content directory to another directory with all files and
   * subdirectories.  If the "always" argument is true all files are
   * always copied.  If it is false, only files that have changed or
   * are new are copied.
   */
  static bool CopyADirectory(const char* source, const char* destination,
                             bool always = true, bool copyPermissions = true);
  
  /**
   * Remove a file
   */
  static bool RemoveFile(const char* source);
  
  /**
   * Remove a directory
   */
  static bool RemoveADirectory(const char* source);

  /**
   * Get the maximum full file path length
   */
  static size_t GetMaximumFilePathLength();

  /**
   * Find a file in the system PATH, with optional extra paths
   */
  static kwsys_stl::string FindFile(
    const char* name,
    const kwsys_stl::vector<kwsys_stl::string>& path = 
    kwsys_stl::vector<kwsys_stl::string>(),
    bool no_system_path = false);

  /**
   * Find a directory in the system PATH, with optional extra paths
   */
  static kwsys_stl::string FindDirectory(
    const char* name,
    const kwsys_stl::vector<kwsys_stl::string>& path = 
    kwsys_stl::vector<kwsys_stl::string>(),
    bool no_system_path = false);

  /**
   * Find an executable in the system PATH, with optional extra paths
   */
  static kwsys_stl::string FindProgram(
    const char* name,
    const kwsys_stl::vector<kwsys_stl::string>& path = 
    kwsys_stl::vector<kwsys_stl::string>(),
    bool no_system_path = false);
  static kwsys_stl::string FindProgram(
    const kwsys_stl::vector<kwsys_stl::string>& names,
    const kwsys_stl::vector<kwsys_stl::string>& path = 
    kwsys_stl::vector<kwsys_stl::string>(),
    bool no_system_path = false);

  /**
   * Find a library in the system PATH, with optional extra paths
   */
  static kwsys_stl::string FindLibrary(
    const char* name,
    const kwsys_stl::vector<kwsys_stl::string>& path);
  
  /**
   * Return true if the file is a directory
   */
  static bool FileIsDirectory(const char* name);
  
  /**
   * Return true if the file is a symlink
   */
  static bool FileIsSymlink(const char* name);
  
  /**
   * Return true if the file has a given signature (first set of bytes)
   */
  static bool FileHasSignature(
    const char* filename, const char *signature, long offset = 0);

  /**
   * Attempt to detect and return the type of a file.
   * Up to 'length' bytes are read from the file, if more than 'percent_bin' %
   * of the bytes are non-textual elements, the file is considered binary,
   * otherwise textual. Textual elements are bytes in the ASCII [0x20, 0x7E]
   * range, but also \n, \r, \t.
   * The algorithm is simplistic, and should probably check for usual file
   * extensions, 'magic' signature, unicode, etc.
   */
  enum FileTypeEnum 
  { 
    FileTypeUnknown,
    FileTypeBinary,
    FileTypeText
  };
  static SystemTools::FileTypeEnum DetectFileType(
    const char* filename, 
    unsigned long length = 256, 
    double percent_bin = 0.05);

  /**
   * Create a symbolic link if the platform supports it.  Returns whether
   * creation succeded.
   */
  static bool CreateSymlink(const char* origName, const char* newName);

  /**
   * Read the contents of a symbolic link.  Returns whether reading
   * succeded.
   */
  static bool ReadSymlink(const char* newName, kwsys_stl::string& origName);

  /**
   * Try to locate the file 'filename' in the directory 'dir'.
   * If 'filename' is a fully qualified filename, the basename of the file is
   * used to check for its existence in 'dir'.
   * If 'dir' is not a directory, GetFilenamePath() is called on 'dir' to
   * get its directory first (thus, you can pass a filename as 'dir', as
   * a convenience).
   * 'filename_found' is assigned the fully qualified name/path of the file
   * if it is found (not touched otherwise).
   * If 'try_filename_dirs' is true, try to find the file using the
   * components of its path, i.e. if we are looking for c:/foo/bar/bill.txt, 
   * first look for bill.txt in 'dir', then in 'dir'/bar, then in 'dir'/foo/bar
   * etc.
   * Return true if the file was found, false otherwise.
   */
  static bool LocateFileInDir(const char *filename, 
                              const char *dir, 
                              kwsys_stl::string& filename_found,
                              int try_filename_dirs = 0);

  /** compute the relative path from local to remote.  local must 
      be a directory.  remote can be a file or a directory.  
      Both remote and local must be full paths.  Basically, if
      you are in directory local and you want to access the file in remote
      what is the relative path to do that.  For example:
      /a/b/c/d to /a/b/c1/d1 -> ../../c1/d1
      from /usr/src to /usr/src/test/blah/foo.cpp -> test/blah/foo.cpp
  */
  static kwsys_stl::string RelativePath(const char* local, const char* remote);

  /**
   * Return file's modified time
   */
  static long int ModifiedTime(const char* filename);

  /**
   * Return file's creation time (Win32: works only for NTFS, not FAT)
   */
  static long int CreationTime(const char* filename);

  /**
   * Get and set permissions of the file.
   */
  static bool GetPermissions(const char* file, mode_t& mode);
  static bool SetPermissions(const char* file, mode_t mode);

  /** -----------------------------------------------------------------
   *               Time Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Get current time as a double. On certain platforms this will
   * return higher resolution than seconds:
   * (1) gettimeofday() -- resolution in microseconds
   * (2) ftime() -- resolution in milliseconds
   * (3) time() -- resolution in seconds
   */
  static double GetTime();

  /**
   * Get current date/time
   */
  static kwsys_stl::string GetCurrentDateTime(const char* format);

  /** -----------------------------------------------------------------
   *               Registry Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Specify access to the 32-bit or 64-bit application view of
   * registry values.  The default is to match the currently running
   * binary type.
   */
  enum KeyWOW64 { KeyWOW64_Default, KeyWOW64_32, KeyWOW64_64 };

  /**
   * Read a registry value
   */
  static bool ReadRegistryValue(const char *key, kwsys_stl::string &value,
                                KeyWOW64 view = KeyWOW64_Default);

  /**
   * Write a registry value
   */
  static bool WriteRegistryValue(const char *key, const char *value,
                                 KeyWOW64 view = KeyWOW64_Default);

  /**
   * Delete a registry value
   */
  static bool DeleteRegistryValue(const char *key,
                                  KeyWOW64 view = KeyWOW64_Default);

  /** -----------------------------------------------------------------
   *               Environment Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   *  Add the paths from the environment variable PATH to the
   *  string vector passed in.  If env is set then the value
   *  of env will be used instead of PATH.
   */
  static void GetPath(kwsys_stl::vector<kwsys_stl::string>& path,
                      const char* env=0);

  /**
   * Read an environment variable
   */
  static const char* GetEnv(const char* key);
  static bool GetEnv(const char* key, kwsys_stl::string& result);

  /**
   * Get current working directory CWD
   */
  static kwsys_stl::string GetCurrentWorkingDirectory(bool collapse =true);

  /**
   * Change directory the the directory specified
   */
  static int ChangeDirectory(const char* dir);

  /**
   * Get the result of strerror(errno)
   */
  static kwsys_stl::string GetLastSystemError();

  /**
   * When building DEBUG with MSVC, this enables a hook that prevents
   * error dialogs from popping up if the program is being run from
   * DART.
   */
  static void EnableMSVCDebugHook();

  /**
   * Get the width of the terminal window. The code may or may not work, so
   * make sure you have some resonable defaults prepared if the code returns
   * some bogus size.
   */
  static int GetTerminalWidth();

  /**
   * Add an entry in the path translation table.
   */
  static void AddTranslationPath(const char * dir, const char * refdir);

  /**
   * If dir is different after CollapseFullPath is called,
   * Then insert it into the path translation table
   */
  static void AddKeepPath(const char* dir);

  /**
   * Update path by going through the Path Translation table;
   */
  static void CheckTranslationPath(kwsys_stl::string & path);

  /**
   * Delay the execution for a specified amount of time specified
   * in miliseconds
   */
  static void Delay(unsigned int msec);

  /**
   * Get the operating system name and version
   * This is implemented for Win32 only for the moment
   */
  static kwsys_stl::string GetOperatingSystemNameAndVersion();

  /**
   * Convert windows-style arguments given as a command-line string
   * into more traditional argc/argv arguments.
   * Note that argv[0] will be assigned the executable name using
   * the ::GetModuleFileName function.
   */
  static void ConvertWindowsCommandLineToUnixArguments(
    const char *cmd_line, int *argc, char ***argv);

  /** -----------------------------------------------------------------
   *               URL Manipulation Routines
   *  -----------------------------------------------------------------
   */

  /**
   * Parse a character string :
   *       protocol://dataglom
   * and fill protocol as appropriate.
   * Return false if the URL does not have the required form, true otherwise.
   */
   static bool ParseURLProtocol( const kwsys_stl::string& URL,
                                 kwsys_stl::string& protocol,
                                 kwsys_stl::string& dataglom );

  /**
   * Parse a string (a URL without protocol prefix) with the form:
   *  protocol://[[username[':'password]'@']hostname[':'dataport]]'/'[datapath]
   * and fill protocol, username, password, hostname, dataport, and datapath
   * when values are found.
   * Return true if the string matches the format; false otherwise.
   */
  static bool ParseURL( const kwsys_stl::string& URL,
                        kwsys_stl::string& protocol, 
                        kwsys_stl::string& username, 
                        kwsys_stl::string& password, 
                        kwsys_stl::string& hostname, 
                        kwsys_stl::string& dataport, 
                        kwsys_stl::string& datapath );

private:
  /**
   * Allocate the stl map that serve as the Path Translation table.
   */
  static void ClassInitialize();

  /**
   * Deallocate the stl map that serve as the Path Translation table.
   */
  static void ClassFinalize();

  /**
   * This method prevents warning on SGI
   */
  SystemToolsManager* GetSystemToolsManager()
    {
    return &SystemToolsManagerInstance;
    }

  /**
   * Find a filename (file or directory) in the system PATH, with
   * optional extra paths.
   */
  static kwsys_stl::string FindName(
    const char* name,
    const kwsys_stl::vector<kwsys_stl::string>& path = 
    kwsys_stl::vector<kwsys_stl::string>(),
    bool no_system_path = false);


  /**
   * Path translation table from dir to refdir
   * Each time 'dir' will be found it will be replace by 'refdir'
   */
  static SystemToolsTranslationMap *TranslationMap;
  static SystemToolsTranslationMap *LongPathMap;
  friend class SystemToolsManager;
};

} // namespace cmsys

/* Undefine temporary macros.  */
#if !defined (KWSYS_NAMESPACE) && !cmsys_NAME_IS_KWSYS
# undef kwsys_stl
# undef kwsys_ios
#endif

#endif

--- NEW FILE: auto_ptr.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: auto_ptr.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_auto_ptr_hxx
#define cmsys_auto_ptr_hxx

#include <cmsys/Configure.hxx>

// The HP compiler and VS6 cannot handle the conversions necessary to use
// auto_ptr_ref to pass an auto_ptr returned from one function
// directly to another function as in use_auto_ptr(get_auto_ptr()).
// We instead use const_cast to achieve the syntax on those platforms.
// We do not use const_cast on other platforms to maintain the C++
// standard design and guarantee that if an auto_ptr is bound
// to a reference-to-const then ownership will be maintained.
#if defined(__HP_aCC) || (defined(_MSC_VER) && _MSC_VER <= 1200)
# define cmsys_AUTO_PTR_REF 0
# define cmsys_AUTO_PTR_CONST const
# define cmsys_AUTO_PTR_CAST(a) cast(a)
#else
# define cmsys_AUTO_PTR_REF 1
# define cmsys_AUTO_PTR_CONST
# define cmsys_AUTO_PTR_CAST(a) a
#endif

namespace cmsys
{

template <class X> class auto_ptr;

#if cmsys_AUTO_PTR_REF
namespace detail
{
// The auto_ptr_ref template is supposed to be a private member of
// auto_ptr but Borland 5.8 cannot handle it.  Instead put it in
// a private namespace.
template <class Y> struct auto_ptr_ref
{
  Y* p_;

  // The extra constructor argument prevents implicit conversion to
  // auto_ptr_ref from auto_ptr through the constructor.  Normally
  // this should be done with the explicit keyword but Borland 5.x
  // generates code in the conversion operator to call itself
  // infinately.
  auto_ptr_ref(Y* p, int): p_(p) {}
};
}
#endif

/** C++98 Standard Section 20.4.5 - Template class auto_ptr.  */
template <class X>
class auto_ptr
{
#if !cmsys_AUTO_PTR_REF
  template <typename Y>
  static inline auto_ptr<Y>& cast(auto_ptr<Y> const& a)
    { return const_cast<auto_ptr<Y>&>(a); }
#endif

  /** The pointer to the object held.  */
  X* x_;

public:
  /** The type of object held by the auto_ptr.  */
  typedef X element_type;

  /** Construct from an auto_ptr holding a compatible object.  This
      transfers ownership to the newly constructed auto_ptr.  */
  template <class Y>
  auto_ptr(auto_ptr<Y> cmsys_AUTO_PTR_CONST& a) throw():
    x_(cmsys_AUTO_PTR_CAST(a).release())
    {
    }

  /** Assign from an auto_ptr holding a compatible object.  This
      transfers ownership to the left-hand-side of the assignment.  */
  template <class Y>
  auto_ptr& operator=(auto_ptr<Y> cmsys_AUTO_PTR_CONST& a) throw()
    {
    this->reset(cmsys_AUTO_PTR_CAST(a).release());
    return *this;
    }

  /**
   * Explicitly construct from a raw pointer.  This is typically
   * called with the result of operator new.  For example:
   *
   *   auto_ptr<X> ptr(new X());
   */
  explicit auto_ptr(X* p=0) throw(): x_(p)
    {
    }

  /** Construct from another auto_ptr holding an object of the same
      type.  This transfers ownership to the newly constructed
      auto_ptr.  */
  auto_ptr(auto_ptr cmsys_AUTO_PTR_CONST& a) throw():
    x_(cmsys_AUTO_PTR_CAST(a).release())
    {
    }

  /** Assign from another auto_ptr holding an object of the same type.
      This transfers ownership to the newly constructed auto_ptr.  */
  auto_ptr& operator=(auto_ptr cmsys_AUTO_PTR_CONST& a) throw()
    {
    this->reset(cmsys_AUTO_PTR_CAST(a).release());
    return *this;
    }

  /** Destruct and delete the object held.  */
  ~auto_ptr() throw()
    {
    // Assume object destructor is nothrow.
    delete this->x_;
    }

  /** Dereference and return a reference to the object held.  */
  X& operator*() const throw()
    {
    return *this->x_;
    }

  /** Return a pointer to the object held.  */
  X* operator->() const throw()
    {
    return this->x_;
    }

  /** Return a pointer to the object held.  */
  X* get() const throw()
    {
    return this->x_;
    }

  /** Return a pointer to the object held and reset to hold no object.
      This transfers ownership to the caller.  */
  X* release() throw()
    {
    X* x = this->x_;
    this->x_ = 0;
    return x;
    }

  /** Assume ownership of the given object.  The object previously
      held is deleted.  */
  void reset(X* p=0) throw()
    {
    if(this->x_ != p)
      {
      // Assume object destructor is nothrow.
      delete this->x_;
      this->x_ = p;
      }
    }

  /** Convert to an auto_ptr holding an object of a compatible type.
      This transfers ownership to the returned auto_ptr.  */
  template <class Y> operator auto_ptr<Y>() throw()
    {
    return auto_ptr<Y>(this->release());
    }

#if cmsys_AUTO_PTR_REF
  /** Construct from an auto_ptr_ref.  This is used when the
      constructor argument is a call to a function returning an
      auto_ptr.  */
  auto_ptr(detail::auto_ptr_ref<X> r) throw(): x_(r.p_)
    {
    }

  /** Assign from an auto_ptr_ref.  This is used when a function
      returning an auto_ptr is passed on the right-hand-side of an
      assignment.  */
  auto_ptr& operator=(detail::auto_ptr_ref<X> r) throw()
    {
    this->reset(r.p_);
    return *this;
    }

  /** Convert to an auto_ptr_ref.  This is used when a function
      returning an auto_ptr is the argument to the constructor of
      another auto_ptr.  */
  template <class Y> operator detail::auto_ptr_ref<Y>() throw()
    {
    return detail::auto_ptr_ref<Y>(this->release(), 1);
    }
#endif
};

} // namespace cmsys

#endif

--- NEW FILE: DateStamp.h ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: DateStamp.h,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_DateStamp_h
#define cmsys_DateStamp_h

/** Version date integer year.  The format is CCYY.  */
#define cmsys_DATE_STAMP_YEAR          2009

/** Version date integer month.  The format is MM.  */
#define cmsys_DATE_STAMP_MONTH         04

/** Version date integer day.  The format is DD.  */
#define cmsys_DATE_STAMP_DAY           22

/** Version date full integer.  The format is CCYYMMDD.  */
#define cmsys_DATE_STAMP_FULL          20090422

/** Version date string year.  The format is "CCYY".  */
#define cmsys_DATE_STAMP_STRING_YEAR  "2009"

/** Version date string month.  The format is "MM".  */
#define cmsys_DATE_STAMP_STRING_MONTH "04"

/** Version date string day.  The format is "DD".  */
#define cmsys_DATE_STAMP_STRING_DAY   "22"

/** Version date full string.  The format is "CCYYMMDD".  */
#define cmsys_DATE_STAMP_STRING_FULL  "20090422"

/** Version date formatted string.  The format is "CCYY-MM-DD".  */
#define cmsys_DATE_STAMP_STRING       "2009-04-22"

#endif

--- NEW FILE: String.h ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: String.h,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_String_h
#define cmsys_String_h

#include <cmsys/Configure.h>

#include <stddef.h> /* size_t */

/* Redefine all public interface symbol names to be in the proper
   namespace.  These macros are used internally to kwsys only, and are
   not visible to user code.  Use kwsysHeaderDump.pl to reproduce
   these macros after making changes to the interface.  */
#if !defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif
#if !cmsys_NAME_IS_KWSYS
# define kwsysString_strcasecmp                kwsys_ns(String_strcasecmp)
# define kwsysString_strncasecmp               kwsys_ns(String_strncasecmp)
#endif

#if defined(__cplusplus)
extern "C"
{
#endif

/**
 * Compare two strings ignoring the case of the characters.  The
 * integer returned is negative, zero, or positive if the first string
 * is found to be less than, equal to, or greater than the second
 * string, respectively.
 */
kwsysEXPORT int kwsysString_strcasecmp(const char* lhs, const char* rhs);

/**
 * Identical to String_strcasecmp except that only the first n
 * characters are considered.
 */
kwsysEXPORT int kwsysString_strncasecmp(const char* lhs, const char* rhs,
                                        size_t n);

#if defined(__cplusplus)
} /* extern "C" */
#endif

/* If we are building a kwsys .c or .cxx file, let it use these macros.
   Otherwise, undefine them to keep the namespace clean.  */
#if !defined(KWSYS_NAMESPACE)
# undef kwsys_ns
# undef kwsysEXPORT
# if !cmsys_NAME_IS_KWSYS
#  undef kwsysString_strcasecmp
#  undef kwsysString_strncasecmp
# endif
#endif

#endif

--- NEW FILE: Directory.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: Directory.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_Directory_hxx
#define cmsys_Directory_hxx

#include <cmsys/Configure.h>

namespace cmsys
{

class DirectoryInternals;

/** \class Directory
 * \brief Portable directory/filename traversal.
 *
 * Directory provides a portable way of finding the names of the files
 * in a system directory.
 *
 * Directory currently works with Windows and Unix operating systems.
 */
class cmsys_EXPORT Directory
{
public:
  Directory();
  ~Directory();

  /**
   * Load the specified directory and load the names of the files
   * in that directory. 0 is returned if the directory can not be
   * opened, 1 if it is opened.
   */
  bool Load(const char*);

  /**
   * Return the number of files in the current directory.
   */
  unsigned long GetNumberOfFiles() const;

  /**
   * Return the number of files in the specified directory.
   * A higher performance static method.
   */
  static unsigned long GetNumberOfFilesInDirectory(const char*);

  /**
   * Return the file at the given index, the indexing is 0 based
   */
  const char* GetFile(unsigned long) const;

  /**
   * Return the path to Open'ed directory
   */
  const char* GetPath() const;

  /**
   * Clear the internal structure. Used internally at beginning of Load(...)
   * to clear the cache.
   */
  void Clear();

private:
  // Private implementation details.
  DirectoryInternals* Internal;

  Directory(const Directory&);  // Not implemented.
  void operator=(const Directory&);  // Not implemented.
}; // End Class: Directory

} // namespace cmsys

#endif

--- NEW FILE: Configure.hxx ---
/*
 * Generated by /cygdrive/c/hoffman/My Builds/CMake262/bootstrap
 * Version:     $Revision: 1.1 $
 *
 * Source directory: /cygdrive/c/hoffman/My Builds/CMake262
 * Binary directory: /cygdrive/c/hoffman/My Builds/CMake262-cygwin/Bootstrap.cmk
 *
 * C compiler:   cc
 * C flags:      
 *
 * C++ compiler: g++
 * C++ flags:    
 *
 * Make:         make
 *
 * Sources:
 *   cmake    cmakemain   cmakewizard    cmCommandArgumentLexer   cmCommandArgumentParser   cmCommandArgumentParserHelper   cmDepends   cmDependsC   cmDocumentationFormatter   cmDocumentationFormatterText   cmPolicies   cmProperty   cmPropertyMap   cmPropertyDefinition   cmPropertyDefinitionMap   cmMakeDepend   cmMakefile   cmExportFileGenerator   cmExportInstallFileGenerator   cmInstallDirectoryGenerator   cmGeneratedFileStream   cmGlobalGenerator   cmLocalGenerator   cmInstallGenerator   cmInstallExportGenerator   cmInstallFilesGenerator   cmInstallScriptGenerator   cmInstallTargetGenerator   cmSourceFile   cmSourceFileLocation   cmSystemTools   cmVersion   cmFileTimeComparison   cmGlobalUnixMakefileGenerator3   cmLocalUnixMakefileGenerator3   cmMakefileExecutableTargetGenerator   cmMakefileLibraryTargetGenerator   cmMakefileTargetGenerator   cmMakefileUtilityTargetGenerator   cmBootstrapCommands   cmCommands   cmTarget   cmTest   cmCustomCommand   cmDocumentVariables   cmCacheManager   cmListFileCache   cmComputeLinkDepends   cmComputeLinkInformation   cmOrderDirectories   cmComputeTargetDepends   cmComputeComponentGraph   cmExprLexer   cmExprParser   cmExprParserHelper    cmListFileLexer   
 * kwSys Sources:
 *   Directory   Glob   RegularExpression   SystemTools     ProcessUNIX     String     System 
 */

/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: Configure.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_Configure_hxx
#define cmsys_Configure_hxx

/* Include C configuration.  */
#include <cmsys/Configure.h>

/* Whether kwsys namespace is "kwsys".  */
#define cmsys_NAME_IS_KWSYS 0

/* Whether ANSI C++ stream headers are to be used.  */
#define cmsys_IOS_USE_ANSI 1

/* Whether ANSI C++ streams are in std namespace.  */
#define cmsys_IOS_HAVE_STD 1

/* Whether ANSI C++ <sstream> header is to be used.  */
#define cmsys_IOS_USE_SSTREAM 1

/* Whether old C++ <strstream.h> header is to be used.  */
#define cmsys_IOS_USE_STRSTREAM_H 0

/* Whether old C++ <strstrea.h> header is to be used.  */
#define cmsys_IOS_USE_STRSTREA_H 0

/* Whether STL is in std namespace.  */
#define cmsys_STL_HAVE_STD 1

/* Whether the STL string has operator<< for ostream.  */
#define cmsys_STL_STRING_HAVE_OSTREAM 1

/* Whether the STL string has operator>> for istream.  */
#define cmsys_STL_STRING_HAVE_ISTREAM 1

/* Whether the STL string has operator!= for char*.  */
#define cmsys_STL_STRING_HAVE_NEQ_CHAR 1

/* Define the stl namespace macro.  */
#if cmsys_STL_HAVE_STD
# define cmsys_stl std
#else
# define cmsys_stl
#endif

/* Define the ios namespace macro.  */
#if cmsys_IOS_HAVE_STD
# define cmsys_ios_namespace std
#else
# define cmsys_ios_namespace
#endif
#if cmsys_IOS_USE_SSTREAM
# define cmsys_ios cmsys_ios_namespace
#else
# define cmsys_ios cmsys_ios
#endif

/* Whether the cstddef header is available.  */
#define cmsys_CXX_HAS_CSTDDEF 1

/* Whether the compiler supports null template arguments.  */
#define cmsys_CXX_HAS_NULL_TEMPLATE_ARGS 1

/* Define the null template arguments macro.  */
#if cmsys_CXX_HAS_NULL_TEMPLATE_ARGS
# define cmsys_CXX_NULL_TEMPLATE_ARGS <>
#else
# define cmsys_CXX_NULL_TEMPLATE_ARGS
#endif

/* Whether the compiler supports member templates.  */
#define cmsys_CXX_HAS_MEMBER_TEMPLATES 1

/* Whether the compiler supports argument dependent lookup.  */
#define cmsys_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP 1

/* Whether the compiler supports standard full specialization syntax.  */
#define cmsys_CXX_HAS_FULL_SPECIALIZATION 1

/* Define the specialization definition macro.  */
#if cmsys_CXX_HAS_FULL_SPECIALIZATION
# define cmsys_CXX_DEFINE_SPECIALIZATION template <>
#else
# define cmsys_CXX_DEFINE_SPECIALIZATION
#endif

/* Define typename keyword macro for use in declarations.  */
#if defined(_MSC_VER) && _MSC_VER < 1300
# define cmsys_CXX_DECL_TYPENAME
#else
# define cmsys_CXX_DECL_TYPENAME typename
#endif

/* Whether the stl has iterator_traits.  */
#define cmsys_STL_HAS_ITERATOR_TRAITS 1

/* Whether the stl has iterator_category.  */
#define cmsys_STL_HAS_ITERATOR_CATEGORY 0

/* Whether the stl has __iterator_category.  */
#define cmsys_STL_HAS___ITERATOR_CATEGORY 0

/* Whether the stl allocator is the standard template.  */
#define cmsys_STL_HAS_ALLOCATOR_TEMPLATE 1

/* Whether the stl allocator is not a template.  */
#define cmsys_STL_HAS_ALLOCATOR_NONTEMPLATE 0

/* Whether the stl allocator has rebind.  */
#define cmsys_STL_HAS_ALLOCATOR_REBIND 1

/* Whether the stl allocator has a size argument for max_size.  */
#define cmsys_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT 0

/* Whether the stl containers support allocator objects.  */
#define cmsys_STL_HAS_ALLOCATOR_OBJECTS 1

/* Whether struct stat has the st_mtim member for high resolution times.  */
/* #undef cmsys_STAT_HAS_ST_MTIM 1 */

/* If building a C++ file in kwsys itself, give the source file
   access to the macros without a configured namespace.  */
#if defined(KWSYS_NAMESPACE)
# if !cmsys_NAME_IS_KWSYS
#  define kwsys_stl cmsys_stl
#  define kwsys_ios cmsys_ios
#  define kwsys     cmsys
# endif
# define KWSYS_NAME_IS_KWSYS            cmsys_NAME_IS_KWSYS
# define KWSYS_STL_HAVE_STD             cmsys_STL_HAVE_STD
# define KWSYS_IOS_HAVE_STD             cmsys_IOS_HAVE_STD
# define KWSYS_IOS_USE_ANSI             cmsys_IOS_USE_ANSI
# define KWSYS_IOS_USE_SSTREAM          cmsys_IOS_USE_SSTREAM
# define KWSYS_IOS_USE_STRSTREAM_H      cmsys_IOS_USE_STRSTREAM_H
# define KWSYS_IOS_USE_STRSTREA_H       cmsys_IOS_USE_STRSTREA_H
# define KWSYS_STAT_HAS_ST_MTIM         cmsys_STAT_HAS_ST_MTIM
# define KWSYS_CXX_HAS_CSTDDEF          cmsys_CXX_HAS_CSTDDEF
# define KWSYS_STL_STRING_HAVE_OSTREAM  cmsys_STL_STRING_HAVE_OSTREAM
# define KWSYS_STL_STRING_HAVE_ISTREAM  cmsys_STL_STRING_HAVE_ISTREAM
# define KWSYS_STL_STRING_HAVE_NEQ_CHAR cmsys_STL_STRING_HAVE_NEQ_CHAR
# define KWSYS_CXX_NULL_TEMPLATE_ARGS   cmsys_CXX_NULL_TEMPLATE_ARGS
# define KWSYS_CXX_HAS_MEMBER_TEMPLATES cmsys_CXX_HAS_MEMBER_TEMPLATES
# define KWSYS_CXX_HAS_FULL_SPECIALIZATION cmsys_CXX_HAS_FULL_SPECIALIZATION
# define KWSYS_CXX_DEFINE_SPECIALIZATION cmsys_CXX_DEFINE_SPECIALIZATION
# define KWSYS_CXX_DECL_TYPENAME        cmsys_CXX_DECL_TYPENAME
# define KWSYS_STL_HAS_ALLOCATOR_REBIND cmsys_STL_HAS_ALLOCATOR_REBIND
# define KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT cmsys_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT
# define KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP cmsys_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP
# define KWSYS_STL_HAS_ITERATOR_TRAITS cmsys_STL_HAS_ITERATOR_TRAITS
# define KWSYS_STL_HAS_ITERATOR_CATEGORY cmsys_STL_HAS_ITERATOR_CATEGORY
# define KWSYS_STL_HAS___ITERATOR_CATEGORY cmsys_STL_HAS___ITERATOR_CATEGORY
# define KWSYS_STL_HAS_ALLOCATOR_TEMPLATE cmsys_STL_HAS_ALLOCATOR_TEMPLATE
# define KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE cmsys_STL_HAS_ALLOCATOR_NONTEMPLATE
# define KWSYS_STL_HAS_ALLOCATOR_OBJECTS cmsys_STL_HAS_ALLOCATOR_OBJECTS
#endif

#endif

--- NEW FILE: Configure.h ---
/*
 * Generated by /cygdrive/c/hoffman/My Builds/CMake262/bootstrap
 * Version:     $Revision: 1.1 $
 *
 * Source directory: /cygdrive/c/hoffman/My Builds/CMake262
 * Binary directory: /cygdrive/c/hoffman/My Builds/CMake262-cygwin/Bootstrap.cmk
 *
 * C compiler:   cc
 * C flags:      
 *
 * C++ compiler: g++
 * C++ flags:    
 *
 * Make:         make
 *
 * Sources:
 *   cmake    cmakemain   cmakewizard    cmCommandArgumentLexer   cmCommandArgumentParser   cmCommandArgumentParserHelper   cmDepends   cmDependsC   cmDocumentationFormatter   cmDocumentationFormatterText   cmPolicies   cmProperty   cmPropertyMap   cmPropertyDefinition   cmPropertyDefinitionMap   cmMakeDepend   cmMakefile   cmExportFileGenerator   cmExportInstallFileGenerator   cmInstallDirectoryGenerator   cmGeneratedFileStream   cmGlobalGenerator   cmLocalGenerator   cmInstallGenerator   cmInstallExportGenerator   cmInstallFilesGenerator   cmInstallScriptGenerator   cmInstallTargetGenerator   cmSourceFile   cmSourceFileLocation   cmSystemTools   cmVersion   cmFileTimeComparison   cmGlobalUnixMakefileGenerator3   cmLocalUnixMakefileGenerator3   cmMakefileExecutableTargetGenerator   cmMakefileLibraryTargetGenerator   cmMakefileTargetGenerator   cmMakefileUtilityTargetGenerator   cmBootstrapCommands   cmCommands   cmTarget   cmTest   cmCustomCommand   cmDocumentVariables   cmCacheManager   cmListFileCache   cmComputeLinkDepends   cmComputeLinkInformation   cmOrderDirectories   cmComputeTargetDepends   cmComputeComponentGraph   cmExprLexer   cmExprParser   cmExprParserHelper    cmListFileLexer   
 * kwSys Sources:
 *   Directory   Glob   RegularExpression   SystemTools     ProcessUNIX     String     System 
 */

/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: Configure.h,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_Configure_h
#define cmsys_Configure_h

/* If we are building a kwsys .c or .cxx file, let it use the kwsys
   namespace.  When not building a kwsys source file these macros are
   temporarily defined inside the headers that use them.  */
#if defined(KWSYS_NAMESPACE)
# define kwsys_ns(x) cmsys##x
# define kwsysEXPORT cmsys_EXPORT
#endif

/* If we are building a kwsys .c or .cxx file, suppress the Microsoft
   deprecation warnings.  */
#if defined(KWSYS_NAMESPACE)
# ifndef _CRT_NONSTDC_NO_DEPRECATE
#  define _CRT_NONSTDC_NO_DEPRECATE
# endif
# ifndef _CRT_SECURE_NO_DEPRECATE
#  define _CRT_SECURE_NO_DEPRECATE
# endif
# ifndef _SCL_SECURE_NO_DEPRECATE
#  define _SCL_SECURE_NO_DEPRECATE
# endif
#endif

/* Whether Large File Support is requested.  */
#define cmsys_LFS_REQUESTED 0

/* Whether Large File Support is available.  */
#if cmsys_LFS_REQUESTED
# define cmsys_LFS_AVAILABLE 0
#endif

/* Setup Large File Support if requested.  */
#if cmsys_LFS_REQUESTED
  /* Since LFS is requested this header must be included before system
     headers whether or not LFS is available. */
# if 0 && (defined(_SYS_TYPES_H) || defined(_SYS_TYPES_INCLUDED))
#  error "cmsys/Configure.h must be included before sys/types.h"
# endif
  /* Enable the large file API if it is available.  */
# if cmsys_LFS_AVAILABLE && \
     !defined(cmsys_LFS_NO_DEFINES)
#  if !defined(_LARGEFILE_SOURCE) && \
      !defined(cmsys_LFS_NO_DEFINE_LARGEFILE_SOURCE)
#   define _LARGEFILE_SOURCE
#  endif
#  if !defined(_LARGEFILE64_SOURCE) && \
      !defined(cmsys_LFS_NO_DEFINE_LARGEFILE64_SOURCE)
#   define _LARGEFILE64_SOURCE
#  endif
#  if !defined(_LARGE_FILES) && \
      !defined(cmsys_LFS_NO_DEFINE_LARGE_FILES)
#   define _LARGE_FILES
#  endif
#  if !defined(_FILE_OFFSET_BITS) && \
      !defined(cmsys_LFS_NO_DEFINE_FILE_OFFSET_BITS)
#   define _FILE_OFFSET_BITS 64
#  endif
#  if 0 && (defined(_FILE_OFFSET_BITS) && _FILE_OFFSET_BITS < 64)
#   error "_FILE_OFFSET_BITS must be defined to at least 64"
#  endif
# endif
#endif

/* Setup the export macro.  */
#if defined(_WIN32) && 0
# if defined(cmsys_EXPORTS)
#  define cmsys_EXPORT __declspec(dllexport)
# else
#  define cmsys_EXPORT __declspec(dllimport)
# endif
#else
# define cmsys_EXPORT
#endif

/* Enable warnings that are off by default but are useful.  */
#if !defined(cmsys_NO_WARNING_ENABLE)
# if defined(_MSC_VER)
#  pragma warning ( default : 4263 ) /* no override, call convention differs */
# endif
#endif

/* Disable warnings that are on by default but occur in valid code.  */
#if !defined(cmsys_NO_WARNING_DISABLE)
# if defined(_MSC_VER)
#  pragma warning (disable: 4097) /* typedef is synonym for class */
#  pragma warning (disable: 4127) /* conditional expression is constant */
#  pragma warning (disable: 4244) /* possible loss in conversion */
#  pragma warning (disable: 4251) /* missing DLL-interface */
#  pragma warning (disable: 4305) /* truncation from type1 to type2 */
#  pragma warning (disable: 4309) /* truncation of constant value */
#  pragma warning (disable: 4514) /* unreferenced inline function */
#  pragma warning (disable: 4706) /* assignment in conditional expression */
#  pragma warning (disable: 4710) /* function not inlined */
#  pragma warning (disable: 4786) /* identifier truncated in debug info */
# endif
#endif

/* MSVC 6.0 in release mode will warn about code it produces with its
   optimizer.  Disable the warnings specifically for this
   configuration.  Real warnings will be revealed by a debug build or
   by other compilers.  */
#if !defined(cmsys_NO_WARNING_DISABLE_BOGUS)
# if defined(_MSC_VER) && (_MSC_VER < 1300) && defined(NDEBUG)
#  pragma warning ( disable : 4701 ) /* Variable may be used uninitialized.  */
#  pragma warning ( disable : 4702 ) /* Unreachable code.  */
# endif
#endif

#endif

--- NEW FILE: String.hxx ---
/*=========================================================================

  Program:   KWSys - Kitware System Library
  Module:    $RCSfile: String.hxx,v $

  Copyright (c) Kitware, Inc., Insight Consortium.  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notices for more information.

=========================================================================*/
#ifndef cmsys_String_hxx
#define cmsys_String_hxx

#include <cmsys/stl/string>

namespace cmsys
{

/** \class String
 * \brief Short-name version of the STL basic_string class template.
 *
 * The standard library "string" type is actually a typedef for
 * "basic_string<..long argument list..>".  This string class is
 * simply a subclass of this type with the same interface so that the
 * name is shorter in debugging symbols and error messages.
 */
class cmsys_EXPORT String: public cmsys_stl::string
{
  /** The original string type.  */
  typedef cmsys_stl::string stl_string;

public:

  /** String member types.  */
  typedef stl_string::value_type             value_type;
  typedef stl_string::pointer                pointer;
  typedef stl_string::reference              reference;
  typedef stl_string::const_reference        const_reference;
  typedef stl_string::size_type              size_type;
  typedef stl_string::difference_type        difference_type;
  typedef stl_string::iterator               iterator;
  typedef stl_string::const_iterator         const_iterator;
  typedef stl_string::reverse_iterator       reverse_iterator;
  typedef stl_string::const_reverse_iterator const_reverse_iterator;

  /** String constructors.  */
  String(): stl_string() {}
  String(const value_type* s): stl_string(s) {}
  String(const value_type* s, size_type n): stl_string(s, n) {}
  String(const stl_string& s, size_type pos=0, size_type n=npos):
    stl_string(s, pos, n) {}
}; // End Class: String

#if defined(__WATCOMC__)
inline bool operator<(String const& l, String const& r)
  {
  return (static_cast<cmsys_stl::string const&>(l) <
          static_cast<cmsys_stl::string const&>(r));
  }
#endif

} // namespace cmsys

#endif



More information about the Cmake-commits mailing list