Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
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
fmt
Commits
09f98854
Commit
09f98854
authored
Jan 01, 2014
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
StrFormatter -> StrFormatSpec.
parent
ba6c5fe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
format.h
format.h
+8
-7
No files found.
format.h
View file @
09f98854
...
...
@@ -402,13 +402,14 @@ class IntFormatSpec : public SpecT {
T
value
()
const
{
return
value_
;
}
};
// A string format specifier.
template
<
typename
T
>
class
StrFormat
ter
:
public
AlignSpec
{
class
StrFormat
Spec
:
public
AlignSpec
{
private:
const
T
*
str_
;
public:
StrFormat
ter
(
const
T
*
str
,
const
AlignSpec
&
spec
=
AlignSpec
())
StrFormat
Spec
(
const
T
*
str
,
const
AlignSpec
&
spec
=
AlignSpec
())
:
AlignSpec
(
spec
),
str_
(
str
)
{}
const
T
*
str
()
const
{
return
str_
;
}
...
...
@@ -503,9 +504,9 @@ DEFINE_INT_FORMATTERS(unsigned long long)
\endrst
*/
inline
StrFormat
ter
<
char
>
pad
(
inline
StrFormat
Spec
<
char
>
pad
(
const
char
*
str
,
unsigned
width
,
wchar_t
fill
=
' '
)
{
return
StrFormat
ter
<
char
>
(
str
,
AlignSpec
(
width
,
fill
));
return
StrFormat
Spec
<
char
>
(
str
,
AlignSpec
(
width
,
fill
));
}
template
<
typename
Char
>
...
...
@@ -712,9 +713,9 @@ class BasicWriter {
BasicWriter
&
operator
<<
(
const
IntFormatSpec
<
T
,
Spec
>
&
spec
);
template
<
typename
T
>
BasicWriter
&
operator
<<
(
const
StrFormat
ter
<
T
>
&
f
)
{
const
char
*
s
=
f
.
str
();
FormatString
(
s
,
std
::
strlen
(
s
),
f
);
BasicWriter
&
operator
<<
(
const
StrFormat
Spec
<
T
>
&
spec
)
{
const
char
*
s
=
spec
.
str
();
FormatString
(
s
,
std
::
strlen
(
s
),
spec
);
return
*
this
;
}
...
...
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