本文整理汇总了C++中rapidjson::Value::Accept方法的典型用法代码示例。如果您正苦于以下问题:C++ Value::Accept方法的具体用法?C++ Value::Accept怎么用?C++ Value::Accept使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rapidjson::Value
的用法示例。
在下文中一共展示了Value::Accept方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: toJsonstring
void CMetadata::toJsonstring(rapidjson::Value& json, std::string& str)
{
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
json.Accept(writer);
str.assign(buffer.GetString(), buffer.Size());
}
示例2: writer
std::shared_ptr<std::string> JIMDBClient::toString(rapidjson::Value& data)
{
// Convert JSON document to string
rapidjson::StringBuffer strbuf;
rapidjson::Writer<rapidjson::StringBuffer> writer(strbuf);
data.Accept(writer);
return std::make_shared<std::string>(strbuf.GetString());
}
示例3: PrintJsonValue
void PrintJsonValue(const rapidjson::Value& value,
JsonOption opt,
std::ostream& out)
{
rapidjson::StringBuffer buffer;
if( (opt & JsonOption::PrettyPrint) == JsonOption::PrettyPrint )
{
rapidjson::PrettyWriter<rapidjson::StringBuffer> writer(buffer);
value.Accept(writer);
}
else
{
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
value.Accept(writer);
}
out << buffer.GetString();
}
示例4: writer
int Dynamo::Json2str(const rapidjson::Value &json, std::string& str) {
StringBuffer buffer;
Writer<StringBuffer> writer(buffer);
if (false == json.Accept(writer)) {
snprintf(lastErr, sizeof(lastErr), "Value::Accept failed");
return -1;
}
str.append(buffer.GetString(), buffer.GetSize());
return 0;
}
示例5: setCustomProps
void CustomGUIReader::setCustomProps(const std::string &classType, cocos2d::Ref *widget, const rapidjson::Value &customOptions)
{
if (_setPropsFunc != 0)
{
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
customOptions.Accept(writer);
auto stack = LuaEngine::getInstance()->getLuaStack();
stack->pushString(classType.c_str(), classType.size());
stack->pushObject(widget, "cc.Ref");
stack->pushString(buffer.GetString(), buffer.Size());
stack->executeFunctionByHandler(_setPropsFunc, 3);
}
}
示例6: parseField
Field SchemaHelper::parseField(const rapidjson::Value &data, int index)
{
Field field = std::make_shared<SchemaField>();
field->index = index;
field->name = getJSONString(data, "name");
field->type = getJSONString(data, "type");
field->geometry_type = getJSONString(data, "geometry_type");
field->nullable = getJSONBool(data, "nullable");
field->related_to = getJSONLong(data, "related_to", -1);
field->max_length = getJSONInt(data, "max_length", -1);
field->default_value = getJSONString(data, "default");
StringBuffer buffer;
PrettyWriter<StringBuffer> writer(buffer);
data.Accept(writer);
field->json = buffer.GetString();
if(field->name == "amigo_id")
{
field->unique = true;
}
return field;
}
示例7:
cocos2d::Value JsonUtils::json2Value(rapidjson::Value &json) {
JsonValueConverter converter;
json.Accept(converter);
return converter.getValue();
}
示例8: push
inline void push(lua_State* L, const rapidjson::Value& v)
{
ToLuaHandler handler(L);
v.Accept(handler);
}
示例9: RapidjsonSerialize
QString Util::RapidjsonSerialize(const rapidjson::Value &val) {
rapidjson::StringBuffer buffer;
rapidjson::Writer<rapidjson::StringBuffer> writer(buffer);
val.Accept(writer);
return buffer.GetString();
}