simdjson  3.1.6
Ridiculously Fast JSON
document.h
1 #ifndef SIMDJSON_DOM_DOCUMENT_H
2 #define SIMDJSON_DOM_DOCUMENT_H
3 
4 #include "simdjson/common_defs.h"
5 #include <memory>
6 #include <ostream>
7 
8 namespace simdjson {
9 namespace dom {
10 
11 class element;
12 
18 class document {
19 public:
25  document() noexcept = default;
26  ~document() noexcept = default;
27 
33  document(document &&other) noexcept = default;
35  document(const document &) = delete; // Disallow copying
41  document &operator=(document &&other) noexcept = default;
43  document &operator=(const document &) = delete; // Disallow copying
44 
48  element root() const noexcept;
49 
56  bool dump_raw_tape(std::ostream &os) const noexcept;
57 
59  std::unique_ptr<uint64_t[]> tape{};
60 
65  std::unique_ptr<uint8_t[]> string_buf{};
77  error_code allocate(size_t len) noexcept;
82  size_t capacity() const noexcept;
83 
84 
85 private:
86  size_t allocated_capacity{0};
87  friend class parser;
88 }; // class document
89 
90 } // namespace dom
91 } // namespace simdjson
92 
93 #endif // SIMDJSON_DOM_DOCUMENT_H
A parsed JSON document.
Definition: document.h:18
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:19
A JSON element.
Definition: element.h:40
We want to support argument-dependent lookup (ADL).
error_code
All possible errors returned by simdjson.
Definition: error.h:17