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