Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gabime/spdlog.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgabime <gmelman1@gmail.com>2018-07-22 13:06:16 +0300
committergabime <gmelman1@gmail.com>2018-07-22 13:06:16 +0300
commit7184c423760b0ce533232d9ce76e20807d3af5f9 (patch)
tree77d3ddc5ea8ad39224b915b9cea3ac782adec22a
parent349829fa96567101ff39575fb9691b917d62ad3a (diff)
Changed some static string array to char* arrays
-rw-r--r--include/spdlog/details/pattern_formatter.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/include/spdlog/details/pattern_formatter.h b/include/spdlog/details/pattern_formatter.h
index ccca355a..06eee7f9 100644
--- a/include/spdlog/details/pattern_formatter.h
+++ b/include/spdlog/details/pattern_formatter.h
@@ -75,43 +75,43 @@ static int to12h(const tm &t)
}
// Abbreviated weekday name
-static const std::string days[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
+static const char* days[]{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"};
class a_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
{
- fmt_helper::append_str(days[tm_time.tm_wday], dest);
+ fmt_helper::append_c_str(days[tm_time.tm_wday], dest);
}
};
// Full weekday name
-static const std::string full_days[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
+static const char* full_days[]{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
class A_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
{
- fmt_helper::append_str(full_days[tm_time.tm_wday], dest);
+ fmt_helper::append_c_str(full_days[tm_time.tm_wday], dest);
}
};
// Abbreviated month
-static const std::string months[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
+static const char* months[]{"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sept", "Oct", "Nov", "Dec"};
class b_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
{
- fmt_helper::append_str(months[tm_time.tm_mon], dest);
+ fmt_helper::append_c_str(months[tm_time.tm_mon], dest);
}
};
// Full month name
-static const std::string full_months[]{
+static const char* full_months[]{
"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"};
class B_formatter : public flag_formatter
{
void format(const details::log_msg &, const std::tm &tm_time, fmt::memory_buffer &dest) override
{
- fmt_helper::append_str(full_months[tm_time.tm_mon], dest);
+ fmt_helper::append_c_str(full_months[tm_time.tm_mon], dest);
}
};