14 if (abi_path.is_relative()) {
15 abi_path = data_dir / abi_path;
21 }
SYS_RETHROW_EXCEPTIONS(chain::json_parse_exception,
"Fail to parse JSON from file: ${file}", (
"file", abi_path.generic_string()));
28 std::pair<std::string, std::string>
parse_kv_pairs(
const std::string& input ) {
29 SYS_ASSERT(!input.empty(), chain::plugin_config_exception,
"Key-Value Pair is Empty");
30 auto delim = input.find(
"=");
31 SYS_ASSERT(delim != std::string::npos, chain::plugin_config_exception,
"Missing \"=\"");
32 SYS_ASSERT(delim != 0, chain::plugin_config_exception,
"Missing Key");
33 SYS_ASSERT(delim + 1 != input.size(), chain::plugin_config_exception,
"Missing Value");
34 return std::make_pair(input.substr(0, delim), input.substr(delim + 1));
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
#define SYS_RETHROW_EXCEPTIONS(exception_type, FORMAT,...)
static variant from_file(const fc::path &p, const parse_type ptype=parse_type::legacy_parser, const uint32_t max_depth=DEFAULT_MAX_RECURSION_DEPTH)
wraps boost::filesystem::path to provide platform independent path manipulation.
stores null, int64, uint64, double, bool, string, std::vector<variant>, and variant_object's.
bool exists(const path &p)
bool is_directory(const path &p)
void from_variant(const fc::variant &v, sysio::chain::chain_id_type &cid)
std::pair< std::string, std::string > parse_kv_pairs(const std::string &input)
chain::abi_def abi_def_from_file(const std::string &file_name, const fc::path &data_dir)