fix read json by jsoncpp
This commit is contained in:
@@ -36,7 +36,6 @@ std::string
|
||||
canonicalizedQuery(const std::map<std::string, std::string> ¶ms);
|
||||
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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user