本文整理汇总了C++中rapidjson::Document::RemoveMember方法的典型用法代码示例。如果您正苦于以下问题:C++ Document::RemoveMember方法的具体用法?C++ Document::RemoveMember怎么用?C++ Document::RemoveMember使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rapidjson::Document
的用法示例。
在下文中一共展示了Document::RemoveMember方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cbJsonMessage
void FCServer::cbJsonMessage(libwebsocket *wsi, rapidjson::Document &message, void *context)
{
// Received a JSON message from a WebSockets client.
// Replies are formed by modifying the original message.
FCServer *self = (FCServer*) context;
const Value &vtype = message["type"];
if (!vtype.IsString()) {
lwsl_notice("NOTICE: Received JSON is missing mandatory \"type\" string\n");
return;
}
const char *type = vtype.GetString();
// Hold the event lock while dispatching
self->mEventMutex.lock();
if (!strcmp(type, "list_connected_devices")) {
self->jsonListConnectedDevices(message);
} else if (!strcmp(type, "server_info")) {
self->jsonServerInfo(message);
} else if (message.HasMember("device")) {
self->jsonDeviceMessage(message);
} else {
message.AddMember("error", "Unknown message type", message.GetAllocator());
}
self->mEventMutex.unlock();
// Remove heavyweight members we should never reply with
message.RemoveMember("pixels");
// All messages get a reply, and we leave any extra parameters on the message
// so that clients can keep track of asynchronous completions.
self->mNetServer.jsonReply(wsi, message);
}