00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef WIN32ARGPARSER_H
00016 #define WIN32ARGPARSER_H
00017
00018 #include "dtoolbase.h"
00019
00020 #ifdef _WIN32
00021
00022 #include "vector_string.h"
00023 #include "pvector.h"
00024
00025 #include <assert.h>
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_DTOOL Win32ArgParser {
00038 public:
00039 Win32ArgParser();
00040 ~Win32ArgParser();
00041
00042 void clear();
00043
00044 void set_command_line(const string &command_line);
00045 void set_command_line(const wstring &command_line);
00046 void set_system_command_line();
00047
00048 char **get_argv();
00049 int get_argc();
00050
00051 static bool do_glob();
00052
00053 private:
00054 string parse_quoted_arg(const char *&p);
00055 void parse_unquoted_arg(const char *&p);
00056 void save_arg(const string &arg);
00057
00058 typedef vector_string Args;
00059 Args _args;
00060
00061 char **_argv;
00062 int _argc;
00063 };
00064
00065 #endif // _WIN32
00066
00067 #endif