Beispiel #1
0
static void convert_object(const json_object& value, string& path, datum& ret_datum) {
  size_t len = path.size();
  for (json_object::const_iterator it = value.begin(); it != value.end(); ++it) {
    const string& key = it->first;
    const json& val = it->second;
    path += '/';
    path += key;
    iter_convert(val, path, ret_datum);
    path.resize(len);
  }
}
Beispiel #2
0
pal::string_t deps_json_t::get_optional_path(
    const json_object& properties,
    const pal::string_t& key) const
{
    pal::string_t path;

    const auto& iter = properties.find(key);

    if (iter != properties.end())
    {
        path = iter->second.as_string();

        if (_X('/') != DIR_SEPARATOR)
        {
            replace_char(&path, _X('/'), DIR_SEPARATOR);
        }
    }

    return path;
}