/src/duckdb/third_party/yyjson/include/yyjson_utils.hpp
Line | Count | Source |
1 | | //===----------------------------------------------------------------------===// |
2 | | // DuckDB |
3 | | // |
4 | | // yyjson_utils.hpp |
5 | | // |
6 | | // |
7 | | //===----------------------------------------------------------------------===// |
8 | | |
9 | | #pragma once |
10 | | |
11 | | #include "yyjson.hpp" |
12 | | |
13 | | using namespace duckdb_yyjson; // NOLINT |
14 | | |
15 | | namespace duckdb { |
16 | | |
17 | | struct ConvertedJSONHolder { |
18 | | public: |
19 | 0 | ~ConvertedJSONHolder() { |
20 | 0 | if (doc) { |
21 | 0 | yyjson_mut_doc_free(doc); |
22 | 0 | } |
23 | 0 | if (stringified_json) { |
24 | 0 | free(stringified_json); |
25 | 0 | } |
26 | 0 | } |
27 | | |
28 | | public: |
29 | | yyjson_mut_doc *doc = nullptr; |
30 | | char *stringified_json = nullptr; |
31 | | }; |
32 | | |
33 | | } // namespace duckdb |