mirror of
https://github.com/gabime/spdlog.git
synced 2025-09-30 10:29:02 +08:00
Merge branch 'master' of https://github.com/gabime/spdlog
This commit is contained in:
@@ -118,17 +118,18 @@ public:
|
||||
//
|
||||
// "my_folder/.mylog" => ("my_folder/.mylog")
|
||||
// "my_folder/.mylog.txt" => ("my_folder/.mylog", ".txt")
|
||||
|
||||
static std::tuple<filename_t, filename_t> split_by_extenstion(const filename_t& fname)
|
||||
{
|
||||
auto index = fname.rfind('.');
|
||||
bool found_ext = index != filename_t::npos && index !=0 && fname[index - 1] != details::os::folder_sep;
|
||||
if (found_ext)
|
||||
return std::make_tuple(fname.substr(0, index), fname.substr(index));
|
||||
else
|
||||
return std::make_tuple(fname, filename_t());
|
||||
if (index != filename_t::npos && index != fname.size() - 1 &&index !=0 && fname[index - 1] != details::os::folder_sep)
|
||||
{
|
||||
auto index2 = fname.find(details::os::folder_sep, index);
|
||||
if (index2 == fname.npos) {
|
||||
return std::make_tuple(fname.substr(0, index), fname.substr(index));
|
||||
}
|
||||
}
|
||||
return std::make_tuple(fname, std::string());
|
||||
}
|
||||
|
||||
private:
|
||||
FILE* _fd;
|
||||
filename_t _filename;
|
||||
|
@@ -7,7 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define SPDLOG_VERSION "0.14.0"
|
||||
#define SPDLOG_VERSION "0.16.1"
|
||||
|
||||
#include "tweakme.h"
|
||||
#include "common.h"
|
||||
|
Reference in New Issue
Block a user