Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
2429cc87
Commit
2429cc87
authored
Apr 03, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Traits: convert first Relative() parameter to std::string_view
parent
3a83a6b5
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
11 additions
and
15 deletions
+11
-15
Traits.cxx
src/fs/Traits.cxx
+4
-6
Traits.hxx
src/fs/Traits.hxx
+2
-4
CurlStorage.cxx
src/storage/plugins/CurlStorage.cxx
+1
-1
LocalStorage.cxx
src/storage/plugins/LocalStorage.cxx
+1
-1
NfsStorage.cxx
src/storage/plugins/NfsStorage.cxx
+1
-1
SmbclientStorage.cxx
src/storage/plugins/SmbclientStorage.cxx
+1
-1
UdisksStorage.cxx
src/storage/plugins/UdisksStorage.cxx
+1
-1
No files found.
src/fs/Traits.cxx
View file @
2429cc87
...
@@ -86,10 +86,9 @@ GetParentPathImpl(typename Traits::const_pointer p) noexcept
...
@@ -86,10 +86,9 @@ GetParentPathImpl(typename Traits::const_pointer p) noexcept
template
<
typename
Traits
>
template
<
typename
Traits
>
typename
Traits
::
const_pointer
typename
Traits
::
const_pointer
RelativePathImpl
(
typename
Traits
::
const_pointer
base
,
RelativePathImpl
(
typename
Traits
::
string_view
base
,
typename
Traits
::
const_pointer
other
)
noexcept
typename
Traits
::
const_pointer
other
)
noexcept
{
{
assert
(
base
!=
nullptr
);
assert
(
other
!=
nullptr
);
assert
(
other
!=
nullptr
);
other
=
StringAfterPrefix
(
other
,
base
);
other
=
StringAfterPrefix
(
other
,
base
);
...
@@ -99,7 +98,7 @@ RelativePathImpl(typename Traits::const_pointer base,
...
@@ -99,7 +98,7 @@ RelativePathImpl(typename Traits::const_pointer base,
if
(
*
other
!=
0
)
{
if
(
*
other
!=
0
)
{
if
(
!
Traits
::
IsSeparator
(
*
other
))
{
if
(
!
Traits
::
IsSeparator
(
*
other
))
{
if
(
*
base
!=
0
&&
Traits
::
IsSeparator
(
other
[
-
1
]))
if
(
!
base
.
empty
()
&&
Traits
::
IsSeparator
(
other
[
-
1
]))
/* "other" has no more slash, but the
/* "other" has no more slash, but the
matching base ended with a slash:
matching base ended with a slash:
enough to detect a match */
enough to detect a match */
...
@@ -137,7 +136,7 @@ PathTraitsFS::GetParent(PathTraitsFS::const_pointer p) noexcept
...
@@ -137,7 +136,7 @@ PathTraitsFS::GetParent(PathTraitsFS::const_pointer p) noexcept
}
}
PathTraitsFS
::
const_pointer
PathTraitsFS
::
const_pointer
PathTraitsFS
::
Relative
(
const_pointer
base
,
const_pointer
other
)
noexcept
PathTraitsFS
::
Relative
(
string_view
base
,
const_pointer
other
)
noexcept
{
{
return
RelativePathImpl
<
PathTraitsFS
>
(
base
,
other
);
return
RelativePathImpl
<
PathTraitsFS
>
(
base
,
other
);
}
}
...
@@ -175,8 +174,7 @@ PathTraitsUTF8::GetParent(const_pointer p) noexcept
...
@@ -175,8 +174,7 @@ PathTraitsUTF8::GetParent(const_pointer p) noexcept
}
}
PathTraitsUTF8
::
const_pointer
PathTraitsUTF8
::
const_pointer
PathTraitsUTF8
::
Relative
(
const_pointer
base
,
PathTraitsUTF8
::
Relative
(
string_view
base
,
const_pointer
other
)
noexcept
const_pointer
other
)
noexcept
{
{
return
RelativePathImpl
<
PathTraitsUTF8
>
(
base
,
other
);
return
RelativePathImpl
<
PathTraitsUTF8
>
(
base
,
other
);
}
}
src/fs/Traits.hxx
View file @
2429cc87
...
@@ -147,8 +147,7 @@ struct PathTraitsFS {
...
@@ -147,8 +147,7 @@ struct PathTraitsFS {
* nullptr on mismatch.
* nullptr on mismatch.
*/
*/
gcc_pure
gcc_nonnull_all
gcc_pure
gcc_nonnull_all
static
const_pointer
Relative
(
const_pointer
base
,
static
const_pointer
Relative
(
string_view
base
,
const_pointer
other
)
noexcept
;
const_pointer
other
)
noexcept
;
/**
/**
* Constructs the path from the given components.
* Constructs the path from the given components.
...
@@ -256,8 +255,7 @@ struct PathTraitsUTF8 {
...
@@ -256,8 +255,7 @@ struct PathTraitsUTF8 {
* nullptr on mismatch.
* nullptr on mismatch.
*/
*/
gcc_pure
gcc_nonnull_all
gcc_pure
gcc_nonnull_all
static
const_pointer
Relative
(
const_pointer
base
,
static
const_pointer
Relative
(
string_view
base
,
const_pointer
other
)
noexcept
;
const_pointer
other
)
noexcept
;
/**
/**
* Constructs the path from the given components.
* Constructs the path from the given components.
...
...
src/storage/plugins/CurlStorage.cxx
View file @
2429cc87
...
@@ -81,7 +81,7 @@ CurlStorage::MapUTF8(const char *uri_utf8) const noexcept
...
@@ -81,7 +81,7 @@ CurlStorage::MapUTF8(const char *uri_utf8) const noexcept
const
char
*
const
char
*
CurlStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
CurlStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
{
{
return
PathTraitsUTF8
::
Relative
(
base
.
c_str
()
,
return
PathTraitsUTF8
::
Relative
(
base
,
CurlUnescape
(
uri_utf8
).
c_str
());
CurlUnescape
(
uri_utf8
).
c_str
());
}
}
...
...
src/storage/plugins/LocalStorage.cxx
View file @
2429cc87
...
@@ -129,7 +129,7 @@ LocalStorage::MapFS(const char *uri_utf8) const noexcept
...
@@ -129,7 +129,7 @@ LocalStorage::MapFS(const char *uri_utf8) const noexcept
const
char
*
const
char
*
LocalStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
LocalStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
{
{
return
PathTraitsUTF8
::
Relative
(
base_utf8
.
c_str
()
,
uri_utf8
);
return
PathTraitsUTF8
::
Relative
(
base_utf8
,
uri_utf8
);
}
}
StorageFileInfo
StorageFileInfo
...
...
src/storage/plugins/NfsStorage.cxx
View file @
2429cc87
...
@@ -246,7 +246,7 @@ NfsStorage::MapUTF8(const char *uri_utf8) const noexcept
...
@@ -246,7 +246,7 @@ NfsStorage::MapUTF8(const char *uri_utf8) const noexcept
const
char
*
const
char
*
NfsStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
NfsStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
{
{
return
PathTraitsUTF8
::
Relative
(
base
.
c_str
()
,
uri_utf8
);
return
PathTraitsUTF8
::
Relative
(
base
,
uri_utf8
);
}
}
static
void
static
void
...
...
src/storage/plugins/SmbclientStorage.cxx
View file @
2429cc87
...
@@ -87,7 +87,7 @@ SmbclientStorage::MapUTF8(const char *uri_utf8) const noexcept
...
@@ -87,7 +87,7 @@ SmbclientStorage::MapUTF8(const char *uri_utf8) const noexcept
const
char
*
const
char
*
SmbclientStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
SmbclientStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
{
{
return
PathTraitsUTF8
::
Relative
(
base
.
c_str
()
,
uri_utf8
);
return
PathTraitsUTF8
::
Relative
(
base
,
uri_utf8
);
}
}
static
StorageFileInfo
static
StorageFileInfo
...
...
src/storage/plugins/UdisksStorage.cxx
View file @
2429cc87
...
@@ -347,7 +347,7 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept
...
@@ -347,7 +347,7 @@ UdisksStorage::MapUTF8(const char *uri_utf8) const noexcept
const
char
*
const
char
*
UdisksStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
UdisksStorage
::
MapToRelativeUTF8
(
const
char
*
uri_utf8
)
const
noexcept
{
{
return
PathTraitsUTF8
::
Relative
(
base_uri
.
c_str
()
,
uri_utf8
);
return
PathTraitsUTF8
::
Relative
(
base_uri
,
uri_utf8
);
}
}
static
std
::
unique_ptr
<
Storage
>
static
std
::
unique_ptr
<
Storage
>
...
...
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