|
|
@ -542,7 +542,7 @@ static SPDLOG_INLINE bool mkdir_(const filename_t &path)
|
|
|
|
|
|
|
|
|
|
|
|
// create the given directory - and all directories leading to it
|
|
|
|
// create the given directory - and all directories leading to it
|
|
|
|
// return true on success or if the directory already exists
|
|
|
|
// return true on success or if the directory already exists
|
|
|
|
SPDLOG_INLINE bool create_dir(filename_t path)
|
|
|
|
SPDLOG_INLINE bool create_dir(const filename_t &path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (path_exists(path))
|
|
|
|
if (path_exists(path))
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -581,7 +581,7 @@ SPDLOG_INLINE bool create_dir(filename_t path)
|
|
|
|
// "abc/" => "abc"
|
|
|
|
// "abc/" => "abc"
|
|
|
|
// "abc" => ""
|
|
|
|
// "abc" => ""
|
|
|
|
// "abc///" => "abc//"
|
|
|
|
// "abc///" => "abc//"
|
|
|
|
SPDLOG_INLINE filename_t dir_name(filename_t path)
|
|
|
|
SPDLOG_INLINE filename_t dir_name(const filename_t &path)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto pos = path.find_last_of(folder_seps_filename);
|
|
|
|
auto pos = path.find_last_of(folder_seps_filename);
|
|
|
|
return pos != filename_t::npos ? path.substr(0, pos) : filename_t{};
|
|
|
|
return pos != filename_t::npos ? path.substr(0, pos) : filename_t{};
|
|
|
|