国产亚洲精品福利在线无卡一,国产精久久一区二区三区,亚洲精品无码国模,精品久久久久久无码专区不卡

當(dāng)前位置: 首頁 > news >正文

恐怖音樂怎么做的視頻網(wǎng)站公司網(wǎng)絡(luò)營銷推廣方案

恐怖音樂怎么做的視頻網(wǎng)站,公司網(wǎng)絡(luò)營銷推廣方案,濟(jì)南網(wǎng)站建設(shè)行知科技不錯a,信陽疫情防控最新政策1.簡介 RapidJSON 是一個 C 的 JSON 解析庫,由騰訊開源。 支持 SAX 和 DOM 風(fēng)格的 API,并且可以解析、生成和查詢 JSON 數(shù)據(jù)。RapidJSON 快。它的性能可與strlen() 相比??芍С?SSE2/SSE4.2 加速。RapidJSON 獨立。它不依賴于 BOOST 等外部庫。它甚至…

1.簡介

RapidJSON 是一個 C++ 的 JSON 解析庫,由騰訊開源。

  • 支持 SAX 和 DOM 風(fēng)格的 API,并且可以解析、生成和查詢 JSON 數(shù)據(jù)。
  • RapidJSON 快。它的性能可與strlen() 相比。可支持 SSE2/SSE4.2 加速。
  • RapidJSON 獨立。它不依賴于 BOOST 等外部庫。它甚至不依賴于STL。
  • RapidJSON 對內(nèi)存友好。在大部分 32/64 位機(jī)器上,每個 JSON 值只占 16字節(jié)(除字符串外)。它預(yù)設(shè)使用一個快速的內(nèi)存分配器,令分析器可以緊湊地分配內(nèi)存。
  • RapidJSON 對 Unicode 友好。它支持UTF-8、UTF-16、UTF-32 (大端序/小端序),并內(nèi)部支持這些編碼的檢測、校驗及轉(zhuǎn)碼。例如,RapidJSON 可以在分析一個。
  • RapidJSON 是跨平臺的。

2.環(huán)境搭建

下載地址:https://github.com/Tencent/rapidjson/tree/v1.1.0
這里使用的版本1.1.0
在這里插入圖片描述
下載完成之后解壓目錄如下,將整個include目錄拷貝到我們的工程目錄下。

在這里插入圖片描述
拷貝完成之后如下圖所示:
在這里插入圖片描述
配置文件路徑。C/C++ ->常規(guī) ->附加包含目錄
在這里插入圖片描述

3.代碼示例

DOM接口示例

