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
26aa34f3
Commit
26aa34f3
authored
Apr 08, 2018
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basic_context -> basic_format_context
parent
44cc0346
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
16 deletions
+18
-16
include/fmt/core.h
include/fmt/core.h
+10
-9
include/fmt/format.h
include/fmt/format.h
+5
-5
test/util-test.cc
test/util-test.cc
+3
-2
No files found.
include/fmt/core.h
View file @
26aa34f3
...
@@ -863,8 +863,9 @@ inline Container &get_container(std::back_insert_iterator<Container> it) {
...
@@ -863,8 +863,9 @@ inline Container &get_container(std::back_insert_iterator<Container> it) {
// Formatting context.
// Formatting context.
template
<
typename
OutputIt
,
typename
Char
>
template
<
typename
OutputIt
,
typename
Char
>
class
basic_context
:
class
basic_format_context
:
public
internal
::
context_base
<
OutputIt
,
basic_context
<
OutputIt
,
Char
>
,
Char
>
{
public
internal
::
context_base
<
OutputIt
,
basic_format_context
<
OutputIt
,
Char
>
,
Char
>
{
public:
public:
/** The character type for the output. */
/** The character type for the output. */
typedef
Char
char_type
;
typedef
Char
char_type
;
...
@@ -874,11 +875,11 @@ class basic_context :
...
@@ -874,11 +875,11 @@ class basic_context :
struct
formatter_type
{
typedef
formatter
<
T
,
char_type
>
type
;
};
struct
formatter_type
{
typedef
formatter
<
T
,
char_type
>
type
;
};
private:
private:
internal
::
arg_map
<
basic_context
>
map_
;
internal
::
arg_map
<
basic_
format_
context
>
map_
;
FMT_DISALLOW_COPY_AND_ASSIGN
(
basic_context
);
FMT_DISALLOW_COPY_AND_ASSIGN
(
basic_
format_
context
);
typedef
internal
::
context_base
<
OutputIt
,
basic_context
,
Char
>
base
;
typedef
internal
::
context_base
<
OutputIt
,
basic_
format_
context
,
Char
>
base
;
typedef
typename
base
::
format_arg
format_arg
;
typedef
typename
base
::
format_arg
format_arg
;
using
base
::
get_arg
;
using
base
::
get_arg
;
...
@@ -887,12 +888,12 @@ class basic_context :
...
@@ -887,12 +888,12 @@ class basic_context :
/**
/**
\rst
\rst
Constructs a ``basic_context`` object. References to the arguments are
Constructs a ``basic_
format_
context`` object. References to the arguments are
stored in the object so make sure they have appropriate lifetimes.
stored in the object so make sure they have appropriate lifetimes.
\endrst
\endrst
*/
*/
basic_context
(
OutputIt
out
,
basic_string_view
<
char_type
>
format_str
,
basic_
format_
context
(
OutputIt
out
,
basic_string_view
<
char_type
>
format_str
,
basic_format_args
<
basic_context
>
args
)
basic_format_args
<
basic_
format_
context
>
args
)
:
base
(
out
,
format_str
,
args
)
{}
:
base
(
out
,
format_str
,
args
)
{}
format_arg
next_arg
()
{
format_arg
next_arg
()
{
...
@@ -907,7 +908,7 @@ class basic_context :
...
@@ -907,7 +908,7 @@ class basic_context :
template
<
typename
Char
>
template
<
typename
Char
>
struct
buffer_context
{
struct
buffer_context
{
typedef
basic_context
<
typedef
basic_
format_
context
<
std
::
back_insert_iterator
<
internal
::
basic_buffer
<
Char
>>
,
Char
>
type
;
std
::
back_insert_iterator
<
internal
::
basic_buffer
<
Char
>>
,
Char
>
type
;
};
};
typedef
buffer_context
<
char
>::
type
context
;
typedef
buffer_context
<
char
>::
type
context
;
...
...
include/fmt/format.h
View file @
26aa34f3
...
@@ -2203,7 +2203,7 @@ class arg_formatter:
...
@@ -2203,7 +2203,7 @@ class arg_formatter:
private:
private:
typedef
typename
Range
::
value_type
char_type
;
typedef
typename
Range
::
value_type
char_type
;
typedef
internal
::
arg_formatter_base
<
Range
>
base
;
typedef
internal
::
arg_formatter_base
<
Range
>
base
;
typedef
basic_context
<
typename
base
::
iterator
,
char_type
>
context_type
;
typedef
basic_
format_
context
<
typename
base
::
iterator
,
char_type
>
context_type
;
context_type
&
ctx_
;
context_type
&
ctx_
;
...
@@ -3199,8 +3199,8 @@ class dynamic_formatter {
...
@@ -3199,8 +3199,8 @@ class dynamic_formatter {
};
};
template
<
typename
Range
,
typename
Char
>
template
<
typename
Range
,
typename
Char
>
typename
basic_context
<
Range
,
Char
>::
format_arg
typename
basic_
format_
context
<
Range
,
Char
>::
format_arg
basic_context
<
Range
,
Char
>::
get_arg
(
basic_string_view
<
char_type
>
name
)
{
basic_
format_
context
<
Range
,
Char
>::
get_arg
(
basic_string_view
<
char_type
>
name
)
{
map_
.
init
(
this
->
args
());
map_
.
init
(
this
->
args
());
format_arg
arg
=
map_
.
find
(
name
);
format_arg
arg
=
map_
.
find
(
name
);
if
(
arg
.
type
()
==
internal
::
none_type
)
if
(
arg
.
type
()
==
internal
::
none_type
)
...
@@ -3393,8 +3393,8 @@ inline wcontext::iterator format_to(
...
@@ -3393,8 +3393,8 @@ inline wcontext::iterator format_to(
}
}
template
<
typename
OutputIt
,
typename
Char
=
char
>
template
<
typename
OutputIt
,
typename
Char
=
char
>
//using context_t = basic_context<OutputIt, Char>;
//using context_t = basic_
format_
context<OutputIt, Char>;
struct
context_t
{
typedef
basic_context
<
OutputIt
,
Char
>
type
;
};
struct
context_t
{
typedef
basic_
format_
context
<
OutputIt
,
Char
>
type
;
};
template
<
typename
OutputIt
,
typename
Char
=
char
>
template
<
typename
OutputIt
,
typename
Char
=
char
>
//using format_args_t = basic_format_args<context_t<OutputIt, Char>>;
//using format_args_t = basic_format_args<context_t<OutputIt, Char>>;
...
...
test/util-test.cc
View file @
26aa34f3
...
@@ -63,7 +63,7 @@ struct formatter<Test, Char> {
...
@@ -63,7 +63,7 @@ struct formatter<Test, Char> {
typedef
std
::
back_insert_iterator
<
basic_buffer
<
Char
>>
iterator
;
typedef
std
::
back_insert_iterator
<
basic_buffer
<
Char
>>
iterator
;
auto
format
(
Test
,
basic_context
<
iterator
,
char
>
&
ctx
)
auto
format
(
Test
,
basic_
format_
context
<
iterator
,
char
>
&
ctx
)
->
decltype
(
ctx
.
begin
())
{
->
decltype
(
ctx
.
begin
())
{
const
Char
*
test
=
"test"
;
const
Char
*
test
=
"test"
;
return
std
::
copy_n
(
test
,
std
::
strlen
(
test
),
ctx
.
begin
());
return
std
::
copy_n
(
test
,
std
::
strlen
(
test
),
ctx
.
begin
());
...
@@ -506,7 +506,8 @@ VISIT_TYPE(float, double);
...
@@ -506,7 +506,8 @@ VISIT_TYPE(float, double);
testing::StrictMock<MockVisitor<decltype(expected)>> visitor; \
testing::StrictMock<MockVisitor<decltype(expected)>> visitor; \
EXPECT_CALL(visitor, visit(expected)); \
EXPECT_CALL(visitor, visit(expected)); \
typedef std::back_insert_iterator<basic_buffer<Char>> iterator; \
typedef std::back_insert_iterator<basic_buffer<Char>> iterator; \
fmt::visit(visitor, make_arg<fmt::basic_context<iterator, Char>>(value)); \
fmt::visit(visitor, \
make_arg<fmt::basic_format_context<iterator, Char>>(value)); \
}
}
#define CHECK_ARG(value, typename_) { \
#define CHECK_ARG(value, typename_) { \
...
...
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