1#include "games_storage_config.h"
2#include <boost/filesystem.hpp>
5namespace cavoke::server::model {
7GamesStorageConfig GamesStorageConfig::load(
const std::string &config_file) {
8 if (!boost::filesystem::exists(config_file) ||
9 !boost::filesystem::is_regular_file(config_file)) {
10 throw std::invalid_argument(
11 "No such game storage configuration file: " + config_file);
14 std::ifstream file(config_file);
15 json j = json::parse(file);
16 return j.get<GamesStorageConfig>();