28 #include "json/json.h"
29 #include "JSONLoaderPlugin.h"
33 #include <mxx/bcast.hpp>
45 std::vector<std::unique_ptr<JSONLoaderPlugin>>
plugins_;
68 Json::Value
LoadFile(
const std::string& filename,
const mxx::comm& world)
70 std::string contents, path;
77 mxx::bcast(contents, 0, world);
78 mxx::bcast(path, 0, world);
81 plugin->ApplyFilter(contents, path);
86 if(!reader.parse(contents, root))
87 throw std::invalid_argument(
88 filename +
": " + reader.getFormattedErrorMessages()
std::string GetFilePath(const std::string &str)
Gets file path from filename.
std::vector< std::unique_ptr< JSONLoaderPlugin > > plugins_
List of plugins.
Json::Value LoadFile(const std::string &filename, const mxx::comm &world)
Load file and return JSON tree.
Class for JSON loader include plugin.
std::string GetFileContents(const char *filename)
Read contents from a file.
Class for loading JSON content from files.