52 using Blob = std::vector<uint8_t>;
54 using StreamifyStack = std::stack<std::tuple<const Value *, unsigned int, unsigned int>>;
55 using StreamifyIterStack = std::stack<std::map<std::string, std::shared_ptr<Value>>::const_iterator>;
66 using Raw = std::vector<std::shared_ptr<Value>>;
72 [[nodiscard]]
size_t empty()
const;
73 [[nodiscard]]
size_t size()
const;
78 const std::shared_ptr<Value>
operator[](
size_t index)
const;
79 std::shared_ptr<Value>
operator[](
size_t index);
81 size_t erase(
const std::shared_ptr<Value> &value);
100 [[nodiscard]]
const std::shared_ptr<Value>
front()
const;
101 std::shared_ptr<Value>
front();
102 [[nodiscard]]
const std::shared_ptr<Value>
back()
const;
103 std::shared_ptr<Value>
back();
110 void append(
bool value) &;
112 void append(
double value) &;
113 void append(
const char *value) &;
116 void append(
const char *bytes,
size_t length) &;
126 List &&
append(
const char *bytes,
size_t length) &&;
140 using Raw = std::map<String, std::shared_ptr<Value>>;
155 [[nodiscard]]
bool empty()
const;
156 [[nodiscard]]
size_t size()
const;
176 [[nodiscard]]
const std::shared_ptr<Value>
find(
const String &key)
const;
177 std::shared_ptr<Value>
find(
const String &key);
185 void set(
const String &key,
bool value) &;
187 void set(
const String &key,
double value) &;
188 void set(
const String &key,
const char *value) &;
189 void set(
const String &key,
const char *value,
size_t length) &;
200 Dict &&
set(
const String &key,
const char *value,
size_t length) &&;
215 explicit Value(
bool value);
219 explicit Value(
double value);
221 explicit Value(
const char *value);
223 explicit Value(
const char *bytes,
size_t length);
238 [[nodiscard]]
bool isNull()
const;
239 [[nodiscard]]
bool isBool()
const;
240 [[nodiscard]]
bool isInt()
const;
241 [[nodiscard]]
bool isDouble()
const;
242 [[nodiscard]]
bool isString()
const;
243 [[nodiscard]]
bool isBlob()
const;
244 [[nodiscard]]
bool isList()
const;
245 [[nodiscard]]
bool isDict()
const;
249 [[nodiscard]] std::optional<bool>
getIfBool()
const;
252 [[nodiscard]] std::optional<Integer>
getIfInt()
const;
255 [[nodiscard]] std::optional<double>
getIfDouble()
const;
261 [[nodiscard]]
bool getBool()
const;
274 [[nodiscard]] std::
string toString() const noexcept;
275 void toString(text::StringBuilder &string_builder) const noexcept;
277 bool operator==(const
Value &rhs) const;
278 bool operator!=(const
Value &rhs) const;
281 static
void writeSpace(text::StringBuilder &string_builder,
size_t count);
283 text::StringBuilder &string_builder,
288 text::StringBuilder &string_builder,