Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
ApiSettings.hpp
Go to the documentation of this file.
1#ifndef IV_SRC_MODEL_COMMS_APISETTINGS_HPP_
2#define IV_SRC_MODEL_COMMS_APISETTINGS_HPP_
3
5
6#include <memory>
7
9{
10
12{
13 struct ApiInfo
14 {
15 ApiInfo();
16 ApiInfo(const ApiInfo &other) = default;
17 ApiInfo(ApiInfo &&other) noexcept = default;
19
20 ApiInfo &operator=(const ApiInfo &other);
21 ApiInfo &operator=(ApiInfo &&other) noexcept;
22
23 bool load(const iv::file::xml::node &node);
24 bool save(iv::file::xml::node &node) const;
25
26 bool isEnabled {true};
28
30 {
31 static constexpr std::string_view ip {"127.0.0.1"};
32 static constexpr uint16_t port {16650};
33 };
34 };
35
36 Settings();
37 Settings(const Settings &other) = default;
38 Settings(Settings &&other) noexcept = default;
39
40 Settings &operator=(const Settings &other) = default;
41 Settings &operator=(Settings &&other) noexcept = default;
43
44 bool load(const iv::file::xml::node &node);
45 bool save(iv::file::xml::node &node) const;
46
47 std::vector<iv::model::comms::api::Settings::ApiInfo> apiURLs;
48
49private:
50 struct Keys
51 {
52 static constexpr std::string_view isEnabled {"Enabled"};
53 static constexpr std::string_view ipSettings {"IpSettings"};
54 };
55
56 struct Sections
57 {
58 static constexpr std::string_view apiURL {"ApiURL"};
59 };
60};
61
62}// namespace iv::model::comms::api
63
64#endif//IV_SRC_MODEL_COMMS_APISETTINGS_HPP_
Definition xmlFile.hpp:15
Definition ApiSettings.cpp:4
static constexpr uint16_t port
Definition ApiSettings.hpp:32
static constexpr std::string_view ip
Definition ApiSettings.hpp:31
Definition ApiSettings.hpp:14
ApiInfo & operator=(const ApiInfo &other)
Definition ApiSettings.cpp:14
ApiInfo(ApiInfo &&other) noexcept=default
bool save(iv::file::xml::node &node) const
Definition ApiSettings.cpp:44
ApiInfo()
Definition ApiSettings.cpp:6
iv::model::comms::net::IpSettings ipSettings
Definition ApiSettings.hpp:27
bool load(const iv::file::xml::node &node)
Definition ApiSettings.cpp:36
ApiInfo(const ApiInfo &other)=default
bool isEnabled
Definition ApiSettings.hpp:26
Definition ApiSettings.hpp:51
static constexpr std::string_view isEnabled
Definition ApiSettings.hpp:52
static constexpr std::string_view ipSettings
Definition ApiSettings.hpp:53
Definition ApiSettings.hpp:57
static constexpr std::string_view apiURL
Definition ApiSettings.hpp:58
Definition ApiSettings.hpp:12
Settings & operator=(const Settings &other)=default
Settings()
Definition ApiSettings.cpp:52
Settings(const Settings &other)=default
bool save(iv::file::xml::node &node) const
Definition ApiSettings.cpp:71
Settings & operator=(Settings &&other) noexcept=default
Settings(Settings &&other) noexcept=default
std::vector< iv::model::comms::api::Settings::ApiInfo > apiURLs
Definition ApiSettings.hpp:47
bool load(const iv::file::xml::node &node)
Definition ApiSettings.cpp:58
Definition IpSettings.hpp:17