47 for (
int tries = 0; tries <
open_tries; ++tries)
64 throw spdlog_ex(
"Failed re opening file - was not opened before");
85 size_t msg_size = buf.size();
86 auto data = buf.data();
87 if (std::fwrite(
data, 1, msg_size,
fd_) != msg_size)
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));
bool file_exists(const filename_t &filename) SPDLOG_NOEXCEPT
void open(const filename_t &fname, bool truncate=false)
void reopen(bool truncate)
int errno
Contains the last error code.
static std::tuple< filename_t, filename_t > split_by_extension(const spdlog::filename_t &fname)
void write(const fmt::memory_buffer &buf)
bool fopen_s(FILE **fp, const filename_t &filename, const filename_t &mode)
const filename_t & filename() const
file_helper & operator=(const file_helper &)=delete
static SPDLOG_CONSTEXPR const char folder_sep
static bool file_exists(const filename_t &fname)
#define SPDLOG_FILENAME_T(s)
void sleep_for_millis(int milliseconds) SPDLOG_NOEXCEPT
std::string filename_to_str(const filename_t &filename)