Merge pull request #62 from aliyun/fix_jsoncpp_version_old

fix read json by jsoncpp
This commit is contained in:
宋神宗
2019-08-15 10:10:04 +08:00
committed by GitHub
2 changed files with 0 additions and 17 deletions

View File

@@ -36,7 +36,6 @@ std::string
canonicalizedQuery(const std::map<std::string, std::string> &params);
std::string canonicalizedHeaders(const HttpMessage::HeaderCollection &headers);
std::string GetEnv(const std::string env);
Json::Value ReadJson(const std::string str);
std::string MapToJson(const std::map<std::string, std::string> &maps);
std::map<std::string, std::string> JsonToMap(const std::string &json);
} // namespace AlibabaCloud

View File

@@ -203,22 +203,6 @@ std::string AlibabaCloud::canonicalizedHeaders(
return ss.str();
}
Json::Value AlibabaCloud::ReadJson(const std::string str)
{
Json::CharReaderBuilder builder;
Json::CharReader *reader = builder.newCharReader();
Json::Value *val;
Json::Value value;
JSONCPP_STRING *errs;
reader->parse(str.data(), str.data() + str.size(), val, errs);
if (errs == NULL)
{
value = *val;
return value;
}
throw errs;
}
std::string AlibabaCloud::GetEnv(const std::string env)
{
#ifdef _WIN32