Class to wrap file pointer.
More...
#include <num_collect/logging/sinks/file_wrapper.h>
Class to wrap file pointer.
- Thread Safety
- Not thread-safe.
Definition at line 38 of file file_wrapper.h.
◆ file_wrapper() [1/3]
num_collect::logging::sinks::file_wrapper::file_wrapper |
( |
std::FILE * | file, |
|
|
bool | close_on_destruction ) |
|
inline |
Constructor.
- Parameters
-
[in] | file | File pointer. |
[in] | close_on_destruction | Whether to close the file when destructed. |
Definition at line 52 of file file_wrapper.h.
◆ file_wrapper() [2/3]
num_collect::logging::sinks::file_wrapper::file_wrapper |
( |
const std::string & | filepath, |
|
|
const char * | mode ) |
|
inline |
Constructor to open a file.
- Parameters
-
[in] | filepath | Filepath. |
[in] | mode | Mode to open. (As in std::fopen .) |
Definition at line 61 of file file_wrapper.h.
◆ file_wrapper() [3/3]
num_collect::logging::sinks::file_wrapper::file_wrapper |
( |
file_wrapper && | obj | ) |
|
|
inlinenoexcept |
Move constructor.
- Parameters
-
[in] | obj | Object to move from. |
Definition at line 73 of file file_wrapper.h.
◆ ~file_wrapper()
num_collect::logging::sinks::file_wrapper::~file_wrapper |
( |
| ) |
|
|
inlinenoexcept |
◆ close()
void num_collect::logging::sinks::file_wrapper::close |
( |
| ) |
|
|
inlinenoexcept |
◆ file()
auto num_collect::logging::sinks::file_wrapper::file |
( |
| ) |
const -> std::FILE* |
|
inlinenodiscardnoexcept |
Get the file pointer.
- Returns
- File pointer.
Definition at line 186 of file file_wrapper.h.
◆ flush()
void num_collect::logging::sinks::file_wrapper::flush |
( |
| ) |
|
|
inline |
◆ open()
void num_collect::logging::sinks::file_wrapper::open |
( |
const std::string & | filepath, |
|
|
const char * | mode ) |
|
inline |
Open a file.
- Parameters
-
[in] | filepath | Filepath. |
[in] | mode | Mode to open. (As in std::fopen .) |
Definition at line 110 of file file_wrapper.h.
◆ operator=()
Move assignment operator.
- Parameters
-
[in] | obj | Object to move from. |
- Returns
- This.
Definition at line 84 of file file_wrapper.h.
◆ set_stderr()
void num_collect::logging::sinks::file_wrapper::set_stderr |
( |
| ) |
|
|
inline |
◆ set_stdout()
void num_collect::logging::sinks::file_wrapper::set_stdout |
( |
| ) |
|
|
inline |
◆ swap()
void num_collect::logging::sinks::file_wrapper::swap |
( |
file_wrapper & | obj | ) |
|
|
inlinenoexcept |
Swap with another object.
- Parameters
-
[in] | obj | Object to swap with. |
Definition at line 99 of file file_wrapper.h.
◆ write()
void num_collect::logging::sinks::file_wrapper::write |
( |
std::string_view | data | ) |
|
|
inline |
◆ close_on_destruction_
bool num_collect::logging::sinks::file_wrapper::close_on_destruction_ {false} |
|
private |
Whether to close the file when destructed.
Definition at line 193 of file file_wrapper.h.
◆ file_
std::FILE* num_collect::logging::sinks::file_wrapper::file_ {nullptr} |
|
private |
The documentation for this class was generated from the following file: