diff --git a/include/spdlog/details/os-inl.h b/include/spdlog/details/os-inl.h index a7cd37f7..5f082e57 100644 --- a/include/spdlog/details/os-inl.h +++ b/include/spdlog/details/os-inl.h @@ -542,7 +542,7 @@ static SPDLOG_INLINE bool mkdir_(const filename_t &path) // create the given directory - and all directories leading to it // 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)) { @@ -581,7 +581,7 @@ SPDLOG_INLINE bool create_dir(filename_t path) // "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); return pos != filename_t::npos ? path.substr(0, pos) : filename_t{}; diff --git a/include/spdlog/details/os.h b/include/spdlog/details/os.h index 2b2ffa1d..b154bc47 100644 --- a/include/spdlog/details/os.h +++ b/include/spdlog/details/os.h @@ -99,11 +99,11 @@ SPDLOG_API void utf8_to_wstrbuf(string_view_t str, wmemory_buf_t &target); // "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. // 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 // return empty string if field not found diff --git a/include/spdlog/pattern_formatter.h b/include/spdlog/pattern_formatter.h index 147d8546..6810f03b 100644 --- a/include/spdlog/pattern_formatter.h +++ b/include/spdlog/pattern_formatter.h @@ -68,7 +68,7 @@ class SPDLOG_API custom_flag_formatter : public details::flag_formatter public: virtual std::unique_ptr clone() const = 0; - void set_padding_info(details::padding_info padding) + void set_padding_info(const details::padding_info& padding) { flag_formatter::padinfo_ = padding; }