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-2018 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
17 // Parses command line arguments
18 /****************************************************************************/
19 #ifndef OptionsParser_h
20 #define OptionsParser_h
21 
22 
23 // ===========================================================================
24 // included modules
25 // ===========================================================================
26 #include <config.h>
27 
28 
29 // ===========================================================================
30 // class declarations
31 // ===========================================================================
32 class OptionsCont;
33 
34 
35 // ===========================================================================
36 // class definitions
37 // ===========================================================================
50 public:
59  static bool parse(int argc, char** argv);
60 
61 private:
70  static int check(const char* arg1, const char* arg2, bool& ok);
71 
72 
80  static bool checkParameter(const char* arg1);
81 
82 
90  static bool isAbbreviation(const char* arg1);
91 
92 
98  static std::string convert(const char* arg);
99 
100 
106  static std::string convert(char abbr);
107 
108 
118  static bool processNonBooleanSingleSwitch(OptionsCont& oc, const char* arg);
119 
120 
121 };
122 
123 
124 #endif
125 
126 /****************************************************************************/
127 
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:49
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:92
static std::string convert(const char *arg)
Converts char* to string.