rapidjsonドキュメントを比較しようとしていますが、修正方法がわからないというエラーメッセージが表示されます。rapidjsonドキュメントのエラーエラーを比較していません。operator []がこれらのオペランドと一致します。
これはrapidjsonです:
static const std::string& JSON()
{
static const std::string j =
"{"
"\"SimpleCompany:Manager\":{"
"\"read\":\"true\""
"\"update\":\"true\""
"\"delete\":\"true\""
"\"insert\":\"false\""
"},"
"\"SimpleCompany:Manager\":{"
"\"read\":\"true\""
"\"update\":\"true\""
"\"delete\":\"false\""
"\"insert\":\"false\""
"},"
"}";
return j;
}
私はおそらく同じ内容で二つの文書を比較してみてください場所です:正しくそれらの値を比較する方法を
rapidjson::StringStream strStream(JSON().c_str());
rapidjson::Document origDocument;
origDocument.ParseStream(strStream); //newDocument obtained other way
ASSERT_TRUE(newDocument["read"] == origDocument["read"]); //error no operator [] matches these operands
ASSERT_TRUE(strcmp(newDocument["read"] , origDocument["read"])); //error no operator [] matches these operands
const rapidjson::Value& a1 = newDocument["read"]; //error no operator [] matches these operands
任意のアイデア?私は2つの方法を試みたが、彼らは[。
マイルは、equality operatorがあると言います。私はrapidjson tutorialのようなものを比較しているようですが、キーを期待値と比較していますが、2つの文書のキーを比較して平等を判断しています。