From 97601f8e13a3a03808944e229c3a6acdd173d1df Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Tue, 12 Dec 2023 04:59:05 +0000 Subject: [PATCH] src.ctf.fs: move ctf_fs_file to file.hpp This helps resolve some cyclic include problem between file.hpp and fs.hpp in the next patches (and I think it makes sense to put it there). Change-Id: I2904d17eb3ea51699464fba17a992ddf3b691f60 Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/8259 Reviewed-by: Philippe Proulx Reviewed-on: https://review.lttng.org/c/babeltrace/+/12297 --- src/plugins/ctf/fs-src/file.cpp | 1 - src/plugins/ctf/fs-src/file.hpp | 20 +++++++++++++++++--- src/plugins/ctf/fs-src/fs.hpp | 18 ------------------ 3 files changed, 17 insertions(+), 22 deletions(-) diff --git a/src/plugins/ctf/fs-src/file.cpp b/src/plugins/ctf/fs-src/file.cpp index ea92ab13..938c048d 100644 --- a/src/plugins/ctf/fs-src/file.cpp +++ b/src/plugins/ctf/fs-src/file.cpp @@ -11,7 +11,6 @@ #include "cpp-common/vendor/fmt/format.h" #include "file.hpp" -#include "fs.hpp" void ctf_fs_file_destroy(struct ctf_fs_file *file) { diff --git a/src/plugins/ctf/fs-src/file.hpp b/src/plugins/ctf/fs-src/file.hpp index 8fc01157..ccde384b 100644 --- a/src/plugins/ctf/fs-src/file.hpp +++ b/src/plugins/ctf/fs-src/file.hpp @@ -9,11 +9,25 @@ #include -namespace bt2c { +#include "cpp-common/bt2c/logging.hpp" -class Logger; +struct ctf_fs_file +{ + explicit ctf_fs_file(const bt2c::Logger& parentLogger) : + logger {parentLogger, "PLUGIN/SRC.CTF.FS/FILE"} + { + } -} /* namespace bt2c */ + bt2c::Logger logger; + + /* Owned by this */ + GString *path = nullptr; + + /* Owned by this */ + FILE *fp = nullptr; + + off_t size = 0; +}; void ctf_fs_file_destroy(struct ctf_fs_file *file); diff --git a/src/plugins/ctf/fs-src/fs.hpp b/src/plugins/ctf/fs-src/fs.hpp index f2ff5fcc..52e6761b 100644 --- a/src/plugins/ctf/fs-src/fs.hpp +++ b/src/plugins/ctf/fs-src/fs.hpp @@ -22,24 +22,6 @@ extern bool ctf_fs_debug; -struct ctf_fs_file -{ - explicit ctf_fs_file(const bt2c::Logger& parentLogger) : - logger {parentLogger, "PLUGIN/SRC.CTF.FS/FILE"} - { - } - - bt2c::Logger logger; - - /* Owned by this */ - GString *path = nullptr; - - /* Owned by this */ - FILE *fp = nullptr; - - off_t size = 0; -}; - struct ctf_fs_metadata { /* Owned by this */ -- 2.34.1