Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.h
Show First 20 Lines • Show All 176 Lines • ▼ Show 20 Lines | protected: | ||||
mutable RecursiveMutex cs_args; | mutable RecursiveMutex cs_args; | ||||
util::Settings m_settings GUARDED_BY(cs_args); | util::Settings m_settings GUARDED_BY(cs_args); | ||||
std::string m_network GUARDED_BY(cs_args); | std::string m_network GUARDED_BY(cs_args); | ||||
std::set<std::string> m_network_only_args GUARDED_BY(cs_args); | std::set<std::string> m_network_only_args GUARDED_BY(cs_args); | ||||
std::map<OptionsCategory, std::map<std::string, Arg>> | std::map<OptionsCategory, std::map<std::string, Arg>> | ||||
m_available_args GUARDED_BY(cs_args); | m_available_args GUARDED_BY(cs_args); | ||||
std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args); | std::list<SectionInfo> m_config_sections GUARDED_BY(cs_args); | ||||
mutable fs::path m_cached_datadir_path GUARDED_BY(cs_args); | |||||
mutable fs::path m_cached_network_datadir_path GUARDED_BY(cs_args); | |||||
NODISCARD bool ReadConfigStream(std::istream &stream, | NODISCARD bool ReadConfigStream(std::istream &stream, | ||||
const std::string &filepath, | const std::string &filepath, | ||||
std::string &error, | std::string &error, | ||||
bool ignore_invalid_keys = false); | bool ignore_invalid_keys = false); | ||||
/** | /** | ||||
* Returns true if settings values from the default section should be used, | * Returns true if settings values from the default section should be used, | ||||
Show All 40 Lines | public: | ||||
const std::set<std::string> GetUnsuitableSectionOnlyArgs() const; | const std::set<std::string> GetUnsuitableSectionOnlyArgs() const; | ||||
/** | /** | ||||
* Log warnings for unrecognized section names in the config file. | * Log warnings for unrecognized section names in the config file. | ||||
*/ | */ | ||||
const std::list<SectionInfo> GetUnrecognizedSections() const; | const std::list<SectionInfo> GetUnrecognizedSections() const; | ||||
/** | /** | ||||
* Get data directory path | |||||
* | |||||
* @param net_specific Append network identifier to the returned path | |||||
* @return Absolute path on success, otherwise an empty path when a | |||||
* non-directory path would be returned | |||||
* @post Returned directory path is created unless it is empty | |||||
*/ | |||||
const fs::path &GetDataDirPath(bool net_specific = true) const; | |||||
/** | |||||
* For testing | |||||
*/ | |||||
void ClearDatadirPathCache(); | |||||
/** | |||||
* Return a vector of strings of the given argument | * Return a vector of strings of the given argument | ||||
* | * | ||||
* @param strArg Argument to get (e.g. "-foo") | * @param strArg Argument to get (e.g. "-foo") | ||||
* @return command-line arguments | * @return command-line arguments | ||||
*/ | */ | ||||
std::vector<std::string> GetArgs(const std::string &strArg) const; | std::vector<std::string> GetArgs(const std::string &strArg) const; | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 253 Lines • Show Last 20 Lines |