summaryrefslogtreecommitdiff
path: root/src/storage
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2017-05-15 23:01:49 +0200
committerMax Kellermann <max@musicpd.org>2017-05-15 23:01:49 +0200
commit4faef28cc56c3ed72a22dbd1cb317cf756217400 (patch)
treef2a3e8168ce9efada0fd0afe9971f90f0dee12b4 /src/storage
parent89b900432e0bfb324356f6ae62a09241eb75d251 (diff)
parentb4c9d9c2a72fbf2c6c9090c73fe37fcc94dce1ca (diff)
Merge tag 'v0.20.7'
release v0.20.7
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/CompositeStorage.cxx16
-rw-r--r--src/storage/CompositeStorage.hxx16
-rw-r--r--src/storage/Configured.cxx2
-rw-r--r--src/storage/Configured.hxx2
-rw-r--r--src/storage/Registry.cxx2
-rw-r--r--src/storage/Registry.hxx2
-rw-r--r--src/storage/StorageInterface.cxx4
-rw-r--r--src/storage/StorageInterface.hxx8
-rw-r--r--src/storage/plugins/CurlStorage.cxx10
-rw-r--r--src/storage/plugins/LocalStorage.cxx15
-rw-r--r--src/storage/plugins/NfsStorage.cxx10
-rw-r--r--src/storage/plugins/SmbclientStorage.cxx10
12 files changed, 48 insertions, 49 deletions
diff --git a/src/storage/CompositeStorage.cxx b/src/storage/CompositeStorage.cxx
index 660e12f7b..f96a84bc3 100644
--- a/src/storage/CompositeStorage.cxx
+++ b/src/storage/CompositeStorage.cxx
@@ -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);
diff --git a/src/storage/CompositeStorage.hxx b/src/storage/CompositeStorage.hxx
index 96909c559..db71fad8f 100644
--- a/src/storage/CompositeStorage.hxx
+++ b/src/storage/CompositeStorage.hxx
@@ -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;
diff --git a/src/storage/Configured.cxx b/src/storage/Configured.cxx
index f0e7598c0..4b2cc1b5c 100644
--- a/src/storage/Configured.cxx
+++ b/src/storage/Configured.cxx
@@ -73,7 +73,7 @@ CreateConfiguredStorage(EventLoop &event_loop)
}
bool
-IsStorageConfigured()
+IsStorageConfigured() noexcept
{
return config_get_string(ConfigOption::MUSIC_DIR) != nullptr;
}
diff --git a/src/storage/Configured.hxx b/src/storage/Configured.hxx
index ec813f313..4b630af04 100644
--- a/src/storage/Configured.hxx
+++ b/src/storage/Configured.hxx
@@ -40,6 +40,6 @@ CreateConfiguredStorage(EventLoop &event_loop);
*/
gcc_const
bool
-IsStorageConfigured();
+IsStorageConfigured() noexcept;
#endif
diff --git a/src/storage/Registry.cxx b/src/storage/Registry.cxx
index d0104359c..a919bd9da 100644
--- a/src/storage/Registry.cxx
+++ b/src/storage/Registry.cxx
@@ -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;
diff --git a/src/storage/Registry.hxx b/src/storage/Registry.hxx
index e0930fd29..998756da7 100644
--- a/src/storage/Registry.hxx
+++ b/src/storage/Registry.hxx
@@ -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 *
diff --git a/src/storage/StorageInterface.cxx b/src/storage/StorageInterface.cxx
index a8d1597cf..a0e8ab460 100644
--- a/src/storage/StorageInterface.cxx
+++ b/src/storage/StorageInterface.cxx
@@ -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());
diff --git a/src/storage/StorageInterface.hxx b/src/storage/StorageInterface.hxx
index 86f21b0ea..57d15ab15 100644
--- a/src/storage/StorageInterface.hxx
+++ b/src/storage/StorageInterface.hxx
@@ -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
diff --git a/src/storage/plugins/CurlStorage.cxx b/src/storage/plugins/CurlStorage.cxx
index 24b5709a1..e8291f1bf 100644
--- a/src/storage/plugins/CurlStorage.cxx
+++ b/src/storage/plugins/CurlStorage.cxx
@@ -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)
diff --git a/src/storage/plugins/LocalStorage.cxx b/src/storage/plugins/LocalStorage.cxx
index 59e0c34f3..816286b1b 100644
--- a/src/storage/plugins/LocalStorage.cxx
+++ b/src/storage/plugins/LocalStorage.cxx
@@ -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 ||
diff --git a/src/storage/plugins/NfsStorage.cxx b/src/storage/plugins/NfsStorage.cxx
index fcf083b02..a544e8460 100644
--- a/src/storage/plugins/NfsStorage.cxx
+++ b/src/storage/plugins/NfsStorage.cxx
@@ -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 ||
diff --git a/src/storage/plugins/SmbclientStorage.cxx b/src/storage/plugins/SmbclientStorage.cxx
index 4254d6e9f..a87cdd569 100644
--- a/src/storage/plugins/SmbclientStorage.cxx
+++ b/src/storage/plugins/SmbclientStorage.cxx
@@ -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 ||