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
03b1b283
Commit
03b1b283
authored
May 18, 2022
by
Vladislav Shchapov
Committed by
Victor Zverovich
May 28, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve std::filesystem::path formatter.
Signed-off-by:
Vladislav Shchapov
<
vladislav@shchapov.ru
>
parent
4f9311e6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
9 deletions
+4
-9
include/fmt/std.h
include/fmt/std.h
+3
-8
test/std-test.cc
test/std-test.cc
+1
-1
No files found.
include/fmt/std.h
View file @
03b1b283
...
@@ -19,14 +19,9 @@
...
@@ -19,14 +19,9 @@
#ifdef __cpp_lib_filesystem
#ifdef __cpp_lib_filesystem
# include <filesystem>
# include <filesystem>
template
<
>
FMT_BEGIN_NAMESPACE
struct
fmt
::
formatter
<
std
::
filesystem
::
path
>
:
formatter
<
string_view
>
{
template
<
>
struct
formatter
<
std
::
filesystem
::
path
>
:
ostream_formatter
{};
template
<
typename
FormatContext
>
FMT_END_NAMESPACE
auto
format
(
const
std
::
filesystem
::
path
&
p
,
FormatContext
&
ctx
)
const
->
typename
FormatContext
::
iterator
{
return
formatter
<
string_view
>::
format
(
p
.
string
(),
ctx
);
}
};
#endif
#endif
FMT_BEGIN_NAMESPACE
FMT_BEGIN_NAMESPACE
...
...
test/std-test.cc
View file @
03b1b283
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
TEST
(
std_test
,
path
)
{
TEST
(
std_test
,
path
)
{
#ifdef __cpp_lib_filesystem
#ifdef __cpp_lib_filesystem
EXPECT_EQ
(
fmt
::
format
(
"{:8}"
,
std
::
filesystem
::
path
(
"foo"
)),
"
foo
"
);
EXPECT_EQ
(
fmt
::
format
(
"{:8}"
,
std
::
filesystem
::
path
(
"foo"
)),
"
\"
foo
\"
"
);
#endif
#endif
}
}
...
...
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