Adding another round of custom snow tiles, thanks to dexnim
[supertux.git] / src / supertux / command_line_arguments.hpp
1 //  SuperTux
2 //  Copyright (C) 2014 Ingo Ruhnke <grumbel@gmail.com>
3 //
4 //  This program is free software: you can redistribute it and/or modify
5 //  it under the terms of the GNU General Public License as published by
6 //  the Free Software Foundation, either version 3 of the License, or
7 //  (at your option) any later version.
8 //
9 //  This program is distributed in the hope that it will be useful,
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 //  GNU General Public License for more details.
13 //
14 //  You should have received a copy of the GNU General Public License
15 //  along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 #ifndef HEADER_SUPERTUX_SUPERTUX_OPTIONS_HPP
18 #define HEADER_SUPERTUX_SUPERTUX_OPTIONS_HPP
19
20 #include <boost/optional.hpp>
21
22 #include "math/size.hpp"
23 #include "util/log.hpp"
24 #include "video/video_system.hpp"
25
26 class Config;
27
28 /** Command line argument parsing */
29 class CommandLineArguments
30 {
31 public:
32   enum Action
33   {
34     NO_ACTION,
35     PRINT_VERSION,
36     PRINT_HELP,
37     PRINT_DATADIR
38   };
39
40 private:
41   Action m_action;
42   LogLevel m_log_level;
43
44 public:
45   boost::optional<std::string> datadir;
46   boost::optional<std::string> userdir;
47
48   boost::optional<Size> fullscreen_size;
49   boost::optional<int> fullscreen_refresh_rate;
50   boost::optional<Size> window_size;
51   boost::optional<Size> aspect_size;
52
53   // boost::optional<float> magnification;
54
55   boost::optional<bool> use_fullscreen;
56    boost::optional<VideoSystem::Enum> video;
57   // boost::optional<bool> try_vsync;
58   boost::optional<bool> show_fps;
59   boost::optional<bool> sound_enabled;
60   boost::optional<bool> music_enabled;
61   boost::optional<bool> console_enabled;
62
63   // boost::optional<int> random_seed;
64
65   boost::optional<std::string> start_level;
66   boost::optional<bool> enable_script_debugger;
67   boost::optional<std::string> start_demo;
68   boost::optional<std::string> record_demo;
69
70   boost::optional<bool> developer_mode;
71
72   // boost::optional<std::string> locale;
73
74 public:
75   CommandLineArguments();
76   ~CommandLineArguments();
77
78   Action get_action() const { return m_action; }
79   LogLevel get_log_level() const { return m_log_level; }
80
81   void parse_args(int argc, char** argv);
82
83   void print_help(const char* arg0);
84   void print_version();
85   void print_datadir();
86
87   void merge_into(Config& config);
88
89 private:
90   CommandLineArguments(const CommandLineArguments&) = delete;
91   CommandLineArguments& operator=(const CommandLineArguments&) = delete;
92 };
93
94 #endif
95
96 /* EOF */