src.ctf.fs: make ctf_fs_file::fp a FileUP
[babeltrace.git] / src / plugins / ctf / fs-src / file.hpp
CommitLineData
e98a2d6e 1/*
0235b0db 2 * SPDX-License-Identifier: MIT
e98a2d6e 3 *
0235b0db 4 * Copyright (C) 2016 Philippe Proulx <pproulx@efficios.com>
e98a2d6e
PP
5 */
6
0235b0db
MJ
7#ifndef CTF_FS_FILE_H
8#define CTF_FS_FILE_H
9
5ff12b25
SM
10#include <memory>
11
c7e1be4b 12#include <babeltrace2/babeltrace.h>
e98a2d6e 13
85a25425 14#include "cpp-common/bt2c/libc-up.hpp"
97601f8e 15#include "cpp-common/bt2c/logging.hpp"
0f5c5d5c 16
5ff12b25
SM
17struct ctf_fs_file_deleter
18{
19 void operator()(struct ctf_fs_file *file) noexcept;
20};
21
97601f8e
SM
22struct ctf_fs_file
23{
5ff12b25
SM
24 using UP = std::unique_ptr<ctf_fs_file, ctf_fs_file_deleter>;
25
97601f8e
SM
26 explicit ctf_fs_file(const bt2c::Logger& parentLogger) :
27 logger {parentLogger, "PLUGIN/SRC.CTF.FS/FILE"}
28 {
29 }
0f5c5d5c 30
97601f8e
SM
31 bt2c::Logger logger;
32
33 /* Owned by this */
34 GString *path = nullptr;
35
85a25425 36 bt2c::FileUP fp;
97601f8e
SM
37
38 off_t size = 0;
39};
0f5c5d5c 40
e98a2d6e
PP
41void ctf_fs_file_destroy(struct ctf_fs_file *file);
42
5ff12b25 43ctf_fs_file::UP ctf_fs_file_create(const bt2c::Logger& parentLogger);
e98a2d6e 44
55314f2a 45int ctf_fs_file_open(struct ctf_fs_file *file, const char *mode);
e98a2d6e
PP
46
47#endif /* CTF_FS_FILE_H */
This page took 0.092223 seconds and 4 git commands to generate.