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