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
f0923231
Commit
f0923231
authored
Apr 02, 2020
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
storage/Interface: pass std::string_view to MapChildFS()
parent
dadf054f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
15 additions
and
14 deletions
+15
-14
Archive.cxx
src/db/update/Archive.cxx
+2
-2
UpdateIO.cxx
src/db/update/UpdateIO.cxx
+1
-1
UpdateIO.hxx
src/db/update/UpdateIO.hxx
+1
-1
Walk.cxx
src/db/update/Walk.cxx
+2
-2
Walk.hxx
src/db/update/Walk.hxx
+4
-4
StorageInterface.cxx
src/storage/StorageInterface.cxx
+2
-2
StorageInterface.hxx
src/storage/StorageInterface.hxx
+3
-2
No files found.
src/db/update/Archive.cxx
View file @
f0923231
...
...
@@ -122,7 +122,7 @@ class UpdateArchiveVisitor final : public ArchiveVisitor {
* @param plugin the archive plugin which fits this archive type
*/
void
UpdateWalk
::
UpdateArchiveFile
(
Directory
&
parent
,
const
char
*
name
,
UpdateWalk
::
UpdateArchiveFile
(
Directory
&
parent
,
std
::
string_view
name
,
const
StorageFileInfo
&
info
,
const
ArchivePlugin
&
plugin
)
noexcept
{
...
...
@@ -157,7 +157,7 @@ UpdateWalk::UpdateArchiveFile(Directory &parent, const char *name,
bool
UpdateWalk
::
UpdateArchiveFile
(
Directory
&
directory
,
const
char
*
name
,
const
char
*
suffix
,
std
::
string_view
name
,
const
char
*
suffix
,
const
StorageFileInfo
&
info
)
noexcept
{
const
ArchivePlugin
*
plugin
=
archive_plugin_from_suffix
(
suffix
);
...
...
src/db/update/UpdateIO.cxx
View file @
f0923231
...
...
@@ -85,7 +85,7 @@ try {
bool
directory_child_access
(
Storage
&
storage
,
const
Directory
&
directory
,
const
char
*
name
,
int
mode
)
noexcept
std
::
string_view
name
,
int
mode
)
noexcept
{
#ifdef _WIN32
/* CheckAccess() is useless on WIN32 */
...
...
src/db/update/UpdateIO.hxx
View file @
f0923231
...
...
@@ -58,6 +58,6 @@ directory_child_is_regular(Storage &storage, const Directory &directory,
gcc_pure
bool
directory_child_access
(
Storage
&
storage
,
const
Directory
&
directory
,
const
char
*
name
,
int
mode
)
noexcept
;
std
::
string_view
name
,
int
mode
)
noexcept
;
#endif
src/db/update/Walk.cxx
View file @
f0923231
...
...
@@ -229,7 +229,7 @@ skip_path(const char *name_utf8) noexcept
gcc_pure
bool
UpdateWalk
::
SkipSymlink
(
const
Directory
*
directory
,
const
char
*
utf8_name
)
const
noexcept
std
::
string_view
utf8_name
)
const
noexcept
{
#ifndef _WIN32
const
auto
path_fs
=
storage
.
MapChildFS
(
directory
->
GetPath
(),
...
...
@@ -369,7 +369,7 @@ UpdateWalk::UpdateDirectory(Directory &directory,
inline
Directory
*
UpdateWalk
::
DirectoryMakeChildChecked
(
Directory
&
parent
,
const
char
*
uri_utf8
,
const
char
*
name_utf8
)
noexcept
std
::
string_view
name_utf8
)
noexcept
{
Directory
*
directory
;
{
...
...
src/db/update/Walk.hxx
View file @
f0923231
...
...
@@ -78,7 +78,7 @@ public:
private
:
gcc_pure
bool
SkipSymlink
(
const
Directory
*
directory
,
const
char
*
utf8_name
)
const
noexcept
;
std
::
string_view
utf8_name
)
const
noexcept
;
void
RemoveExcludedFromDirectory
(
Directory
&
directory
,
const
ExcludeList
&
exclude_list
)
noexcept
;
...
...
@@ -103,10 +103,10 @@ private:
const
char
*
name
)
noexcept
;
bool
UpdateArchiveFile
(
Directory
&
directory
,
const
char
*
name
,
const
char
*
suffix
,
std
::
string_view
name
,
const
char
*
suffix
,
const
StorageFileInfo
&
info
)
noexcept
;
void
UpdateArchiveFile
(
Directory
&
directory
,
const
char
*
name
,
void
UpdateArchiveFile
(
Directory
&
directory
,
std
::
string_view
name
,
const
StorageFileInfo
&
info
,
const
ArchivePlugin
&
plugin
)
noexcept
;
...
...
@@ -163,7 +163,7 @@ private:
Directory
*
DirectoryMakeChildChecked
(
Directory
&
parent
,
const
char
*
uri_utf8
,
const
char
*
name_utf8
)
noexcept
;
std
::
string_view
name_utf8
)
noexcept
;
Directory
*
DirectoryMakeUriParentChecked
(
Directory
&
root
,
const
char
*
uri
)
noexcept
;
...
...
src/storage/StorageInterface.cxx
View file @
f0923231
...
...
@@ -28,8 +28,8 @@ Storage::MapFS([[maybe_unused]] const char *uri_utf8) const noexcept
}
AllocatedPath
Storage
::
MapChildFS
(
const
char
*
uri_utf8
,
const
char
*
child_utf8
)
const
noexcept
Storage
::
MapChildFS
(
std
::
string_view
uri_utf8
,
std
::
string_view
child_utf8
)
const
noexcept
{
const
auto
uri2
=
PathTraitsUTF8
::
Build
(
uri_utf8
,
child_utf8
);
return
MapFS
(
uri2
.
c_str
());
...
...
src/storage/StorageInterface.hxx
View file @
f0923231
...
...
@@ -24,6 +24,7 @@
#include <memory>
#include <string>
#include <string_view>
struct
StorageFileInfo
;
class
AllocatedPath
;
...
...
@@ -73,8 +74,8 @@ public:
virtual
AllocatedPath
MapFS
(
const
char
*
uri_utf8
)
const
noexcept
;
gcc_pure
AllocatedPath
MapChildFS
(
const
char
*
uri_utf8
,
const
char
*
child_utf8
)
const
noexcept
;
AllocatedPath
MapChildFS
(
std
::
string_view
uri_utf8
,
std
::
string_view
child_utf8
)
const
noexcept
;
/**
* Check if the given URI points inside this storage. If yes,
...
...
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