#include <file_helper.h>
Definition at line 25 of file file_helper.h.
spdlog::details::file_helper::file_helper |
( |
| ) |
|
|
explicitdefault |
spdlog::details::file_helper::file_helper |
( |
const file_helper & |
| ) |
|
|
delete |
spdlog::details::file_helper::~file_helper |
( |
| ) |
|
|
inline |
void spdlog::details::file_helper::close |
( |
| ) |
|
|
inline |
static bool spdlog::details::file_helper::file_exists |
( |
const filename_t & |
fname | ) |
|
|
inlinestatic |
Definition at line 107 of file file_helper.h.
bool file_exists(const filename_t &filename) SPDLOG_NOEXCEPT
const filename_t& spdlog::details::file_helper::filename |
( |
| ) |
const |
|
inline |
void spdlog::details::file_helper::flush |
( |
| ) |
|
|
inline |
void spdlog::details::file_helper::open |
( |
const filename_t & |
fname, |
|
|
bool |
truncate = false |
|
) |
| |
|
inline |
Definition at line 42 of file file_helper.h.
47 for (
int tries = 0; tries <
open_tries; ++tries)
int errno
Contains the last error code.
bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode)
#define SPDLOG_FILENAME_T(s)
void sleep_for_millis(int milliseconds) SPDLOG_NOEXCEPT
std::string filename_to_str(const filename_t &filename)
void spdlog::details::file_helper::reopen |
( |
bool |
truncate | ) |
|
|
inline |
Definition at line 60 of file file_helper.h.
64 throw spdlog_ex(
"Failed re opening file - was not opened before");
void open(const filename_t &fname, bool truncate=false)
size_t spdlog::details::file_helper::size |
( |
void |
| ) |
const |
|
inline |
Definition at line 93 of file file_helper.h.
std::string filename_to_str(const filename_t &filename)
Definition at line 125 of file file_helper.h.
127 auto ext_index =
fname.rfind(
'.');
131 if (ext_index == filename_t::npos || ext_index == 0 || ext_index ==
fname.size() - 1)
138 if (folder_index != filename_t::npos && folder_index >= ext_index - 1)
144 return std::make_tuple(
fname.substr(0, ext_index),
fname.substr(ext_index));
static SPDLOG_CONSTEXPR const char folder_sep
Definition at line 83 of file file_helper.h.
85 size_t msg_size = buf.size();
86 auto data = buf.data();
87 if (std::fwrite(
data, 1, msg_size,
fd_) != msg_size)
int errno
Contains the last error code.
std::string filename_to_str(const filename_t &filename)
filename_t spdlog::details::file_helper::_filename |
|
private |
std::FILE* spdlog::details::file_helper::fd_ {nullptr} |
|
private |
const int spdlog::details::file_helper::open_interval = 10 |
const int spdlog::details::file_helper::open_tries = 5 |
The documentation for this class was generated from the following file: