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 srv
5///
6
7#pragma once
8
9#include <fstream>
10
11#include <nlohmann/json.hpp>
12
13#include "Server/Common.hpp"
14
15namespace srv
16{
17
18 using json = nlohmann::json;
19
21 {
22 bool exit = false;
27
28 static ArgsConfig fromFile(const std::string &path);
29 }; // struct Config
30 struct EnvConfig
31 {
32 };
33
34 ///
35 /// @class ArgsHandler
36 /// @brief Class to handle command line arguments
37 /// @namespace srv
38 ///
40 {
41
42 public:
43 ArgsHandler() = default;
44 ~ArgsHandler() = default;
45
46 ArgsHandler(const ArgsHandler &) = delete;
47 ArgsHandler &operator=(const ArgsHandler &) = delete;
50
51 static ArgsConfig ParseArgs(int argc, const char *const argv[]);
52 static EnvConfig ParseEnv(const char *const env[]);
53
54 private:
55 }; // class ArgsHandler
56
57} // namespace srv
Class to handle command line arguments.
ArgsHandler & operator=(const ArgsHandler &)=delete
ArgsHandler()=default
static EnvConfig ParseEnv(const char *const env[])
ArgsHandler(ArgsHandler &&)=delete
ArgsHandler & operator=(ArgsHandler &&)=delete
static ArgsConfig ParseArgs(int argc, const char *const argv[])
~ArgsHandler()=default
ArgsHandler(const ArgsHandler &)=delete
constexpr auto DEFAULT_NETWORK_PORT
Definition Common.hpp:24
constexpr auto DEFAULT_NETWORK_HOST
Definition Common.hpp:23
auto PLUGINS_NETWORK_ASIO_SERVER
Definition Common.hpp:34
auto PLUGINS_GAME_RTYPE_SERVER
Definition Common.hpp:36
nlohmann::json json
This file contains common definitions and constants.
static ArgsConfig fromFile(const std::string &path)
std::string network_lib_path
std::string game_lib_path
std::string host