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
e9d42e05
Commit
e9d42e05
authored
Oct 25, 2019
by
gabime
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// support forward slash in windows
parent
a8f72424
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
12 deletions
+8
-12
include/spdlog/details/os-inl.h
include/spdlog/details/os-inl.h
+7
-11
include/spdlog/details/os.h
include/spdlog/details/os.h
+1
-1
No files found.
include/spdlog/details/os-inl.h
View file @
e9d42e05
...
...
@@ -489,13 +489,12 @@ SPDLOG_INLINE bool create_dir(filename_t path)
std
::
basic_istringstream
<
char_type
>
istream
(
path
);
filename_t
token
;
filename_t
cur_dir
;
char_type
sep
=
'/'
;
#ifdef _WIN32
// support forward slash in windows
std
::
replace
(
path
.
begin
(),
path
.
end
(),
char_type
(
'\\'
),
sep
);
std
::
replace
(
path
.
begin
(),
path
.
end
(),
'/'
,
folder_
sep
);
#endif
while
(
std
::
getline
(
istream
,
token
,
sep
))
while
(
std
::
getline
(
istream
,
token
,
folder_
sep
))
{
if
(
!
token
.
empty
())
{
...
...
@@ -505,7 +504,7 @@ SPDLOG_INLINE bool create_dir(filename_t path)
return
false
;
}
}
cur_dir
+=
sep
;
cur_dir
+=
folder_
sep
;
}
return
true
;
...
...
@@ -518,14 +517,11 @@ SPDLOG_INLINE bool create_dir(filename_t path)
// "abc///" => "abc//"
SPDLOG_INLINE
filename_t
dir_name
(
filename_t
path
)
{
using
char_type
=
filename_t
::
value_type
;
char_type
sep
=
'/'
;
#ifdef _WIN32
// support forward slash in windows
std
::
replace
(
path
.
begin
(),
path
.
end
(),
char_type
(
'\\'
),
sep
);
std
::
replace
(
path
.
begin
(),
path
.
end
(),
'/'
,
folder_
sep
);
#endif
auto
pos
=
path
.
find_last_of
(
sep
);
auto
pos
=
path
.
find_last_of
(
folder_
sep
);
return
pos
!=
filename_t
::
npos
?
path
.
substr
(
0
,
pos
)
:
filename_t
{};
}
...
...
include/spdlog/details/os.h
View file @
e9d42e05
...
...
@@ -33,7 +33,7 @@ SPDLOG_CONSTEXPR static const char *default_eol = SPDLOG_EOL;
// folder separator
#ifdef _WIN32
const
char
folder_sep
=
'\\'
;
static
const
char
folder_sep
=
'\\'
;
#else
SPDLOG_CONSTEXPR
static
const
char
folder_sep
=
'/'
;
#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