SUMO - Simulation of Urban MObility
OptionsIO.h
Go to the documentation of this file.
1 /****************************************************************************/
8 // Helper for parsing command line arguments and reading configuration files
9 /****************************************************************************/
10 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
11 // Copyright (C) 2001-2017 DLR (http://www.dlr.de/) and contributors
12 /****************************************************************************/
13 //
14 // This file is part of SUMO.
15 // SUMO is free software: you can redistribute it and/or modify
16 // it under the terms of the GNU General Public License as published by
17 // the Free Software Foundation, either version 3 of the License, or
18 // (at your option) any later version.
19 //
20 /****************************************************************************/
21 #ifndef OptionsIO_h
22 #define OptionsIO_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 #include <vector>
35 #include <string>
37 
38 
39 // ===========================================================================
40 // class declarations
41 // ===========================================================================
42 class OptionsCont;
43 
44 
45 // ===========================================================================
46 // class definitions
47 // ===========================================================================
56 class OptionsIO {
57 public:
63  static void setArgs(int argc, char** argv);
64 
69  static void setArgs(const std::vector<std::string>& args);
70 
73  static int getArgC() {
74  return myArgC;
75  }
76 
77 
90  static void getOptions(const bool commandLineOnly = false);
91 
92 
99  static void loadConfiguration();
100 
101 
102 private:
108  static std::string getRoot(const std::string& filename);
109 
110 
111 private:
112  static int myArgC;
113  static char** myArgV;
114 
115 };
116 
117 
118 #endif
119 
120 /****************************************************************************/
121 
static void getOptions(const bool commandLineOnly=false)
Parses the command line arguments and loads the configuration.
Definition: OptionsIO.cpp:82
static char ** myArgV
Definition: OptionsIO.h:113
static void setArgs(int argc, char **argv)
Stores the command line arguments for later parsing.
Definition: OptionsIO.cpp:62
static void loadConfiguration()
Loads and parses the configuration.
Definition: OptionsIO.cpp:108
static int myArgC
Definition: OptionsIO.h:112
static int getArgC()
Return the number of command line arguments.
Definition: OptionsIO.h:73
A storage for options typed value containers)
Definition: OptionsCont.h:99
static std::string getRoot(const std::string &filename)
Retrieves the XML root element of a supposed configuration or net.
Definition: OptionsIO.cpp:141