rapidjson::Document _doc

前端之家收集整理的这篇文章主要介绍了rapidjson::Document _doc前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
[cpp] view plain copy@H_502_5@
@H_502_5@
  1. <1>@H_502_5@@H_502_5@
  2. rapidjson::Document_doc;@H_502_5@
  3. @H_502_5@
  4. <2>@H_502_5@
  5. _doc.Parse<0>(_msg.c_str());@H_502_5@
  6. @H_502_5@
  7. <3>@H_502_5@
  8. template@H_502_5@<unsignedparseFlags>@H_502_5@@H_502_5@
  9. GenericDocument&Parse(const@H_502_5@Ch*str){@H_502_5@@H_502_5@
  10. RAPIDJSON_ASSERT(!(parseFlags&kParseInsituFlag));@H_502_5@
  11. GenericStringStream<Encoding>s(str);@H_502_5@
  12. return@H_502_5@ParseStream<parseFlags>(s);@H_502_5@@H_502_5@
  13. }@H_502_5@
  14. <4>@H_502_5@
  15. template@H_502_5@<@H_502_5@typename@H_502_5@Encoding>@H_502_5@@H_502_5@
  16. struct@H_502_5@GenericStringStream{@H_502_5@@H_502_5@
  17. typedef@H_502_5@@H_502_5@typename@H_502_5@Encoding::ChCh;@H_502_5@@H_502_5@
  18. GenericStringStream(const@H_502_5@Ch*src):src_(src),head_(src){}@H_502_5@@H_502_5@
  19. ChPeek()const@H_502_5@{@H_502_5@return@H_502_5@*src_;}@H_502_5@@H_502_5@
  20. ChTake(){return@H_502_5@*src_++;}@H_502_5@@H_502_5@
  21. size_t@H_502_5@Tell()@H_502_5@return@H_502_5@src_-head_;}@H_502_5@@H_502_5@
  22. Ch*PutBegin(){RAPIDJSON_ASSERT(false@H_502_5@);@H_502_5@return@H_502_5@0;}@H_502_5@@H_502_5@
  23. void@H_502_5@Put(Ch){RAPIDJSON_ASSERT(@H_502_5@false@H_502_5@);}@H_502_5@@H_502_5@
  24. size_t@H_502_5@PutEnd(Ch*){RAPIDJSON_ASSERT(@H_502_5@const@H_502_5@Ch*src_;@H_502_5@//!<Currentreadposition.@H_502_5@@H_502_5@@H_502_5@
  25. const@H_502_5@Ch*head_;@H_502_5@//!<Originalheadofthestring.@H_502_5@@H_502_5@@H_502_5@
  26. };@H_502_5@
  27. <5>@H_502_5@
  28. template@H_502_5@<unsignedparseFlags,@H_502_5@typename@H_502_5@Stream>@H_502_5@@H_502_5@
  29. GenericDocument&ParseStream(Stream&stream){@H_502_5@
  30. ValueType::SetNull();//Removeexistingrootifexist@H_502_5@@H_502_5@@H_502_5@
  31. GenericReader<Encoding,Allocator>reader;@H_502_5@
  32. if@H_502_5@(reader.@H_502_5@template@H_502_5@Parse<parseFlags>(stream,*@H_502_5@this@H_502_5@)){@H_502_5@@H_502_5@
  33. RAPIDJSON_ASSERT(stack_.GetSize()==sizeof@H_502_5@(ValueType));@H_502_5@//Gotoneandonlyonerootobject@H_502_5@@H_502_5@@H_502_5@
  34. this@H_502_5@->RawAssign(*stack_.@H_502_5@template@H_502_5@Pop<ValueType>(1));@H_502_5@//Addthis->topreventissue13.@H_502_5@@H_502_5@@H_502_5@
  35. parseError_=0;@H_502_5@
  36. errorOffset_=0;@H_502_5@
  37. }@H_502_5@
  38. else@H_502_5@{@H_502_5@@H_502_5@
  39. parseError_=reader.GetParseError();@H_502_5@
  40. errorOffset_=reader.GetErrorOffset();@H_502_5@
  41. ClearStack();@H_502_5@
  42. return@H_502_5@*@H_502_5@this@H_502_5@;@H_502_5@@H_502_5@
  43. } @H_502_5@
原文链接:https://www.f2er.com/json/289268.html

猜你在找的Json相关文章