2 * Copyright (c) 2022 EfficiOS, inc.
4 * SPDX-License-Identifier: MIT
7 #ifndef BABELTRACE_CPP_COMMON_GLIB_UP_HPP
8 #define BABELTRACE_CPP_COMMON_GLIB_UP_HPP
14 namespace bt2_common {
17 struct GCharDeleter final
19 void operator()(gchar * const p) noexcept
25 } /* namespace internal */
27 using GCharUP = std::unique_ptr<gchar, internal::GCharDeleter>;
31 struct GStringDeleter final
33 void operator()(GString * const str)
35 g_string_free(str, TRUE);
39 } /* namespace internal */
41 using GStringUP = std::unique_ptr<GString, internal::GStringDeleter>;
45 struct GDirDeleter final
47 void operator()(GDir * const dir)
53 } /* namespace internal */
55 using GDirUP = std::unique_ptr<GDir, internal::GDirDeleter>;
59 struct GMappedFileDeleter final
61 void operator()(GMappedFile * const f)
63 g_mapped_file_unref(f);
67 } /* namespace internal */
69 using GMappedFileUP = std::unique_ptr<GMappedFile, internal::GMappedFileDeleter>;
71 } /* namespace bt2_common */
73 #endif /* BABELTRACE_CPP_COMMON_GLIB_UP_HPP */