Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
OptionsParser.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2024 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// ===========================================================================
29class OptionsCont;
30
31
32// ===========================================================================
33// class definitions
34// ===========================================================================
47public:
55 static bool parse(const std::vector<std::string>& args, const bool ignoreAppenders = false);
56
57private:
66 static int check(const std::string& arg1, const std::string* const arg2, bool& ok, const bool ignoreAppenders);
67
68
76 static bool checkParameter(const std::string& arg1);
77
78
88 static bool processNonBooleanSingleSwitch(OptionsCont& oc, const std::string& arg, const bool append);
89
90
91};
A storage for options typed value containers)
Definition OptionsCont.h:89
Parses command line arguments.
static bool parse(const std::vector< std::string > &args, const bool ignoreAppenders=false)
Parses the given command line arguments.
static int check(const std::string &arg1, const std::string *const arg2, bool &ok, const bool ignoreAppenders)
parses the previous arguments
static bool checkParameter(const std::string &arg1)
Returns the whether the given token is an option.
static bool processNonBooleanSingleSwitch(OptionsCont &oc, const std::string &arg, const bool append)
Extracts the parameter directly attached to an option.