r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
ArgsHandler.hpp
Go to the documentation of this file.
1///
2/// @file ArgsHandler.hpp
3/// @brief This file contains the ArgsHandler class declaration
4/// @namespace cli
5///
6
7#pragma once
8
9#include <nlohmann/json.hpp>
10
11#include "Utils/Common.hpp"
12
13namespace cli
14{
15
16 using json = nlohmann::json;
17
36 struct EnvConfig
37 {
38 };
39
40 ///
41 /// @class ArgsHandler
42 /// @brief Class to handle command line arguments
43 /// @namespace cli
44 ///
46 {
47
48 public:
49 ArgsHandler() = default;
50 ~ArgsHandler() = default;
51
52 ArgsHandler(const ArgsHandler &) = delete;
53 ArgsHandler &operator=(const ArgsHandler &) = delete;
56
57 static ArgsConfig ParseArgs(int argc, const char *const argv[]);
58 static EnvConfig ParseEnv(const char *const env[]);
59
60 private:
61 }; // class ArgsHandler
62} // namespace cli
Class to handle command line arguments.
static ArgsConfig ParseArgs(int argc, const char *const argv[])
ArgsHandler(ArgsHandler &&)=delete
ArgsHandler(const ArgsHandler &)=delete
ArgsHandler & operator=(const ArgsHandler &)=delete
ArgsHandler()=default
static EnvConfig ParseEnv(const char *const env[])
ArgsHandler & operator=(ArgsHandler &&)=delete
~ArgsHandler()=default
This file contains common definitions and constants.
nlohmann::json json
constexpr auto DEFAULT_NETWORK_PORT
Definition Common.hpp:38
constexpr auto DEFAULT_NETWORK_HOST
Definition Common.hpp:37
constexpr auto DEFAULT_PLAYER_NAME
Definition Common.hpp:28
constexpr auto DEFAULT_WINDOW_FRAME_LIMIT
Definition Common.hpp:44
constexpr auto DEFAULT_WINDOW_WIDTH
Definition Common.hpp:42
constexpr auto DEFAULT_WINDOW_FULLSCREEN
Definition Common.hpp:45
constexpr auto DEFAULT_WINDOW_HEIGHT
Definition Common.hpp:43
auto PLUGIN_RENDERER_SFML
Definition Common.hpp:105
auto PLUGIN_NETWORK_ASIO_CLIENT
Definition Common.hpp:103
std::string game_multi_lib_path
unsigned int frameLimit
std::string host
std::string player_name
static ArgsConfig fromFile(const std::string &path)
std::string audio_lib_path
unsigned int height
unsigned int port
unsigned int width
std::string network_lib_path
std::string game_solo_lib_path
std::string renderer_lib_path