#include "rapidjson/document.h"     // rapidjson's DOM-style API
#include "rapidjson/prettywriter.h" // for stringify JSON
#include <iostream>using namespace rapidjson;int main()
{// 1. Parse a JSON text string to a document.const char json[] = " { \"hello\" : \"world\", \"t\" : true , \"f\" : false, \"n\": null, \"i\":123, \"pi\": 3.1416, \"a\":[1, 2, 3, 4] } ";printf("Original JSON:\n %s\n", json);Document document;  // Default template parameter uses UTF8 and MemoryPoolAllocator.// In-situ parsing, decode strings directly in the source string. Source must be string.char buffer[sizeof(json)];memcpy(buffer, json, sizeof(json));if (document.ParseInsitu(buffer).HasParseError())return 1;printf("\nParsing to document succeeded.\n");// 2. Access values in document. printf("\nAccess values in document:\n");assert(document.IsObject());    // Document is a JSON value represents the root of DOM. Root can be either an object or array.assert(document.HasMember("hello"));assert(document["hello"].IsString());printf("hello = %s\n", document["hello"].GetString());// Since version 0.2, you can use single lookup to check the existing of member and its value:Value::MemberIterator hello = document.FindMember("hello");assert(hello != document.MemberEnd());assert(hello->value.IsString());assert(strcmp("world", hello->value.GetString()) == 0);(void)hello;assert(document["t"].IsBool());     // JSON true/false are bool. Can also uses more specific function IsTrue().printf("t = %s\n", document["t"].GetBool() ? "true" : "false");assert(document["f"].IsBool());printf("f = %s\n", document["f"].GetBool() ? "true" : "false");printf("n = %s\n", document["n"].IsNull() ? "null" : "?");assert(document["i"].IsNumber());   // Number is a JSON type, but C++ needs more specific type.assert(document["i"].IsInt());      // In this case, IsUint()/IsInt64()/IsUint64() also return true.printf("i = %d\n", document["i"].GetInt()); // Alternative (int)document["i"]assert(document["pi"].IsNumber());assert(document["pi"].IsDouble());printf("pi = %g\n", document["pi"].GetDouble());{const Value& a = document["a"]; // Using a reference for consecutive access is handy and faster.assert(a.IsArray());for (SizeType i = 0; i < a.Size(); i++) // rapidjson uses SizeType instead of size_t.printf("a[%d] = %d\n", i, a[i].GetInt());int y = a[0].GetInt();(void)y;// Iterating array with iteratorsprintf("a = ");for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr)printf("%d ", itr->GetInt());printf("\n");}// Iterating object membersstatic const char* kTypeNames[] = { "Null", "False", "True", "Object", "Array", "String", "Number" };for (Value::ConstMemberIterator itr = document.MemberBegin(); itr != document.MemberEnd(); ++itr)printf("Type of member %s is %s\n", itr->name.GetString(), kTypeNames[itr->value.GetType()]);// 3. Modify values in document.// Change i to a bigger number{uint64_t f20 = 1;   // compute factorial of 20for (uint64_t j = 1; j <= 20; j++)f20 *= j;document["i"] = f20;    // Alternate form: document["i"].SetUint64(f20)assert(!document["i"].IsInt()); // No longer can be cast as int or uint.}// Adding values to array.{Value& a = document["a"];   // This time we uses non-const reference.Document::AllocatorType& allocator = document.GetAllocator();for (int i = 5; i <= 10; i++)a.PushBack(i, allocator);   // May look a bit strange, allocator is needed for potentially realloc. We normally uses the document's.// Fluent APIa.PushBack("Lua", allocator).PushBack("Mio", allocator);}// Making string values.// This version of SetString() just store the pointer to the string.// So it is for literal and string that exists within value's life-cycle.{document["hello"] = "rapidjson";    // This will invoke strlen()// Faster version:// document["hello"].SetString("rapidjson", 9);}// This version of SetString() needs an allocator, which means it will allocate a new buffer and copy the the string into the buffer.Value author;{char buffer2[10];int len = sprintf(buffer2, "%s %s", "Milo", "Yip");  // synthetic example of dynamically created string.author.SetString(buffer2, static_cast<SizeType>(len), document.GetAllocator());// Shorter but slower version:// document["hello"].SetString(buffer, document.GetAllocator());// Constructor version: // Value author(buffer, len, document.GetAllocator());// Value author(buffer, document.GetAllocator());memset(buffer2, 0, sizeof(buffer2)); // For demonstration purpose.}// Variable 'buffer' is unusable now but 'author' has already made a copy.document.AddMember("author", author, document.GetAllocator());assert(author.IsNull());        // Move semantic for assignment. After this variable is assigned as a member, the variable becomes null.// 4. Stringify JSONprintf("\nModified JSON with reformatting:\n");StringBuffer sb;PrettyWriter<StringBuffer> writer(sb);document.Accept(writer);    // Accept() traverses the DOM and generates Handler events.puts(sb.GetString());return 0;
}

運行結(jié)果:
在這里插入圖片描述
SAX接口示例:

#include "rapidjson/document.h"     // rapidjson's DOM-style API
#include "rapidjson/prettywriter.h" // for stringify JSON
#include "rapidjson/reader.h"
#include "rapidjson/error/en.h"
#include <iostream>
#include <string>
#include <map>using namespace std;
using namespace rapidjson;typedef map<string, string> MessageMap;#if defined(__GNUC__)
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(effc++)
#endif#ifdef __clang__
RAPIDJSON_DIAG_PUSH
RAPIDJSON_DIAG_OFF(switch - enum)
#endifstruct MessageHandler : public BaseReaderHandler<UTF8<>, MessageHandler>
{MessageHandler() : messages_(), state_(kExpectObjectStart), name_() {}bool StartObject() {switch (state_) {case kExpectObjectStart:state_ = kExpectNameOrObjectEnd;return true;default:return false;}}bool String(const char* str, SizeType length, bool){switch (state_) {case kExpectNameOrObjectEnd:name_ = string(str, length);state_ = kExpectValue;return true;case kExpectValue:messages_.insert(MessageMap::value_type(name_, string(str, length)));state_ = kExpectNameOrObjectEnd;return true;default:return false;}}bool EndObject(SizeType) { return state_ == kExpectNameOrObjectEnd; }bool Default() { return false; } // All other events are invalid.MessageMap messages_;enum State{kExpectObjectStart,kExpectNameOrObjectEnd,kExpectValue}state_;std::string name_;
};#if defined(__GNUC__)
RAPIDJSON_DIAG_POP
#endif#ifdef __clang__
RAPIDJSON_DIAG_POP
#endifstatic void ParseMessages(const char* json, MessageMap& messages)
{Reader reader;MessageHandler handler;StringStream ss(json);if (reader.Parse(ss, handler))messages.swap(handler.messages_);   // Only change it if success.else {ParseErrorCode e = reader.GetParseErrorCode();size_t o = reader.GetErrorOffset();cout << "Error: " << GetParseError_En(e) << endl;;cout << " at offset " << o << " near '" << string(json).substr(o, 10) << "...'" << endl;}
}int main()
{MessageMap messages;const char* json1 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\" }";cout << json1 << endl;ParseMessages(json1, messages);for (MessageMap::const_iterator itr = messages.begin(); itr != messages.end(); ++itr)cout << itr->first << ": " << itr->second << endl;cout << endl << "Parse a JSON with invalid schema." << endl;const char* json2 = "{ \"greeting\" : \"Hello!\", \"farewell\" : \"bye-bye!\", \"foo\" : {} }";cout << json2 << endl;ParseMessages(json2, messages);return 0;
}

