Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
spdlog
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
spdlog
Commits
7184c423
Commit
7184c423
authored
Jul 22, 2018
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed some static string array to char* arrays
parent
349829fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
include/spdlog/details/pattern_formatter.h
include/spdlog/details/pattern_formatter.h
+8
-8
No files found.
include/spdlog/details/pattern_formatter.h
View file @
7184c423
...
...
@@ -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
);
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment