CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 #include <boost/filesystem.hpp>
27 namespace catapult {
namespace config {
31 typename TConfigurationLoader,
32 typename TConfiguration = std::invoke_result_t<TConfigurationLoader, const std::string&>
34 TConfiguration
LoadConfiguration(
const boost::filesystem::path& path, TConfigurationLoader loader) {
35 if (!boost::filesystem::exists(path)) {
36 auto message =
"aborting load due to missing configuration file";
41 std::cout <<
"loading configuration from " << path << std::endl;
42 return loader(path.generic_string());
46 template<
typename TConfiguration>
55 const boost::filesystem::path& path,
#define CATAPULT_THROW_EXCEPTION(EXCEPTION)
Macro used to throw a catapult exception.
Definition: exceptions.h:142
TConfiguration LoadIniConfiguration(const boost::filesystem::path &path)
Loads ini configuration from path.
Definition: ConfigurationFileLoader.h:47
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
std::vector< ionet::Node > LoadPeersConfiguration(const boost::filesystem::path &path, model::NetworkIdentifier networkIdentifier)
Loads peers configuration from path for network networkIdentifier.
Definition: ConfigurationFileLoader.h:54
catapult_error< std::runtime_error > catapult_runtime_error
Definition: exceptions.h:87
static ConfigurationBag FromPath(const std::string &path)
Loads a configuration bag from the specified path.
Definition: ConfigurationBag.cpp:45
NetworkIdentifier
Possible network identifiers.
Definition: NetworkInfo.h:45
std::vector< ionet::Node > LoadPeersFromPath(const std::string &path, model::NetworkIdentifier networkIdentifier)
Loads peers from the specified path for the network identified by networkIdentifier.
Definition: PeersConfiguration.cpp:106
Definition: AddressExtractionExtension.cpp:28
TConfiguration LoadConfiguration(const boost::filesystem::path &path, TConfigurationLoader loader)
Loads configuration from path using loader.
Definition: ConfigurationFileLoader.h:34