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;
25 std::string network_lib_path;
26
27 static ArgsConfig fromFile(const std::string &path);
28 }; // struct Config
29 struct EnvConfig
30 {
31 };
32
33 ///
34 /// @class ArgsHandler
35 /// @brief Class to handle command line arguments
36 /// @namespace srv
37 ///
39 {
40
41 public:
42 ArgsHandler() = default;
43 ~ArgsHandler() = default;
44
45 ArgsHandler(const ArgsHandler &) = delete;
46 ArgsHandler &operator=(const ArgsHandler &) = delete;
49
50 static ArgsConfig ParseArgs(int argc, const char *const argv[]);
51 static EnvConfig ParseEnv(const char *const env[]);
52
53 private:
54 }; // class ArgsHandler
55
56} // 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
nlohmann::json json
This file contains common definitions and constants.
static ArgsConfig fromFile(const std::string &path)
std::string network_lib_path
std::string host