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
cb122a4d
Commit
cb122a4d
authored
Sep 21, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix format_to formatting to wmemory_buffer
parent
dc69cc45
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
include/fmt/format.h
include/fmt/format.h
+8
-7
test/format-test.cc
test/format-test.cc
+3
-0
No files found.
include/fmt/format.h
View file @
cb122a4d
...
...
@@ -3457,16 +3457,17 @@ inline wformat_context::iterator vformat_to(
return
vformat_to
<
arg_formatter
<
range
>>
(
buf
,
format_str
,
args
);
}
template
<
typename
String
,
typename
...
Args
,
std
::
size_t
SIZE
=
inline_buffer_size
>
inline
format_context
::
iterator
format_to
(
basic_memory_buffer
<
char
,
SIZE
>
&
buf
,
const
String
&
format_str
,
template
<
typename
String
,
typename
...
Args
,
std
::
size_t
SIZE
=
inline_buffer_size
,
typename
Char
=
typename
internal
::
format_string_traits
<
String
>
::
char_type
>
inline
typename
buffer_context
<
Char
>::
type
::
iterator
format_to
(
basic_memory_buffer
<
Char
,
SIZE
>
&
buf
,
const
String
&
format_str
,
const
Args
&
...
args
)
{
internal
::
check_format_string
<
Args
...
>
(
format_str
);
typedef
typename
internal
::
format_string_traits
<
String
>::
char_type
char_t
;
return
vformat_to
(
buf
,
basic_string_view
<
char_t
>
(
format_str
),
make_format_args
<
typename
buffer_context
<
char_t
>::
type
>
(
args
...));
buf
,
basic_string_view
<
Char
>
(
format_str
),
make_format_args
<
typename
buffer_context
<
Char
>::
type
>
(
args
...));
}
template
<
typename
OutputIt
,
typename
Char
=
char
>
...
...
test/format-test.cc
View file @
cb122a4d
...
...
@@ -692,6 +692,9 @@ TEST(FormatToTest, FormatToMemoryBuffer) {
fmt
::
basic_memory_buffer
<
char
,
100
>
buffer
;
fmt
::
format_to
(
buffer
,
"{}"
,
"foo"
);
EXPECT_EQ
(
"foo"
,
to_string
(
buffer
));
fmt
::
wmemory_buffer
wbuffer
;
fmt
::
format_to
(
wbuffer
,
L"{}"
,
L"foo"
);
EXPECT_EQ
(
L"foo"
,
to_string
(
wbuffer
));
}
TEST
(
FormatterTest
,
Escape
)
{
...
...
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