diff --git a/docs/html/ConfigHandler_8cpp.html b/docs/html/ConfigHandler_8cpp.html index 6d0711f..7d3c598 100644 --- a/docs/html/ConfigHandler_8cpp.html +++ b/docs/html/ConfigHandler_8cpp.html @@ -5,7 +5,7 @@ -VirtualJukebox: src/ConfigHandler.cpp File Reference +VirtualJukebox: src/Utils/ConfigHandler.cpp File Reference @@ -61,7 +61,7 @@
@@ -70,12 +70,12 @@
-

Class ConfigHandler implementation. +

Class ConfigHandler implementation. More...

-
#include "ConfigHandler.h"
+
#include "Utils/ConfigHandler.h"
#include <string>

Detailed Description

-

Class ConfigHandler implementation.

+
diff --git a/docs/html/ConfigHandler_8h.html b/docs/html/ConfigHandler_8h.html index e0e63a7..5257680 100644 --- a/docs/html/ConfigHandler_8h.html +++ b/docs/html/ConfigHandler_8h.html @@ -5,7 +5,7 @@ -VirtualJukebox: src/ConfigHandler.h File Reference +VirtualJukebox: src/Utils/ConfigHandler.h File Reference @@ -61,7 +61,7 @@
@@ -72,23 +72,24 @@
-

Class ConfigHandler definition. +

Class ConfigHandler definition. More...

#include <stdlib.h>
#include <memory>
#include <string>
#include "../lib/SimpleIni/SimpleIni.h"
-#include "Result.h"
+#include "Types/Result.h"

Go to the source code of this file.

+

Classes

class  ConfigHandler
 Singleton class which provides shared access to the configuration file used. More...
 

Detailed Description

- diff --git a/docs/html/ConfigHandler_8h_source.html b/docs/html/ConfigHandler_8h_source.html index 86f7d01..8de1c02 100644 --- a/docs/html/ConfigHandler_8h_source.html +++ b/docs/html/ConfigHandler_8h_source.html @@ -5,7 +5,7 @@ -VirtualJukebox: src/ConfigHandler.h Source File +VirtualJukebox: src/Utils/ConfigHandler.h Source File @@ -61,7 +61,7 @@
@@ -81,38 +81,40 @@
15 #include <string>
16 
17 #include "../lib/SimpleIni/SimpleIni.h"
-
18 #include "Result.h"
+
18 #include "Types/Result.h"
19 
- -
21  public:
-
22  ~ConfigHandler() = default;
-
23  static std::shared_ptr<ConfigHandler> const getInstance();
-
24 
-
25  TResultOpt setConfigFilePath(std::string const& filepath);
-
26  TResult<std::string> getValueString(std::string const& section,
-
27  std::string const& key);
-
28  TResult<int> getValueInt(std::string const& section, std::string const& key);
-
29 
-
30  private:
-
31  ConfigHandler() = default; // hide default ctor
-
32  ConfigHandler(ConfigHandler const&) = delete; // delete copy ctor
-
33  ConfigHandler& operator=(ConfigHandler const&) = delete; // assignment ctor
+ +
25  public:
+
26  ~ConfigHandler() = default;
+
27  static std::shared_ptr<ConfigHandler> const getInstance();
+
28 
+
29  TResultOpt setConfigFilePath(std::string const& filepath);
+
30  TResult<std::string> getValueString(std::string const& section,
+
31  std::string const& key);
+
32  TResult<int> getValueInt(std::string const& section, std::string const& key);
+
33  bool isInitialized();
34 
-
35  static std::shared_ptr<ConfigHandler> mInstance;
-
36  std::string mConfigFilePath;
-
37 
-
38  CSimpleIniA mIni;
-
39 };
-
40 
-
41 #endif /* _CONFIGHANDLER_H_ */
+
35  private:
+
36  ConfigHandler() = default; // hide default ctor
+
37  ConfigHandler(ConfigHandler const&) = delete; // delete copy ctor
+
38  ConfigHandler& operator=(ConfigHandler const&) = delete; // assignment ctor
+
39 
+
40  static std::shared_ptr<ConfigHandler> mInstance;
+
41  std::string mConfigFilePath;
+
42 
+
43  CSimpleIniA mIni;
+
44  bool mIsInitialized = false;
+
45 };
+
46 
+
47 #endif /* _CONFIGHANDLER_H_ */
-
ConfigHandler
Definition: ConfigHandler.h:20
-
ConfigHandler::getValueString
TResult< std::string > getValueString(std::string const &section, std::string const &key)
Returns value of a key as a string.
Definition: ConfigHandler.cpp:42
+
ConfigHandler
Singleton class which provides shared access to the configuration file used.
Definition: ConfigHandler.h:24
+
ConfigHandler::getValueString
TResult< std::string > getValueString(std::string const &section, std::string const &key)
Returns value of a key as a string.
Definition: ConfigHandler.cpp:45
Result.h
Defines function return values and types.
-
TResultOpt
std::optional< Error > TResultOpt
Used as an optional return type of functions.
Definition: Result.h:69
-
TResult
std::variant< GOOD_TYPE, Error > TResult
Used as return type of functions.
Definition: Result.h:59
+
TResultOpt
std::optional< Error > TResultOpt
Used as an optional return type of functions.
Definition: Result.h:85
+
TResult
std::variant< GOOD_TYPE, Error > TResult
Used as return type of functions.
Definition: Result.h:75
ConfigHandler::setConfigFilePath
TResultOpt setConfigFilePath(std::string const &filepath)
Configures file path to *.ini file, configures the SimpleIni reader and loads the ini-file.
Definition: ConfigHandler.cpp:27
-
ConfigHandler::getValueInt
TResult< int > getValueInt(std::string const &section, std::string const &key)
Returns value of a key as integer.
Definition: ConfigHandler.cpp:62
+
ConfigHandler::getValueInt
TResult< int > getValueInt(std::string const &section, std::string const &key)
Returns value of a key as integer.
Definition: ConfigHandler.cpp:70