summaryrefslogtreecommitdiffstats
path: root/Encoding.hxx.in
diff options
context:
space:
mode:
authorKWSys Robot <kwrobot@kitware.com>2013-12-19 15:01:48 (GMT)
committerBrad King <brad.king@kitware.com>2013-12-20 19:27:32 (GMT)
commit7aa3c2015f773d9b9433ca72242d03470c461c27 (patch)
tree486fdbd72875a7106009b16700a80064baffc634 /Encoding.hxx.in
parentf788d9a1b27efc9b463b1174a93e780bef00a5d9 (diff)
downloadCMake-7aa3c2015f773d9b9433ca72242d03470c461c27.zip
CMake-7aa3c2015f773d9b9433ca72242d03470c461c27.tar.gz
CMake-7aa3c2015f773d9b9433ca72242d03470c461c27.tar.bz2
KWSys 2013-12-19 (2426b57d)
Extract upstream KWSys using the following shell commands. $ git archive --prefix=upstream-kwsys/ 2426b57d | tar x $ git shortlog --no-merges --abbrev=8 --format='%h %s' 88165c5e..2426b57d Clinton Stimpson (1): 2426b57d Encoding: Add support for program arguments argc/argv. Change-Id: Id1fbc042a093b1de398753ffa16d4f9449e99423
Diffstat (limited to 'Encoding.hxx.in')
-rw-r--r--Encoding.hxx.in31
1 files changed, 31 insertions, 0 deletions
diff --git a/Encoding.hxx.in b/Encoding.hxx.in
index 60a4a8e..aba4175 100644
--- a/Encoding.hxx.in
+++ b/Encoding.hxx.in
@@ -14,6 +14,7 @@
#include <@KWSYS_NAMESPACE@/Configure.hxx>
#include <@KWSYS_NAMESPACE@/stl/string>
+#include <@KWSYS_NAMESPACE@/stl/vector>
/* Define these macros temporarily to keep the code readable. */
#if !defined (KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS
@@ -25,6 +26,36 @@ namespace @KWSYS_NAMESPACE@
class @KWSYS_NAMESPACE@_EXPORT Encoding
{
public:
+
+ // Container class for argc/argv.
+ class CommandLineArguments
+ {
+ public:
+ // On Windows, get the program command line arguments
+ // in this Encoding module's 8 bit encoding.
+ // On other platforms the given argc/argv is used, and
+ // to be consistent, should be the argc/argv from main().
+ static CommandLineArguments Main(int argc, char const* const* argv);
+
+ // Construct CommandLineArguments with the given
+ // argc/argv. It is assumed that the string is already
+ // in the encoding used by this module.
+ CommandLineArguments(int argc, char const* const* argv);
+
+ // Construct CommandLineArguments with the given
+ // argc and wide argv. This is useful if wmain() is used.
+ CommandLineArguments(int argc, wchar_t const* const* argv);
+ ~CommandLineArguments();
+ CommandLineArguments(const CommandLineArguments&);
+ CommandLineArguments& operator=(const CommandLineArguments&);
+
+ int argc() const;
+ char const* const* argv() const;
+
+ protected:
+ std::vector<char*> argv_;
+ };
+
/**
* Convert between char and wchar_t
*/