Example #1
0
void loadFromKVStoreWithJsonFile(const std::string& kvfile,
                                 const std::string& jsonfile,
                                 Cargo& visitable,
                                 const std::string& kvVisitableName)
{
    std::string content;
    if (!internals::fsutils::readFileContent(jsonfile, content)) {
        throw CargoException("Could not load " + jsonfile);
    }
    try {
        loadFromKVStoreWithJson(kvfile, content, visitable, kvVisitableName);
    } catch (CargoException& e) {
        throw CargoException("Error in " + jsonfile + ": " + e.what());
    }
}
Example #2
0
void loadFromKVStoreWithJsonFile(const std::string& kvfile,
                                 const std::string& jsonfile,
                                 Config& config,
                                 const std::string& kvConfigName)
{
    std::string content;
    if (!fsutils::readFileContent(jsonfile, content)) {
        throw ConfigException("Could not load " + jsonfile);
    }
    try {
        loadFromKVStoreWithJson(kvfile, content, config, kvConfigName);
    } catch (ConfigException& e) {
        throw ConfigException("Error in " + jsonfile + ": " + e.what());
    }
}