SUMO - Simulation of Urban MObility
OptionsParser.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
19 // Parses command line arguments
20 /****************************************************************************/
21 #ifndef OptionsParser_h
22 #define OptionsParser_h
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
34 
35 // ===========================================================================
36 // class declarations
37 // ===========================================================================
38 class OptionsCont;
39 
40 
41 // ===========================================================================
42 // class definitions
43 // ===========================================================================
56 public:
65  static bool parse(int argc, char** argv);
66 
67 private:
76  static int check(const char* arg1, const char* arg2, bool& ok);
77 
78 
86  static bool checkParameter(const char* arg1);
87 
88 
96  static bool isAbbreviation(const char* arg1);
97 
98 
104  static std::string convert(const char* arg);
105 
106 
112  static std::string convert(char abbr);
113 
114 
124  static bool processNonBooleanSingleSwitch(OptionsCont& oc, const char* arg);
125 
126 
127 };
128 
129 
130 #endif
131 
132 /****************************************************************************/
133 
static int check(const char *arg1, const char *arg2, bool &ok)
parses the previous arguments
static bool checkParameter(const char *arg1)
Returns the whether the given token is an option.
static bool processNonBooleanSingleSwitch(OptionsCont &oc, const char *arg)
Extracts the parameter directly attached to an option.
Parses command line arguments.
Definition: OptionsParser.h:55
static bool parse(int argc, char **argv)
Parses the given command line arguments.
static bool isAbbreviation(const char *arg1)
returns the whether the given token is an abbreviation
A storage for options typed value containers)
Definition: OptionsCont.h:98
static std::string convert(const char *arg)
Converts char* to string.