TARAXA
config_utils.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <cstdint>
4 #include <string>
5 #include <vector>
6 
7 namespace Json {
8 class Value;
9 } // namespace Json
10 
11 namespace taraxa {
12 std::string getConfigErr(const std::vector<std::string> &path);
13 
14 Json::Value getConfigData(Json::Value root, const std::vector<std::string> &path, bool optional = false);
15 
16 std::string getConfigDataAsString(const Json::Value &root, const std::vector<std::string> &path, bool optional = false,
17  std::string value = {});
18 
19 uint32_t getConfigDataAsUInt(const Json::Value &root, const std::vector<std::string> &path, bool optional = false,
20  uint32_t value = 0);
21 
22 uint64_t getConfigDataAsUInt64(const Json::Value &root, const std::vector<std::string> &path);
23 
24 bool getConfigDataAsBoolean(const Json::Value &root, const std::vector<std::string> &path, bool optional = false,
25  bool value = false);
26 
27 Json::Value getJsonFromFileOrString(const Json::Value &value);
28 
29 } // namespace taraxa
Definition: config_utils.hpp:7
Definition: config.hpp:8
uint32_t getConfigDataAsUInt(const Json::Value &root, const std::vector< std::string > &path, bool optional=false, uint32_t value=0)
Definition: config_utils.cpp:47
bool getConfigDataAsBoolean(const Json::Value &root, const std::vector< std::string > &path, bool optional=false, bool value=false)
Definition: config_utils.cpp:72
Json::Value getConfigData(Json::Value root, const std::vector< std::string > &path, bool optional=false)
Definition: config_utils.cpp:20
Json::Value getJsonFromFileOrString(const Json::Value &value)
Definition: config_utils.cpp:88
std::string getConfigDataAsString(const Json::Value &root, const std::vector< std::string > &path, bool optional=false, std::string value={})
Definition: config_utils.cpp:30
uint64_t getConfigDataAsUInt64(const Json::Value &root, const std::vector< std::string > &path)
Definition: config_utils.cpp:64
std::string getConfigErr(const std::vector< std::string > &path)
Definition: config_utils.cpp:13