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-2022 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials are made available under the
5 // terms of the Eclipse Public License 2.0 which is available at
6 // https://www.eclipse.org/legal/epl-2.0/
7 // This Source Code may also be made available under the following Secondary
8 // Licenses when the conditions for such availability set forth in the Eclipse
9 // Public License 2.0 are satisfied: GNU General Public License, version 2
10 // or later which is available at
11 // https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12 // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13 /****************************************************************************/
20 // Parses command line arguments
21 /****************************************************************************/
22 #pragma once
23 #include <config.h>
24 
25 
26 // ===========================================================================
27 // class declarations
28 // ===========================================================================
29 class OptionsCont;
30 
31 
32 // ===========================================================================
33 // class definitions
34 // ===========================================================================
47 public:
56  static bool parse(int argc, char** argv);
57 
58 private:
67  static int check(const char* arg1, const char* arg2, bool& ok);
68 
69 
77  static bool checkParameter(const char* arg1);
78 
79 
87  static bool isAbbreviation(const char* arg1);
88 
89 
95  static std::string convert(const char* arg);
96 
97 
103  static std::string convert(char abbr);
104 
105 
115  static bool processNonBooleanSingleSwitch(OptionsCont& oc, const char* arg);
116 
117 
118 };
A storage for options typed value containers)
Definition: OptionsCont.h:89
Parses command line arguments.
Definition: OptionsParser.h:46
static std::string convert(const char *arg)
Converts char* to string.
static int check(const char *arg1, const char *arg2, bool &ok)
parses the previous arguments
static bool isAbbreviation(const char *arg1)
returns the whether the given token is an abbreviation
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.
static bool parse(int argc, char **argv)
Parses the given command line arguments.