20 #ifndef MPD_COMPOSITE_STORAGE_HXX
21 #define MPD_COMPOSITE_STORAGE_HXX
52 std::map<std::string, Directory> children;
58 bool IsEmpty()
const {
59 return storage ==
nullptr && children.empty();
63 const Directory *Find(
const char *
uri)
const;
65 Directory &Make(
const char *uri);
72 const char *uri)
const;
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 override;
137 if (storage !=
nullptr)
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;
165 const char *uri)
const;
std::string MapUTF8(const char *uri) const override
Map the given relative URI to an absolute URI.
bool Unmount(const char *uri)
A path name in the native file system character set.
void Mount(const char *uri, Storage *storage)
StorageDirectoryReader * OpenDirectory(const char *uri) override
Throws #std::runtime_error on error.
virtual ~CompositeStorage()
StorageFileInfo GetInfo(const char *uri, bool follow) override
Throws #std::runtime_error on error.
void VisitMounts(T t) const
Call the given function for each mounted storage, including the root storage.
Directory(std::string &&_path_utf8, Directory *_parent)
A Storage implementation that combines multiple other Storage instances in one virtual tree...
gcc_pure gcc_nonnull_all Storage * GetMount(const char *uri)
Get the Storage at the specified mount point.
const Storage const char * uri
AllocatedPath MapFS(const char *uri) const override
Map the given relative URI to a local file path.
const char * MapToRelativeUTF8(const char *uri) const override
Check if the given URI points inside this storage.