20 #ifndef MPD_COMPOSITE_STORAGE_HXX 21 #define MPD_COMPOSITE_STORAGE_HXX 52 std::map<std::string, Directory> children;
58 bool IsEmpty()
const noexcept {
59 return storage ==
nullptr && children.empty();
63 const Directory *Find(
const char *
uri)
const noexcept;
65 Directory &Make(
const char *
uri);
72 const char *
uri)
const noexcept;
76 const Directory *directory;
89 mutable std::string relative_buffer;
113 const std::lock_guard<Mutex> protect(mutex);
126 std::string
MapUTF8(
const char *
uri)
const noexcept
override;
143 const size_t uri_length =
uri.length();
145 for (
const auto &i : directory.children) {
146 uri.resize(uri_length);
162 FindResult FindStorage(
const char *
uri)
const noexcept;
165 const char *
uri)
const;
bool Unmount(const char *uri)
void VisitMounts(T t) const
Call the given function for each mounted storage, including the root storage.
A path name in the native file system character set.
gcc_pure gcc_nonnull_all Storage * GetMount(const char *uri) noexcept
Get the Storage at the specified mount point.
void Mount(const char *uri, Storage *storage)
StorageDirectoryReader * OpenDirectory(const char *uri) override
Throws #std::runtime_error on error.
virtual ~CompositeStorage()
AllocatedPath MapFS(const char *uri) const noexcept override
Map the given relative URI to a local file path.
StorageFileInfo GetInfo(const char *uri, bool follow) override
Throws #std::runtime_error on error.
std::string MapUTF8(const char *uri) const noexcept override
Map the given relative URI to an absolute URI.
Directory(std::string &&_path_utf8, Directory *_parent)
A Storage implementation that combines multiple other Storage instances in one virtual tree...
const char * MapToRelativeUTF8(const char *uri) const noexcept override
Check if the given URI points inside this storage.
CompositeStorage() noexcept
const Storage const char * uri