simdjson  0.5.0
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 "simdjson/minify.h"
6 #include <memory>
7 #include <ostream>
8 
9 namespace simdjson {
10 namespace dom {
11 
12 class element;
13 
19 class document {
20 public:
26  document() noexcept = default;
27  ~document() noexcept = default;
28 
34  document(document &&other) noexcept = default;
36  document(const document &) = delete; // Disallow copying
42  document &operator=(document &&other) noexcept = default;
44  document &operator=(const document &) = delete; // Disallow copying
45 
49  element root() const noexcept;
50 
57  bool dump_raw_tape(std::ostream &os) const noexcept;
58 
60  std::unique_ptr<uint64_t[]> tape{};
61 
66  std::unique_ptr<uint8_t[]> string_buf{};
67 
68 private:
69  inline error_code allocate(size_t len) noexcept;
70  template<typename T>
71  friend class simdjson::minifier;
72  friend class parser;
73 }; // class document
74 
75 } // namespace dom
76 } // namespace simdjson
77 
78 #endif // SIMDJSON_DOM_DOCUMENT_H
simdjson::dom::document::document
document() noexcept=default
Create a document container with zero capacity.
simdjson::dom::element
A JSON element.
Definition: element.h:38
simdjson::dom::document
A parsed JSON document.
Definition: document.h:19
simdjson::dom::parser
A persistent document parser.
Definition: parser.h:36
simdjson::dom::document::operator=
document & operator=(document &&other) noexcept=default
Take another document's buffers.
simdjson::dom::document::root
element root() const noexcept
Get the root element of this document as a JSON array.
Definition: document-inl.h:19
simdjson::minifier
Minifies a JSON element or document, printing the smallest possible valid JSON.
Definition: minify.h:38