Eclipse 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-2019 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 /****************************************************************************/
16 // Parses command line arguments
17 /****************************************************************************/
18 #ifndef OptionsParser_h
19 #define OptionsParser_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 
28 // ===========================================================================
29 // class declarations
30 // ===========================================================================
31 class OptionsCont;
32 
33 
34 // ===========================================================================
35 // class definitions
36 // ===========================================================================
49 public:
58  static bool parse(int argc, char** argv);
59 
60 private:
69  static int check(const char* arg1, const char* arg2, bool& ok);
70 
71 
79  static bool checkParameter(const char* arg1);
80 
81 
89  static bool isAbbreviation(const char* arg1);
90 
91 
97  static std::string convert(const char* arg);
98 
99 
105  static std::string convert(char abbr);
106 
107 
117  static bool processNonBooleanSingleSwitch(OptionsCont& oc, const char* arg);
118 
119 
120 };
121 
122 
123 #endif
124 
125 /****************************************************************************/
126 
OptionsParser::processNonBooleanSingleSwitch
static bool processNonBooleanSingleSwitch(OptionsCont &oc, const char *arg)
Extracts the parameter directly attached to an option.
Definition: OptionsParser.cpp:118
OptionsParser
Parses command line arguments.
Definition: OptionsParser.h:48
OptionsParser::isAbbreviation
static bool isAbbreviation(const char *arg1)
returns the whether the given token is an abbreviation
Definition: OptionsParser.cpp:148
OptionsParser::check
static int check(const char *arg1, const char *arg2, bool &ok)
parses the previous arguments
Definition: OptionsParser.cpp:61
OptionsParser::parse
static bool parse(int argc, char **argv)
Parses the given command line arguments.
Definition: OptionsParser.cpp:38
OptionsCont
A storage for options typed value containers)
Definition: OptionsCont.h:89
OptionsParser::checkParameter
static bool checkParameter(const char *arg1)
Returns the whether the given token is an option.
Definition: OptionsParser.cpp:138
config.h
OptionsParser::convert
static std::string convert(const char *arg)
Converts char* to string.
Definition: OptionsParser.cpp:154