Merge tag 'v0.20.7'
release v0.20.7
This commit is contained in:
@@ -109,7 +109,7 @@ CompositeStorage::Directory::~Directory()
|
||||
}
|
||||
|
||||
const CompositeStorage::Directory *
|
||||
CompositeStorage::Directory::Find(const char *uri) const
|
||||
CompositeStorage::Directory::Find(const char *uri) const noexcept
|
||||
{
|
||||
const Directory *directory = this;
|
||||
while (*uri != 0) {
|
||||
@@ -175,7 +175,7 @@ CompositeStorage::Directory::Unmount(const char *uri)
|
||||
|
||||
bool
|
||||
CompositeStorage::Directory::MapToRelativeUTF8(std::string &buffer,
|
||||
const char *uri) const
|
||||
const char *uri) const noexcept
|
||||
{
|
||||
if (storage != nullptr) {
|
||||
const char *result = storage->MapToRelativeUTF8(uri);
|
||||
@@ -197,7 +197,7 @@ CompositeStorage::Directory::MapToRelativeUTF8(std::string &buffer,
|
||||
return false;
|
||||
}
|
||||
|
||||
CompositeStorage::CompositeStorage()
|
||||
CompositeStorage::CompositeStorage() noexcept
|
||||
{
|
||||
}
|
||||
|
||||
@@ -206,7 +206,7 @@ CompositeStorage::~CompositeStorage()
|
||||
}
|
||||
|
||||
Storage *
|
||||
CompositeStorage::GetMount(const char *uri)
|
||||
CompositeStorage::GetMount(const char *uri) noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
|
||||
@@ -238,7 +238,7 @@ CompositeStorage::Unmount(const char *uri)
|
||||
}
|
||||
|
||||
CompositeStorage::FindResult
|
||||
CompositeStorage::FindStorage(const char *uri) const
|
||||
CompositeStorage::FindStorage(const char *uri) const noexcept
|
||||
{
|
||||
FindResult result{&root, uri};
|
||||
|
||||
@@ -311,7 +311,7 @@ CompositeStorage::OpenDirectory(const char *uri)
|
||||
}
|
||||
|
||||
std::string
|
||||
CompositeStorage::MapUTF8(const char *uri) const
|
||||
CompositeStorage::MapUTF8(const char *uri) const noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
|
||||
@@ -323,7 +323,7 @@ CompositeStorage::MapUTF8(const char *uri) const
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
CompositeStorage::MapFS(const char *uri) const
|
||||
CompositeStorage::MapFS(const char *uri) const noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
|
||||
@@ -335,7 +335,7 @@ CompositeStorage::MapFS(const char *uri) const
|
||||
}
|
||||
|
||||
const char *
|
||||
CompositeStorage::MapToRelativeUTF8(const char *uri) const
|
||||
CompositeStorage::MapToRelativeUTF8(const char *uri) const noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
|
||||
|
@@ -60,7 +60,7 @@ class CompositeStorage final : public Storage {
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
const Directory *Find(const char *uri) const;
|
||||
const Directory *Find(const char *uri) const noexcept;
|
||||
|
||||
Directory &Make(const char *uri);
|
||||
|
||||
@@ -69,7 +69,7 @@ class CompositeStorage final : public Storage {
|
||||
|
||||
gcc_pure
|
||||
bool MapToRelativeUTF8(std::string &buffer,
|
||||
const char *uri) const;
|
||||
const char *uri) const noexcept;
|
||||
};
|
||||
|
||||
struct FindResult {
|
||||
@@ -89,7 +89,7 @@ class CompositeStorage final : public Storage {
|
||||
mutable std::string relative_buffer;
|
||||
|
||||
public:
|
||||
CompositeStorage();
|
||||
CompositeStorage() noexcept;
|
||||
virtual ~CompositeStorage();
|
||||
|
||||
/**
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
* value is being used.
|
||||
*/
|
||||
gcc_pure gcc_nonnull_all
|
||||
Storage *GetMount(const char *uri);
|
||||
Storage *GetMount(const char *uri) noexcept;
|
||||
|
||||
/**
|
||||
* Call the given function for each mounted storage, including
|
||||
@@ -123,11 +123,11 @@ public:
|
||||
|
||||
StorageDirectoryReader *OpenDirectory(const char *uri) override;
|
||||
|
||||
std::string MapUTF8(const char *uri) const override;
|
||||
std::string MapUTF8(const char *uri) const noexcept override;
|
||||
|
||||
AllocatedPath MapFS(const char *uri) const override;
|
||||
AllocatedPath MapFS(const char *uri) const noexcept override;
|
||||
|
||||
const char *MapToRelativeUTF8(const char *uri) const override;
|
||||
const char *MapToRelativeUTF8(const char *uri) const noexcept override;
|
||||
|
||||
private:
|
||||
template<typename T>
|
||||
@@ -159,7 +159,7 @@ private:
|
||||
* the URI was used).
|
||||
*/
|
||||
gcc_pure
|
||||
FindResult FindStorage(const char *uri) const;
|
||||
FindResult FindStorage(const char *uri) const noexcept;
|
||||
|
||||
const char *MapToRelativeUTF8(const Directory &directory,
|
||||
const char *uri) const;
|
||||
|
@@ -73,7 +73,7 @@ CreateConfiguredStorage(EventLoop &event_loop)
|
||||
}
|
||||
|
||||
bool
|
||||
IsStorageConfigured()
|
||||
IsStorageConfigured() noexcept
|
||||
{
|
||||
return config_get_string(ConfigOption::MUSIC_DIR) != nullptr;
|
||||
}
|
||||
|
@@ -40,6 +40,6 @@ CreateConfiguredStorage(EventLoop &event_loop);
|
||||
*/
|
||||
gcc_const
|
||||
bool
|
||||
IsStorageConfigured();
|
||||
IsStorageConfigured() noexcept;
|
||||
|
||||
#endif
|
||||
|
@@ -43,7 +43,7 @@ const StoragePlugin *const storage_plugins[] = {
|
||||
};
|
||||
|
||||
const StoragePlugin *
|
||||
GetStoragePluginByName(const char *name)
|
||||
GetStoragePluginByName(const char *name) noexcept
|
||||
{
|
||||
for (auto i = storage_plugins; *i != nullptr; ++i) {
|
||||
const StoragePlugin &plugin = **i;
|
||||
|
@@ -35,7 +35,7 @@ extern const StoragePlugin *const storage_plugins[];
|
||||
|
||||
gcc_nonnull_all gcc_pure
|
||||
const StoragePlugin *
|
||||
GetStoragePluginByName(const char *name);
|
||||
GetStoragePluginByName(const char *name) noexcept;
|
||||
|
||||
gcc_nonnull_all gcc_malloc
|
||||
Storage *
|
||||
|
@@ -23,14 +23,14 @@
|
||||
#include "fs/Traits.hxx"
|
||||
|
||||
AllocatedPath
|
||||
Storage::MapFS(gcc_unused const char *uri_utf8) const
|
||||
Storage::MapFS(gcc_unused const char *uri_utf8) const noexcept
|
||||
{
|
||||
return AllocatedPath::Null();
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
Storage::MapChildFS(const char *uri_utf8,
|
||||
const char *child_utf8) const
|
||||
const char *child_utf8) const noexcept
|
||||
{
|
||||
const auto uri2 = PathTraitsUTF8::Build(uri_utf8, child_utf8);
|
||||
return MapFS(uri2.c_str());
|
||||
|
@@ -64,7 +64,7 @@ public:
|
||||
* Map the given relative URI to an absolute URI.
|
||||
*/
|
||||
gcc_pure
|
||||
virtual std::string MapUTF8(const char *uri_utf8) const = 0;
|
||||
virtual std::string MapUTF8(const char *uri_utf8) const noexcept = 0;
|
||||
|
||||
/**
|
||||
* Map the given relative URI to a local file path. Returns
|
||||
@@ -72,11 +72,11 @@ public:
|
||||
* support local files.
|
||||
*/
|
||||
gcc_pure
|
||||
virtual AllocatedPath MapFS(const char *uri_utf8) const;
|
||||
virtual AllocatedPath MapFS(const char *uri_utf8) const noexcept;
|
||||
|
||||
gcc_pure
|
||||
AllocatedPath MapChildFS(const char *uri_utf8,
|
||||
const char *child_utf8) const;
|
||||
const char *child_utf8) const noexcept;
|
||||
|
||||
/**
|
||||
* Check if the given URI points inside this storage. If yes,
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
* string); if not, returns nullptr.
|
||||
*/
|
||||
gcc_pure
|
||||
virtual const char *MapToRelativeUTF8(const char *uri_utf8) const = 0;
|
||||
virtual const char *MapToRelativeUTF8(const char *uri_utf8) const noexcept = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -65,13 +65,13 @@ public:
|
||||
|
||||
StorageDirectoryReader *OpenDirectory(const char *uri_utf8) override;
|
||||
|
||||
std::string MapUTF8(const char *uri_utf8) const override;
|
||||
std::string MapUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const override;
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const noexcept override;
|
||||
};
|
||||
|
||||
std::string
|
||||
CurlStorage::MapUTF8(const char *uri_utf8) const
|
||||
CurlStorage::MapUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
assert(uri_utf8 != nullptr);
|
||||
|
||||
@@ -84,7 +84,7 @@ CurlStorage::MapUTF8(const char *uri_utf8) const
|
||||
}
|
||||
|
||||
const char *
|
||||
CurlStorage::MapToRelativeUTF8(const char *uri_utf8) const
|
||||
CurlStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
// TODO: escape/unescape?
|
||||
|
||||
@@ -435,7 +435,7 @@ CurlStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow)
|
||||
|
||||
gcc_pure
|
||||
static const char *
|
||||
UriPathOrSlash(const char *uri)
|
||||
UriPathOrSlash(const char *uri) noexcept
|
||||
{
|
||||
const char *path = uri_get_path(uri);
|
||||
if (path == nullptr)
|
||||
|
@@ -61,17 +61,16 @@ public:
|
||||
|
||||
StorageDirectoryReader *OpenDirectory(const char *uri_utf8) override;
|
||||
|
||||
std::string MapUTF8(const char *uri_utf8) const override;
|
||||
std::string MapUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
AllocatedPath MapFS(const char *uri_utf8) const override;
|
||||
AllocatedPath MapFS(const char *uri_utf8) const noexcept override;
|
||||
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const override;
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
private:
|
||||
AllocatedPath MapFSOrThrow(const char *uri_utf8) const;
|
||||
};
|
||||
|
||||
gcc_pure
|
||||
static StorageFileInfo
|
||||
Stat(Path path, bool follow)
|
||||
{
|
||||
@@ -97,7 +96,7 @@ Stat(Path path, bool follow)
|
||||
}
|
||||
|
||||
std::string
|
||||
LocalStorage::MapUTF8(const char *uri_utf8) const
|
||||
LocalStorage::MapUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
assert(uri_utf8 != nullptr);
|
||||
|
||||
@@ -120,7 +119,7 @@ LocalStorage::MapFSOrThrow(const char *uri_utf8) const
|
||||
}
|
||||
|
||||
AllocatedPath
|
||||
LocalStorage::MapFS(const char *uri_utf8) const
|
||||
LocalStorage::MapFS(const char *uri_utf8) const noexcept
|
||||
{
|
||||
try {
|
||||
return MapFSOrThrow(uri_utf8);
|
||||
@@ -130,7 +129,7 @@ LocalStorage::MapFS(const char *uri_utf8) const
|
||||
}
|
||||
|
||||
const char *
|
||||
LocalStorage::MapToRelativeUTF8(const char *uri_utf8) const
|
||||
LocalStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
return PathTraitsUTF8::Relative(base_utf8.c_str(), uri_utf8);
|
||||
}
|
||||
@@ -149,7 +148,7 @@ LocalStorage::OpenDirectory(const char *uri_utf8)
|
||||
|
||||
gcc_pure
|
||||
static bool
|
||||
SkipNameFS(PathTraitsFS::const_pointer_type name_fs)
|
||||
SkipNameFS(PathTraitsFS::const_pointer_type name_fs) noexcept
|
||||
{
|
||||
return name_fs[0] == '.' &&
|
||||
(name_fs[1] == 0 ||
|
||||
|
@@ -87,9 +87,9 @@ public:
|
||||
|
||||
StorageDirectoryReader *OpenDirectory(const char *uri_utf8) override;
|
||||
|
||||
std::string MapUTF8(const char *uri_utf8) const override;
|
||||
std::string MapUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const override;
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
/* virtual methods from NfsLease */
|
||||
void OnNfsConnectionReady() final {
|
||||
@@ -223,7 +223,7 @@ UriToNfsPath(const char *_uri_utf8)
|
||||
}
|
||||
|
||||
std::string
|
||||
NfsStorage::MapUTF8(const char *uri_utf8) const
|
||||
NfsStorage::MapUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
assert(uri_utf8 != nullptr);
|
||||
|
||||
@@ -234,7 +234,7 @@ NfsStorage::MapUTF8(const char *uri_utf8) const
|
||||
}
|
||||
|
||||
const char *
|
||||
NfsStorage::MapToRelativeUTF8(const char *uri_utf8) const
|
||||
NfsStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
return PathTraitsUTF8::Relative(base.c_str(), uri_utf8);
|
||||
}
|
||||
@@ -291,7 +291,7 @@ NfsStorage::GetInfo(const char *uri_utf8, gcc_unused bool follow)
|
||||
|
||||
gcc_pure
|
||||
static bool
|
||||
SkipNameFS(const char *name)
|
||||
SkipNameFS(const char *name) noexcept
|
||||
{
|
||||
return name[0] == '.' &&
|
||||
(name[1] == 0 ||
|
||||
|
@@ -69,13 +69,13 @@ public:
|
||||
|
||||
StorageDirectoryReader *OpenDirectory(const char *uri_utf8) override;
|
||||
|
||||
std::string MapUTF8(const char *uri_utf8) const override;
|
||||
std::string MapUTF8(const char *uri_utf8) const noexcept override;
|
||||
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const override;
|
||||
const char *MapToRelativeUTF8(const char *uri_utf8) const noexcept override;
|
||||
};
|
||||
|
||||
std::string
|
||||
SmbclientStorage::MapUTF8(const char *uri_utf8) const
|
||||
SmbclientStorage::MapUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
assert(uri_utf8 != nullptr);
|
||||
|
||||
@@ -86,7 +86,7 @@ SmbclientStorage::MapUTF8(const char *uri_utf8) const
|
||||
}
|
||||
|
||||
const char *
|
||||
SmbclientStorage::MapToRelativeUTF8(const char *uri_utf8) const
|
||||
SmbclientStorage::MapToRelativeUTF8(const char *uri_utf8) const noexcept
|
||||
{
|
||||
return PathTraitsUTF8::Relative(base.c_str(), uri_utf8);
|
||||
}
|
||||
@@ -143,7 +143,7 @@ SmbclientStorage::OpenDirectory(const char *uri_utf8)
|
||||
|
||||
gcc_pure
|
||||
static bool
|
||||
SkipNameFS(const char *name)
|
||||
SkipNameFS(const char *name) noexcept
|
||||
{
|
||||
return name[0] == '.' &&
|
||||
(name[1] == 0 ||
|
||||
|
Reference in New Issue
Block a user