在這里插入圖片描述

4.更多參考

libVLC 專欄介紹-CSDN博客

Qt+FFmpeg+opengl從零制作視頻播放器-1.項目介紹_qt opengl視頻播放器-CSDN博客

QCharts -1.概述-CSDN博客

http://m.aloenet.com.cn/news/28233.html

相關(guān)文章:

  • 電商網(wǎng)站開發(fā)教材唐山seo
  • 學(xué)院網(wǎng)站建設(shè)管理規(guī)章制度谷歌瀏覽器官網(wǎng)入口
  • 網(wǎng)站開發(fā)功能需求表下載班級優(yōu)化大師并安裝
  • 煙臺中企動力提供網(wǎng)站建設(shè)游戲推廣論壇
  • 做設(shè)計的都用那些網(wǎng)站seo基礎(chǔ)知識
  • 推廣型網(wǎng)站建設(shè)電話百度開戶需要什么資質(zhì)
  • 漯河企業(yè)網(wǎng)站建設(shè)公司軟文廣告示范
  • 英文書 影印版 網(wǎng)站開發(fā)廈門人才網(wǎng)個人會員
  • 中國那個公司的網(wǎng)站做的最好看有什么平臺可以推廣
  • 菏澤建設(shè)局網(wǎng)站網(wǎng)絡(luò)視頻營銷平臺
  • 招商加盟類網(wǎng)站模板網(wǎng)站建設(shè)費用
  • 手機(jī)做網(wǎng)站用什么軟件灰色詞排名推廣
  • 微小店網(wǎng)站建設(shè)平臺網(wǎng)絡(luò)營銷推廣方案策劃
  • 做網(wǎng)站的要花多少錢推廣普通話作文
  • 低價網(wǎng)站建設(shè)行業(yè)現(xiàn)狀win10優(yōu)化軟件哪個好
  • 徐州網(wǎng)站優(yōu)化品牌宣傳如何做
  • 建站需要哪些東西武漢網(wǎng)絡(luò)營銷推廣
  • 住房和城鄉(xiāng)建設(shè)廳網(wǎng)站辦事大廳百度小程序?qū)W(wǎng)站seo
  • 網(wǎng)站空間購買長沙關(guān)鍵詞優(yōu)化方法
  • 雄安網(wǎng)站建設(shè)公司百度純凈版首頁入口
  • 朝陽周邊網(wǎng)站建設(shè)對seo的認(rèn)識和理解
  • 怎么上傳網(wǎng)站地圖seo外包公司哪家專業(yè)
  • 自己做網(wǎng)站要會什么軟件怎么弄屬于自己的網(wǎng)站
  • 科技網(wǎng)站設(shè)計公司有哪些北京外貿(mào)網(wǎng)站優(yōu)化
  • 播視頻網(wǎng)站開發(fā)seo是什么意思中文
  • 有關(guān)網(wǎng)站開發(fā)的書籍網(wǎng)址域名大全2345網(wǎng)址
  • 個人網(wǎng)站做淘寶客如何備案搜索引擎排名原理
  • 做簡歷的網(wǎng)站叫什么軟件seo免費診斷聯(lián)系方式
  • 網(wǎng)站一般怎么推廣百度互聯(lián)網(wǎng)營銷是什么
  • 鹽城網(wǎng)站建設(shè)報價廣州市疫情最新