make several member functions const

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev 2021-08-26 13:06:52 -07:00
parent 9ca64d5fb3
commit 53ffcf455c
7 changed files with 15 additions and 15 deletions

View File

@ -194,7 +194,7 @@ struct Instance final
#endif
#ifdef ENABLE_SQLITE
bool HasStickerDatabase() noexcept {
bool HasStickerDatabase() const noexcept {
return sticker_database != nullptr;
}
#endif

View File

@ -143,34 +143,34 @@ struct DecoderPlugin {
scan_stream(_scan_stream) {}
constexpr auto WithInit(bool (*_init)(const ConfigBlock &block),
void (*_finish)() noexcept = nullptr) noexcept {
void (*_finish)() noexcept = nullptr) const noexcept {
auto copy = *this;
copy.init = _init;
copy.finish = _finish;
return copy;
}
constexpr auto WithContainer(std::forward_list<DetachedSong> (*_container_scan)(Path path_fs)) noexcept {
constexpr auto WithContainer(std::forward_list<DetachedSong> (*_container_scan)(Path path_fs)) const noexcept {
auto copy = *this;
copy.container_scan = _container_scan;
return copy;
}
constexpr auto WithProtocols(std::set<std::string> (*_protocols)() noexcept,
void (*_uri_decode)(DecoderClient &client, const char *uri)) noexcept {
void (*_uri_decode)(DecoderClient &client, const char *uri)) const noexcept {
auto copy = *this;
copy.protocols = _protocols;
copy.uri_decode = _uri_decode;
return copy;
}
constexpr auto WithSuffixes(const char *const*_suffixes) noexcept {
constexpr auto WithSuffixes(const char *const*_suffixes) const noexcept {
auto copy = *this;
copy.suffixes = _suffixes;
return copy;
}
constexpr auto WithMimeTypes(const char *const*_mime_types) noexcept {
constexpr auto WithMimeTypes(const char *const*_mime_types) const noexcept {
auto copy = *this;
copy.mime_types = _mime_types;
return copy;

View File

@ -75,7 +75,7 @@ InputCacheManager::Flush() noexcept
}
bool
InputCacheManager::IsEligible(const InputStream &input) noexcept
InputCacheManager::IsEligible(const InputStream &input) const noexcept
{
assert(input.IsReady());

View File

@ -98,7 +98,7 @@ private:
* Check whether the given #InputStream can be stored in this
* cache.
*/
bool IsEligible(const InputStream &input) noexcept;
bool IsEligible(const InputStream &input) const noexcept;
void Remove(InputCacheItem &item) noexcept;
void Delete(InputCacheItem *item) noexcept;

View File

@ -66,7 +66,7 @@ public:
return *pipe;
}
bool IsInitial() {
bool IsInitial() const {
return chunk == nullptr;
}

View File

@ -85,32 +85,32 @@ struct PlaylistPlugin {
:name(_name), open_stream(_open_stream) {}
constexpr auto WithInit(bool (*_init)(const ConfigBlock &block),
void (*_finish)() noexcept = nullptr) noexcept {
void (*_finish)() noexcept = nullptr) const noexcept {
auto copy = *this;
copy.init = _init;
copy.finish = _finish;
return copy;
}
constexpr auto WithSchemes(const char *const*_schemes) noexcept {
constexpr auto WithSchemes(const char *const*_schemes) const noexcept {
auto copy = *this;
copy.schemes = _schemes;
return copy;
}
constexpr auto WithSuffixes(const char *const*_suffixes) noexcept {
constexpr auto WithSuffixes(const char *const*_suffixes) const noexcept {
auto copy = *this;
copy.suffixes = _suffixes;
return copy;
}
constexpr auto WithMimeTypes(const char *const*_mime_types) noexcept {
constexpr auto WithMimeTypes(const char *const*_mime_types) const noexcept {
auto copy = *this;
copy.mime_types = _mime_types;
return copy;
}
constexpr auto WithAsFolder(bool value=true) noexcept {
constexpr auto WithAsFolder(bool value=true) const noexcept {
auto copy = *this;
copy.as_folder = value;
return copy;

View File

@ -49,7 +49,7 @@ public:
int index;
const char *value;
constexpr operator bool() noexcept {
constexpr operator bool() const noexcept {
return index >= 0;
}
};