2 * Copyright (C) 2024 EfficiOS Inc.
4 * SPDX-License-Identifier: LGPL-2.1-only
8 #ifndef TESTS_UTILS_XML_UTILS_COMMON_HPP
9 #define TESTS_UTILS_XML_UTILS_COMMON_HPP
11 #include "common/make-unique-wrapper.hpp"
13 #include <libxml/parser.h>
19 using parser_ctx_uptr = std::unique_ptr<
21 lttng::memory::create_deleter_class<xmlParserCtxt, xmlFreeParserCtxt>::deleter>;
23 std::unique_ptr<xmlDoc, lttng::memory::create_deleter_class<xmlDoc, xmlFreeDoc>::deleter>;
26 * Manage the global parser context of libxml2.
27 * There should only be one instance of this class per process.
29 class global_parser_context {
31 global_parser_context()
36 ~global_parser_context()
41 /* Deactivate copy and assignment. */
42 global_parser_context(const global_parser_context&) = delete;
43 global_parser_context(global_parser_context&&) = delete;
44 global_parser_context& operator=(const global_parser_context&) = delete;
45 global_parser_context& operator=(global_parser_context&&) = delete;
47 } /* namespace libxml */
48 } /* namespace lttng */
49 #endif /* TESTS_UTILS_XML_UTILS_COMMON_HPP */