simdjson  3.11.0
Ridiculously Fast JSON
document.h
1 #ifndef SIMDJSON_DOM_DOCUMENT_H
2 #define SIMDJSON_DOM_DOCUMENT_H
3 
4 #include "simdjson/dom/base.h"
5 
6 #include <memory>
7 
8 namespace simdjson {
9 namespace dom {
10 
16 class document {
17 public:
23  document() noexcept = default;
24  ~document() noexcept = default;
25 
31  document(document &&other) noexcept = default;
33  document(const document &) = delete; // Disallow copying
39  document &operator=(document &&other) noexcept = default;
41  document &operator=(const document &) = delete; // Disallow copying
42 
46  element root() const noexcept;
47 
54  bool dump_raw_tape(std::ostream &os) const noexcept;
55 
57  std::unique_ptr<uint64_t[]> tape{};
58 
63  std::unique_ptr<uint8_t[]> string_buf{};
75  error_code allocate(size_t len) noexcept;
80  size_t capacity() const noexcept;
81 
82 
83 private:
84  size_t allocated_capacity{0};
85  friend class parser;
86 }; // class document
87 
88 } // namespace dom
89 } // namespace simdjson
90 
91 #endif // SIMDJSON_DOM_DOCUMENT_H
A parsed JSON document.
Definition: document.h:16
document() noexcept=default
Create a document container with zero capacity.
element root() const noexcept
Get the root element of this document as a JSON array.
Definition: document-inl.h:20
A JSON element.
Definition: element.h:31
The top level simdjson namespace, containing everything the library provides.
Definition: base.h:8
error_code
All possible errors returned by simdjson.
Definition: error.h:19