mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-24 06:32:06 +08:00
minor changes added const ref params
This commit is contained in:
parent
0c611af552
commit
e3e4c4bc95
@ -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{};
|
||||||
|
@ -99,11 +99,11 @@ SPDLOG_API void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target);
|
|||||||
// "abc/" => "abc"
|
// "abc/" => "abc"
|
||||||
// "abc" => ""
|
// "abc" => ""
|
||||||
// "abc///" => "abc//"
|
// "abc///" => "abc//"
|
||||||
SPDLOG_API filename_t dir_name(filename_t path);
|
SPDLOG_API filename_t dir_name(const filename_t &path);
|
||||||
|
|
||||||
// Create a dir from the given path.
|
// Create a dir from the given path.
|
||||||
// Return true if succeeded or if this dir already exists.
|
// Return true if succeeded or if this dir already exists.
|
||||||
SPDLOG_API bool create_dir(filename_t path);
|
SPDLOG_API bool create_dir(const filename_t &path);
|
||||||
|
|
||||||
// non thread safe, cross platform getenv/getenv_s
|
// non thread safe, cross platform getenv/getenv_s
|
||||||
// return empty string if field not found
|
// return empty string if field not found
|
||||||
|
@ -68,7 +68,7 @@ class SPDLOG_API custom_flag_formatter : public details::flag_formatter
|
|||||||
public:
|
public:
|
||||||
virtual std::unique_ptr<custom_flag_formatter> clone() const = 0;
|
virtual std::unique_ptr<custom_flag_formatter> clone() const = 0;
|
||||||
|
|
||||||
void set_padding_info(details::padding_info padding)
|
void set_padding_info(const details::padding_info& padding)
|
||||||
{
|
{
|
||||||
flag_formatter::padinfo_ = padding;
|
flag_formatter::padinfo_ = padding;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user