more [[gnu::...]] attributes
This commit is contained in:
parent
1c4b484a56
commit
f510564d9d
@ -25,8 +25,6 @@
|
|||||||
#ifndef MPD_IDLE_FLAGS_HXX
|
#ifndef MPD_IDLE_FLAGS_HXX
|
||||||
#define MPD_IDLE_FLAGS_HXX
|
#define MPD_IDLE_FLAGS_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
/** song database has been updated*/
|
/** song database has been updated*/
|
||||||
static constexpr unsigned IDLE_DATABASE = 0x1;
|
static constexpr unsigned IDLE_DATABASE = 0x1;
|
||||||
|
|
||||||
@ -73,7 +71,7 @@ static constexpr unsigned IDLE_PARTITION = 0x2000;
|
|||||||
/**
|
/**
|
||||||
* Get idle names
|
* Get idle names
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
const char*const*
|
const char*const*
|
||||||
idle_get_names() noexcept;
|
idle_get_names() noexcept;
|
||||||
|
|
||||||
@ -81,7 +79,7 @@ idle_get_names() noexcept;
|
|||||||
* Parse an idle name and return its mask. Returns 0 if the given
|
* Parse an idle name and return its mask. Returns 0 if the given
|
||||||
* name is unknown.
|
* name is unknown.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all gcc_pure
|
[[gnu::nonnull]] [[gnu::pure]]
|
||||||
unsigned
|
unsigned
|
||||||
idle_parse_name(const char *name) noexcept;
|
idle_parse_name(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "event/Loop.hxx"
|
#include "event/Loop.hxx"
|
||||||
#include "event/Thread.hxx"
|
#include "event/Thread.hxx"
|
||||||
#include "event/MaskMonitor.hxx"
|
#include "event/MaskMonitor.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#ifdef ENABLE_SYSTEMD_DAEMON
|
#ifdef ENABLE_SYSTEMD_DAEMON
|
||||||
#include "lib/systemd/Watchdog.hxx"
|
#include "lib/systemd/Watchdog.hxx"
|
||||||
@ -168,7 +167,7 @@ struct Instance final
|
|||||||
* Find a #Partition with the given name. Returns nullptr if
|
* Find a #Partition with the given name. Returns nullptr if
|
||||||
* no such partition was found.
|
* no such partition was found.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Partition *FindPartition(const char *name) noexcept;
|
Partition *FindPartition(const char *name) noexcept;
|
||||||
|
|
||||||
void DeletePartition(Partition &partition) noexcept;
|
void DeletePartition(Partition &partition) noexcept;
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#ifndef MPD_MAPPER_HXX
|
#ifndef MPD_MAPPER_HXX
|
||||||
#define MPD_MAPPER_HXX
|
#define MPD_MAPPER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -44,7 +43,7 @@ mapper_init(AllocatedPath &&playlist_dir);
|
|||||||
* is basically done by converting the URI to the file system charset
|
* is basically done by converting the URI to the file system charset
|
||||||
* and prepending the music directory.
|
* and prepending the music directory.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AllocatedPath
|
AllocatedPath
|
||||||
map_uri_fs(const char *uri) noexcept;
|
map_uri_fs(const char *uri) noexcept;
|
||||||
|
|
||||||
@ -56,7 +55,7 @@ map_uri_fs(const char *uri) noexcept;
|
|||||||
* @return the relative path in UTF-8, or an empty string if mapping
|
* @return the relative path in UTF-8, or an empty string if mapping
|
||||||
* failed
|
* failed
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::string
|
std::string
|
||||||
map_fs_to_utf8(Path path_fs) noexcept;
|
map_fs_to_utf8(Path path_fs) noexcept;
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ map_fs_to_utf8(Path path_fs) noexcept;
|
|||||||
/**
|
/**
|
||||||
* Returns the playlist directory.
|
* Returns the playlist directory.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
const AllocatedPath &
|
const AllocatedPath &
|
||||||
map_spl_path() noexcept;
|
map_spl_path() noexcept;
|
||||||
|
|
||||||
@ -75,7 +74,7 @@ map_spl_path() noexcept;
|
|||||||
*
|
*
|
||||||
* @return the path in file system encoding, or nullptr if mapping failed
|
* @return the path in file system encoding, or nullptr if mapping failed
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AllocatedPath
|
AllocatedPath
|
||||||
map_spl_utf8_to_fs(const char *name) noexcept;
|
map_spl_utf8_to_fs(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_MIX_RAMP_INFO_HXX
|
#ifndef MPD_MIX_RAMP_INFO_HXX
|
||||||
#define MPD_MIX_RAMP_INFO_HXX
|
#define MPD_MIX_RAMP_INFO_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
class MixRampInfo {
|
class MixRampInfo {
|
||||||
@ -35,17 +33,17 @@ public:
|
|||||||
end.clear();
|
end.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsDefined() const noexcept {
|
bool IsDefined() const noexcept {
|
||||||
return !start.empty() || !end.empty();
|
return !start.empty() || !end.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetStart() const noexcept {
|
const char *GetStart() const noexcept {
|
||||||
return start.empty() ? nullptr : start.c_str();
|
return start.empty() ? nullptr : start.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetEnd() const noexcept {
|
const char *GetEnd() const noexcept {
|
||||||
return end.empty() ? nullptr : end.c_str();
|
return end.empty() ? nullptr : end.c_str();
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ public:
|
|||||||
* is the same value which was passed to the constructor
|
* is the same value which was passed to the constructor
|
||||||
* music_buffer_new().
|
* music_buffer_new().
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
unsigned GetSize() const noexcept {
|
unsigned GetSize() const noexcept {
|
||||||
return buffer.GetCapacity();
|
return buffer.GetCapacity();
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,7 @@ struct MusicChunkInfo {
|
|||||||
* Checks if the audio format if the chunk is equal to the
|
* Checks if the audio format if the chunk is equal to the
|
||||||
* specified audio_format.
|
* specified audio_format.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool CheckFormat(AudioFormat audio_format) const noexcept;
|
bool CheckFormat(AudioFormat audio_format) const noexcept;
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "MusicChunkPtr.hxx"
|
#include "MusicChunkPtr.hxx"
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
#include "pcm/AudioFormat.hxx"
|
#include "pcm/AudioFormat.hxx"
|
||||||
@ -59,7 +58,7 @@ public:
|
|||||||
* Checks if the audio format if the chunk is equal to the specified
|
* Checks if the audio format if the chunk is equal to the specified
|
||||||
* audio_format.
|
* audio_format.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool CheckFormat(AudioFormat other) const noexcept {
|
bool CheckFormat(AudioFormat other) const noexcept {
|
||||||
return !audio_format.IsDefined() ||
|
return !audio_format.IsDefined() ||
|
||||||
audio_format == other;
|
audio_format == other;
|
||||||
@ -68,7 +67,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Checks if the specified chunk is enqueued in the music pipe.
|
* Checks if the specified chunk is enqueued in the music pipe.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Contains(const MusicChunk *chunk) const noexcept;
|
bool Contains(const MusicChunk *chunk) const noexcept;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -76,7 +75,7 @@ public:
|
|||||||
* Returns the first #MusicChunk from the pipe. Returns
|
* Returns the first #MusicChunk from the pipe. Returns
|
||||||
* nullptr if the pipe is empty.
|
* nullptr if the pipe is empty.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const MusicChunk *Peek() const noexcept {
|
const MusicChunk *Peek() const noexcept {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return head.get();
|
return head.get();
|
||||||
@ -100,13 +99,13 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns the number of chunks currently in this pipe.
|
* Returns the number of chunks currently in this pipe.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
unsigned GetSize() const noexcept {
|
unsigned GetSize() const noexcept {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
return GetSize() == 0;
|
return GetSize() == 0;
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_REPLAY_GAIN_INFO_HXX
|
#ifndef MPD_REPLAY_GAIN_INFO_HXX
|
||||||
#define MPD_REPLAY_GAIN_INFO_HXX
|
#define MPD_REPLAY_GAIN_INFO_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "ReplayGainMode.hxx"
|
#include "ReplayGainMode.hxx"
|
||||||
|
|
||||||
struct ReplayGainConfig;
|
struct ReplayGainConfig;
|
||||||
@ -42,7 +41,7 @@ struct ReplayGainTuple {
|
|||||||
return {-200.0f, 0.0f};
|
return {-200.0f, 0.0f};
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
float CalculateScale(const ReplayGainConfig &config) const noexcept;
|
float CalculateScale(const ReplayGainConfig &config) const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ReplayGainMode.hxx"
|
#include "ReplayGainMode.hxx"
|
||||||
|
#include "util/Compiler.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_REPLAY_GAIN_MODE_HXX
|
#ifndef MPD_REPLAY_GAIN_MODE_HXX
|
||||||
#define MPD_REPLAY_GAIN_MODE_HXX
|
#define MPD_REPLAY_GAIN_MODE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
enum class ReplayGainMode : uint8_t {
|
enum class ReplayGainMode : uint8_t {
|
||||||
@ -34,7 +32,7 @@ enum class ReplayGainMode : uint8_t {
|
|||||||
/**
|
/**
|
||||||
* Return the string representation of a #ReplayGainMode.
|
* Return the string representation of a #ReplayGainMode.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *
|
const char *
|
||||||
ToString(ReplayGainMode mode) noexcept;
|
ToString(ReplayGainMode mode) noexcept;
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "SingleMode.hxx"
|
#include "SingleMode.hxx"
|
||||||
|
#include "util/Compiler.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_SINGLE_MODE_HXX
|
#ifndef MPD_SINGLE_MODE_HXX
|
||||||
#define MPD_SINGLE_MODE_HXX
|
#define MPD_SINGLE_MODE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
enum class SingleMode : uint8_t {
|
enum class SingleMode : uint8_t {
|
||||||
@ -33,7 +31,7 @@ enum class SingleMode : uint8_t {
|
|||||||
/**
|
/**
|
||||||
* Return the string representation of a #SingleMode.
|
* Return the string representation of a #SingleMode.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *
|
const char *
|
||||||
SingleToString(SingleMode mode) noexcept;
|
SingleToString(SingleMode mode) noexcept;
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_SONG_LOADER_HXX
|
#ifndef MPD_SONG_LOADER_HXX
|
||||||
#define MPD_SONG_LOADER_HXX
|
#define MPD_SONG_LOADER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@ -72,14 +71,14 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Throws #std::runtime_error on error.
|
* Throws #std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
DetachedSong LoadSong(const char *uri_utf8) const;
|
DetachedSong LoadSong(const char *uri_utf8) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
DetachedSong LoadFromDatabase(const char *uri) const;
|
DetachedSong LoadFromDatabase(const char *uri) const;
|
||||||
|
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
DetachedSong LoadFile(const char *path_utf8, Path path_fs) const;
|
DetachedSong LoadFile(const char *path_utf8, Path path_fs) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "StateFileConfig.hxx"
|
#include "StateFileConfig.hxx"
|
||||||
#include "event/FarTimerEvent.hxx"
|
#include "event/FarTimerEvent.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -76,7 +75,7 @@ private:
|
|||||||
* Check if MPD's state was modified since the last
|
* Check if MPD's state was modified since the last
|
||||||
* RememberVersions() call.
|
* RememberVersions() call.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsModified() const noexcept;
|
bool IsModified() const noexcept;
|
||||||
|
|
||||||
/* callback for #timer_event */
|
/* callback for #timer_event */
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "tag/Mask.hxx"
|
#include "tag/Mask.hxx"
|
||||||
#include "event/FullyBufferedSocket.hxx"
|
#include "event/FullyBufferedSocket.hxx"
|
||||||
#include "event/CoarseTimerEvent.hxx"
|
#include "event/CoarseTimerEvent.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <boost/intrusive/link_mode.hpp>
|
#include <boost/intrusive/link_mode.hpp>
|
||||||
#include <boost/intrusive/list_hook.hpp>
|
#include <boost/intrusive/list_hook.hpp>
|
||||||
@ -138,7 +137,7 @@ public:
|
|||||||
using FullyBufferedSocket::GetEventLoop;
|
using FullyBufferedSocket::GetEventLoop;
|
||||||
using FullyBufferedSocket::GetOutputMaxSize;
|
using FullyBufferedSocket::GetOutputMaxSize;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsExpired() const noexcept {
|
bool IsExpired() const noexcept {
|
||||||
return !FullyBufferedSocket::IsDefined();
|
return !FullyBufferedSocket::IsDefined();
|
||||||
}
|
}
|
||||||
@ -211,7 +210,7 @@ public:
|
|||||||
FULL,
|
FULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsSubscribed(const char *channel_name) const noexcept {
|
bool IsSubscribed(const char *channel_name) const noexcept {
|
||||||
return subscriptions.find(channel_name) != subscriptions.end();
|
return subscriptions.find(channel_name) != subscriptions.end();
|
||||||
}
|
}
|
||||||
@ -252,19 +251,19 @@ public:
|
|||||||
|
|
||||||
void SetPartition(Partition &new_partition) noexcept;
|
void SetPartition(Partition &new_partition) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Instance &GetInstance() const noexcept;
|
Instance &GetInstance() const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
playlist &GetPlaylist() const noexcept;
|
playlist &GetPlaylist() const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
PlayerControl &GetPlayerControl() const noexcept;
|
PlayerControl &GetPlayerControl() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper for Instance::GetDatabase().
|
* Wrapper for Instance::GetDatabase().
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const Database *GetDatabase() const noexcept;
|
const Database *GetDatabase() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -272,7 +271,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
const Database &GetDatabaseOrThrow() const;
|
const Database &GetDatabaseOrThrow() const;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const Storage *GetStorage() const noexcept;
|
const Storage *GetStorage() const noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_CLIENT_MESSAGE_HXX
|
#ifndef MPD_CLIENT_MESSAGE_HXX
|
||||||
#define MPD_CLIENT_MESSAGE_HXX
|
#define MPD_CLIENT_MESSAGE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
@ -51,7 +49,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
client_message_valid_channel_name(const char *name) noexcept;
|
client_message_valid_channel_name(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -21,14 +21,13 @@
|
|||||||
#define MPD_NEIGHBOR_COMMANDS_HXX
|
#define MPD_NEIGHBOR_COMMANDS_HXX
|
||||||
|
|
||||||
#include "CommandResult.hxx"
|
#include "CommandResult.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
struct Instance;
|
struct Instance;
|
||||||
class Client;
|
class Client;
|
||||||
class Request;
|
class Request;
|
||||||
class Response;
|
class Response;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
neighbor_commands_available(const Instance &instance) noexcept;
|
neighbor_commands_available(const Instance &instance) noexcept;
|
||||||
|
|
||||||
|
@ -21,13 +21,12 @@
|
|||||||
#define MPD_PLAYLIST_COMMANDS_HXX
|
#define MPD_PLAYLIST_COMMANDS_HXX
|
||||||
|
|
||||||
#include "CommandResult.hxx"
|
#include "CommandResult.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
class Client;
|
class Client;
|
||||||
class Request;
|
class Request;
|
||||||
class Response;
|
class Response;
|
||||||
|
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
bool
|
bool
|
||||||
playlist_commands_available() noexcept;
|
playlist_commands_available() noexcept;
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_CONFIG_BLOCK_HXX
|
#ifndef MPD_CONFIG_BLOCK_HXX
|
||||||
#define MPD_CONFIG_BLOCK_HXX
|
#define MPD_CONFIG_BLOCK_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
@ -39,7 +37,7 @@ struct BlockParam {
|
|||||||
mutable bool used = false;
|
mutable bool used = false;
|
||||||
|
|
||||||
template<typename N, typename V>
|
template<typename N, typename V>
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
BlockParam(N &&_name, V &&_value, int _line=-1) noexcept
|
BlockParam(N &&_name, V &&_value, int _line=-1) noexcept
|
||||||
:name(std::forward<N>(_name)), value(std::forward<V>(_value)),
|
:name(std::forward<N>(_name)), value(std::forward<V>(_value)),
|
||||||
line(_line) {}
|
line(_line) {}
|
||||||
@ -99,7 +97,7 @@ struct ConfigBlock {
|
|||||||
return line < 0;
|
return line < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
return block_params.empty();
|
return block_params.empty();
|
||||||
}
|
}
|
||||||
@ -109,17 +107,17 @@ struct ConfigBlock {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<typename N, typename V>
|
template<typename N, typename V>
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
void AddBlockParam(N &&_name, V &&_value, int _line=-1) noexcept {
|
void AddBlockParam(N &&_name, V &&_value, int _line=-1) noexcept {
|
||||||
block_params.emplace_back(std::forward<N>(_name),
|
block_params.emplace_back(std::forward<N>(_name),
|
||||||
std::forward<V>(_value),
|
std::forward<V>(_value),
|
||||||
_line);
|
_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_nonnull_all gcc_pure
|
[[gnu::nonnull]] [[gnu::pure]]
|
||||||
const BlockParam *GetBlockParam(const char *_name) const noexcept;
|
const BlockParam *GetBlockParam(const char *_name) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetBlockValue(const char *name,
|
const char *GetBlockValue(const char *name,
|
||||||
const char *default_value=nullptr) const noexcept;
|
const char *default_value=nullptr) const noexcept;
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ struct ConfigData {
|
|||||||
|
|
||||||
void AddParam(ConfigOption option, ConfigParam &¶m) noexcept;
|
void AddParam(ConfigOption option, ConfigParam &¶m) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const ConfigParam *GetParam(ConfigOption option) const noexcept {
|
const ConfigParam *GetParam(ConfigOption option) const noexcept {
|
||||||
const auto &list = GetParamList(option);
|
const auto &list = GetParamList(option);
|
||||||
return list.empty() ? nullptr : &list.front();
|
return list.empty() ? nullptr : &list.front();
|
||||||
@ -60,7 +60,7 @@ struct ConfigData {
|
|||||||
: f(nullptr);
|
: f(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetString(ConfigOption option,
|
const char *GetString(ConfigOption option,
|
||||||
const char *default_value=nullptr) const noexcept;
|
const char *default_value=nullptr) const noexcept;
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ struct ConfigData {
|
|||||||
ConfigBlock &AddBlock(ConfigBlockOption option,
|
ConfigBlock &AddBlock(ConfigBlockOption option,
|
||||||
ConfigBlock &&block) noexcept;
|
ConfigBlock &&block) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const ConfigBlock *GetBlock(ConfigBlockOption option) const noexcept {
|
const ConfigBlock *GetBlock(ConfigBlockOption option) const noexcept {
|
||||||
const auto &list = GetBlockList(option);
|
const auto &list = GetBlockList(option);
|
||||||
return list.empty() ? nullptr : &list.front();
|
return list.empty() ? nullptr : &list.front();
|
||||||
@ -115,7 +115,7 @@ struct ConfigData {
|
|||||||
* @param key the attribute name
|
* @param key the attribute name
|
||||||
* @param value the expected attribute value
|
* @param value the expected attribute value
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const ConfigBlock *FindBlock(ConfigBlockOption option,
|
const ConfigBlock *FindBlock(ConfigBlockOption option,
|
||||||
const char *key, const char *value) const;
|
const char *key, const char *value) const;
|
||||||
|
|
||||||
|
@ -102,14 +102,14 @@ enum class ConfigBlockOption {
|
|||||||
/**
|
/**
|
||||||
* @return #ConfigOption::MAX if not found
|
* @return #ConfigOption::MAX if not found
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
enum ConfigOption
|
enum ConfigOption
|
||||||
ParseConfigOptionName(const char *name) noexcept;
|
ParseConfigOptionName(const char *name) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return #ConfigOption::MAX if not found
|
* @return #ConfigOption::MAX if not found
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
enum ConfigBlockOption
|
enum ConfigBlockOption
|
||||||
ParseConfigBlockOptionName(const char *name) noexcept;
|
ParseConfigBlockOptionName(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ struct ConfigParam {
|
|||||||
:line(_line) {}
|
:line(_line) {}
|
||||||
|
|
||||||
template<typename V>
|
template<typename V>
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
explicit ConfigParam(V &&_value, int _line=-1) noexcept
|
explicit ConfigParam(V &&_value, int _line=-1) noexcept
|
||||||
:value(std::forward<V>(_value)), line(_line) {}
|
:value(std::forward<V>(_value)), line(_line) {}
|
||||||
|
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#define MPD_DB_LOCK_HXX
|
#define MPD_DB_LOCK_HXX
|
||||||
|
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@ -42,7 +41,7 @@ extern ThreadId db_mutex_holder;
|
|||||||
/**
|
/**
|
||||||
* Does the current thread hold the database lock?
|
* Does the current thread hold the database lock?
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static inline bool
|
static inline bool
|
||||||
holding_db_lock() noexcept
|
holding_db_lock() noexcept
|
||||||
{
|
{
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "Visitor.hxx"
|
#include "Visitor.hxx"
|
||||||
#include "tag/Type.h"
|
#include "tag/Type.h"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -136,7 +135,7 @@ public:
|
|||||||
* Returns the time stamp of the last database update.
|
* Returns the time stamp of the last database update.
|
||||||
* Returns a negative value if that is not not known/available.
|
* Returns a negative value if that is not not known/available.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual std::chrono::system_clock::time_point GetUpdateStamp() const noexcept = 0;
|
virtual std::chrono::system_clock::time_point GetUpdateStamp() const noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,12 +20,9 @@
|
|||||||
#ifndef MPD_LIGHT_DIRECTORY_HXX
|
#ifndef MPD_LIGHT_DIRECTORY_HXX
|
||||||
#define MPD_LIGHT_DIRECTORY_HXX
|
#define MPD_LIGHT_DIRECTORY_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
#include <chrono>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
struct Tag;
|
struct Tag;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,7 +50,7 @@ struct LightDirectory {
|
|||||||
return *uri == 0;
|
return *uri == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetPath() const noexcept {
|
const char *GetPath() const noexcept {
|
||||||
return uri;
|
return uri;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_PLAYLIST_INFO_HXX
|
#ifndef MPD_PLAYLIST_INFO_HXX
|
||||||
#define MPD_PLAYLIST_INFO_HXX
|
#define MPD_PLAYLIST_INFO_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <chrono>
|
#include <chrono>
|
||||||
@ -49,7 +47,7 @@ struct PlaylistInfo {
|
|||||||
constexpr CompareName(std::string_view _name) noexcept
|
constexpr CompareName(std::string_view _name) noexcept
|
||||||
:name(_name) {}
|
:name(_name) {}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const PlaylistInfo &pi) const noexcept {
|
bool operator()(const PlaylistInfo &pi) const noexcept {
|
||||||
return pi.name == name;
|
return pi.name == name;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_PLAYLIST_VECTOR_HXX
|
#define MPD_PLAYLIST_VECTOR_HXX
|
||||||
|
|
||||||
#include "db/PlaylistInfo.hxx"
|
#include "db/PlaylistInfo.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@ -31,7 +30,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* Caller must lock the #db_mutex.
|
* Caller must lock the #db_mutex.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
iterator find(std::string_view name) noexcept;
|
iterator find(std::string_view name) noexcept;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_DATABASE_REGISTRY_HXX
|
#ifndef MPD_DATABASE_REGISTRY_HXX
|
||||||
#define MPD_DATABASE_REGISTRY_HXX
|
#define MPD_DATABASE_REGISTRY_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
struct DatabasePlugin;
|
struct DatabasePlugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -30,7 +28,7 @@ struct DatabasePlugin;
|
|||||||
*/
|
*/
|
||||||
extern const DatabasePlugin *const database_plugins[];
|
extern const DatabasePlugin *const database_plugins[];
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const DatabasePlugin *
|
const DatabasePlugin *
|
||||||
GetDatabasePluginByName(const char *name) noexcept;
|
GetDatabasePluginByName(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "protocol/RangeArg.hxx"
|
#include "protocol/RangeArg.hxx"
|
||||||
#include "tag/Type.h"
|
#include "tag/Type.h"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -60,16 +59,16 @@ struct DatabaseSelection {
|
|||||||
DatabaseSelection(const char *_uri, bool _recursive,
|
DatabaseSelection(const char *_uri, bool _recursive,
|
||||||
const SongFilter *_filter=nullptr) noexcept;
|
const SongFilter *_filter=nullptr) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept;
|
bool IsEmpty() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does this selection contain constraints other than "base"?
|
* Does this selection contain constraints other than "base"?
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool HasOtherThanBase() const noexcept;
|
bool HasOtherThanBase() const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Match(const LightSong &song) const noexcept;
|
bool Match(const LightSong &song) const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_DIRECTORY_HXX
|
#define MPD_DIRECTORY_HXX
|
||||||
|
|
||||||
#include "Ptr.hxx"
|
#include "Ptr.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "db/Visitor.hxx"
|
#include "db/Visitor.hxx"
|
||||||
#include "db/PlaylistVector.hxx"
|
#include "db/PlaylistVector.hxx"
|
||||||
#include "db/Ptr.hxx"
|
#include "db/Ptr.hxx"
|
||||||
@ -113,7 +112,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Create a new root #Directory object.
|
* Create a new root #Directory object.
|
||||||
*/
|
*/
|
||||||
gcc_malloc gcc_returns_nonnull
|
[[gnu::malloc]] [[gnu::returns_nonnull]]
|
||||||
static Directory *NewRoot() noexcept {
|
static Directory *NewRoot() noexcept {
|
||||||
return new Directory(std::string(), nullptr);
|
return new Directory(std::string(), nullptr);
|
||||||
}
|
}
|
||||||
@ -141,7 +140,7 @@ public:
|
|||||||
* (e.g. #DEVICE_PLAYLIST) and whether the underlying plugin
|
* (e.g. #DEVICE_PLAYLIST) and whether the underlying plugin
|
||||||
* is available.
|
* is available.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsPluginAvailable() const noexcept;
|
bool IsPluginAvailable() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -164,10 +163,10 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Caller must lock the #db_mutex.
|
* Caller must lock the #db_mutex.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const Directory *FindChild(std::string_view name) const noexcept;
|
const Directory *FindChild(std::string_view name) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Directory *FindChild(std::string_view name) noexcept {
|
Directory *FindChild(std::string_view name) noexcept {
|
||||||
const Directory *cthis = this;
|
const Directory *cthis = this;
|
||||||
return const_cast<Directory *>(cthis->FindChild(name));
|
return const_cast<Directory *>(cthis->FindChild(name));
|
||||||
@ -211,20 +210,20 @@ public:
|
|||||||
*
|
*
|
||||||
* @param uri the relative URI
|
* @param uri the relative URI
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
LookupResult LookupDirectory(std::string_view uri) noexcept;
|
LookupResult LookupDirectory(std::string_view uri) noexcept;
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
bool TargetExists(std::string_view target) const noexcept;
|
bool TargetExists(std::string_view target) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
return children.empty() &&
|
return children.empty() &&
|
||||||
songs.empty() &&
|
songs.empty() &&
|
||||||
playlists.empty();
|
playlists.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetPath() const noexcept {
|
const char *GetPath() const noexcept {
|
||||||
return path.c_str();
|
return path.c_str();
|
||||||
}
|
}
|
||||||
@ -232,13 +231,13 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns the base name of the directory.
|
* Returns the base name of the directory.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetName() const noexcept;
|
const char *GetName() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Is this the root directory of the music database?
|
* Is this the root directory of the music database?
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsRoot() const noexcept {
|
bool IsRoot() const noexcept {
|
||||||
return parent == nullptr;
|
return parent == nullptr;
|
||||||
}
|
}
|
||||||
@ -266,10 +265,10 @@ public:
|
|||||||
*
|
*
|
||||||
* Caller must lock the #db_mutex.
|
* Caller must lock the #db_mutex.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const Song *FindSong(std::string_view name_utf8) const noexcept;
|
const Song *FindSong(std::string_view name_utf8) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Song *FindSong(std::string_view name_utf8) noexcept {
|
Song *FindSong(std::string_view name_utf8) noexcept {
|
||||||
const Directory *cthis = this;
|
const Directory *cthis = this;
|
||||||
return const_cast<Song *>(cthis->FindSong(name_utf8));
|
return const_cast<Song *>(cthis->FindSong(name_utf8));
|
||||||
@ -307,7 +306,7 @@ public:
|
|||||||
const VisitDirectory& visit_directory, const VisitSong& visit_song,
|
const VisitDirectory& visit_directory, const VisitSong& visit_song,
|
||||||
const VisitPlaylist& visit_playlist) const;
|
const VisitPlaylist& visit_playlist) const;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
LightDirectory Export() const noexcept;
|
LightDirectory Export() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#include "db/Ptr.hxx"
|
#include "db/Ptr.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "util/Manual.hxx"
|
#include "util/Manual.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -78,7 +77,7 @@ public:
|
|||||||
DatabaseListener &listener,
|
DatabaseListener &listener,
|
||||||
const ConfigBlock &block);
|
const ConfigBlock &block);
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Directory &GetRoot() noexcept {
|
Directory &GetRoot() noexcept {
|
||||||
assert(root != NULL);
|
assert(root != NULL);
|
||||||
|
|
||||||
@ -98,7 +97,7 @@ public:
|
|||||||
* @param db the #Database to be mounted; must be "open"; on
|
* @param db the #Database to be mounted; must be "open"; on
|
||||||
* success, this object gains ownership of the given #Database
|
* success, this object gains ownership of the given #Database
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
void Mount(const char *uri, DatabasePtr db);
|
void Mount(const char *uri, DatabasePtr db);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -106,10 +105,10 @@ public:
|
|||||||
*
|
*
|
||||||
* @return false if the mounted database needs to be updated
|
* @return false if the mounted database needs to be updated
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
bool Mount(const char *local_uri, const char *storage_uri);
|
bool Mount(const char *local_uri, const char *storage_uri);
|
||||||
|
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
bool Unmount(const char *uri) noexcept;
|
bool Unmount(const char *uri) noexcept;
|
||||||
|
|
||||||
/* virtual methods from class Database */
|
/* virtual methods from class Database */
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "Chrono.hxx"
|
#include "Chrono.hxx"
|
||||||
#include "tag/Tag.hxx"
|
#include "tag/Tag.hxx"
|
||||||
#include "pcm/AudioFormat.hxx"
|
#include "pcm/AudioFormat.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include <boost/intrusive/list.hpp>
|
||||||
@ -108,14 +107,14 @@ struct Song {
|
|||||||
|
|
||||||
Song(DetachedSong &&other, Directory &_parent) noexcept;
|
Song(DetachedSong &&other, Directory &_parent) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetFilenameSuffix() const noexcept;
|
const char *GetFilenameSuffix() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the decoder plugin for this song is
|
* Checks whether the decoder plugin for this song is
|
||||||
* available.
|
* available.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsPluginAvailable() const noexcept;
|
bool IsPluginAvailable() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -149,10 +148,10 @@ struct Song {
|
|||||||
* Returns the URI of the song in UTF-8 encoding, including its
|
* Returns the URI of the song in UTF-8 encoding, including its
|
||||||
* location within the music directory.
|
* location within the music directory.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::string GetURI() const noexcept;
|
std::string GetURI() const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
ExportedSong Export() const noexcept;
|
ExportedSong Export() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
/* this destructor exists here just so it won't get inlined */
|
/* this destructor exists here just so it won't get inlined */
|
||||||
UPnPDirContent::~UPnPDirContent() = default;
|
UPnPDirContent::~UPnPDirContent() = default;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static UPnPDirObject::ItemClass
|
static UPnPDirObject::ItemClass
|
||||||
ParseItemClass(StringView name) noexcept
|
ParseItemClass(StringView name) noexcept
|
||||||
{
|
{
|
||||||
@ -45,7 +45,7 @@ ParseItemClass(StringView name) noexcept
|
|||||||
return UPnPDirObject::ItemClass::UNKNOWN;
|
return UPnPDirObject::ItemClass::UNKNOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static SignedSongTime
|
static SignedSongTime
|
||||||
ParseDuration(const char *duration) noexcept
|
ParseDuration(const char *duration) noexcept
|
||||||
{
|
{
|
||||||
@ -73,7 +73,7 @@ ParseDuration(const char *duration) noexcept
|
|||||||
* elements. There is a very slight risk of collision in doing
|
* elements. There is a very slight risk of collision in doing
|
||||||
* this. Twonky returns directory names (titles) like 'Artist/Album'.
|
* this. Twonky returns directory names (titles) like 'Artist/Album'.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static std::string &&
|
static std::string &&
|
||||||
TitleToPathSegment(std::string &&s) noexcept
|
TitleToPathSegment(std::string &&s) noexcept
|
||||||
{
|
{
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_UPNP_DIRECTORY_HXX
|
#define MPD_UPNP_DIRECTORY_HXX
|
||||||
|
|
||||||
#include "Object.hxx"
|
#include "Object.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -39,7 +38,7 @@ public:
|
|||||||
|
|
||||||
~UPnPDirContent();
|
~UPnPDirContent();
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
UPnPDirObject *FindObject(std::string_view name) noexcept {
|
UPnPDirObject *FindObject(std::string_view name) noexcept {
|
||||||
for (auto &o : objects)
|
for (auto &o : objects)
|
||||||
if (o.name == name)
|
if (o.name == name)
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_UPNP_OBJECT_HXX
|
#define MPD_UPNP_OBJECT_HXX
|
||||||
|
|
||||||
#include "tag/Tag.hxx"
|
#include "tag/Tag.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
@ -89,12 +88,12 @@ public:
|
|||||||
tag.Clear();
|
tag.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsRoot() const noexcept {
|
bool IsRoot() const noexcept {
|
||||||
return type == Type::CONTAINER && id == "0";
|
return type == Type::CONTAINER && id == "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Check() const noexcept {
|
bool Check() const noexcept {
|
||||||
return !id.empty() &&
|
return !id.empty() &&
|
||||||
/* root nodes don't need a parent id and a
|
/* root nodes don't need a parent id and a
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
#ifndef MPD_EXCLUDE_H
|
#ifndef MPD_EXCLUDE_H
|
||||||
#define MPD_EXCLUDE_H
|
#define MPD_EXCLUDE_H
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "fs/Glob.hxx"
|
#include "fs/Glob.hxx"
|
||||||
#include "input/Ptr.hxx"
|
#include "input/Ptr.hxx"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
@ -50,7 +49,7 @@ public:
|
|||||||
ExcludeList(const ExcludeList &_parent) noexcept
|
ExcludeList(const ExcludeList &_parent) noexcept
|
||||||
:parent(&_parent) {}
|
:parent(&_parent) {}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
#ifdef HAVE_CLASS_GLOB
|
#ifdef HAVE_CLASS_GLOB
|
||||||
return ((parent == nullptr) || parent->IsEmpty()) && patterns.empty();
|
return ((parent == nullptr) || parent->IsEmpty()) && patterns.empty();
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_UPDATE_QUEUE_HXX
|
#ifndef MPD_UPDATE_QUEUE_HXX
|
||||||
#define MPD_UPDATE_QUEUE_HXX
|
#define MPD_UPDATE_QUEUE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -61,7 +59,6 @@ class UpdateQueue {
|
|||||||
std::list<UpdateQueueItem> update_queue;
|
std::list<UpdateQueueItem> update_queue;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
gcc_nonnull_all
|
|
||||||
bool Push(SimpleDatabase &db, Storage &storage,
|
bool Push(SimpleDatabase &db, Storage &storage,
|
||||||
std::string_view path, bool discard, unsigned id) noexcept;
|
std::string_view path, bool discard, unsigned id) noexcept;
|
||||||
|
|
||||||
@ -71,10 +68,8 @@ public:
|
|||||||
update_queue.clear();
|
update_queue.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_nonnull_all
|
|
||||||
void Erase(SimpleDatabase &db) noexcept;
|
void Erase(SimpleDatabase &db) noexcept;
|
||||||
|
|
||||||
gcc_nonnull_all
|
|
||||||
void Erase(Storage &storage) noexcept;
|
void Erase(Storage &storage) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "Queue.hxx"
|
#include "Queue.hxx"
|
||||||
#include "event/InjectEvent.hxx"
|
#include "event/InjectEvent.hxx"
|
||||||
#include "thread/Thread.hxx"
|
#include "thread/Thread.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@ -90,7 +89,6 @@ public:
|
|||||||
* the whole music directory is updated
|
* the whole music directory is updated
|
||||||
* @return the job id
|
* @return the job id
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
|
||||||
unsigned Enqueue(std::string_view path, bool discard);
|
unsigned Enqueue(std::string_view path, bool discard);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_UPDATE_IO_HXX
|
#ifndef MPD_UPDATE_IO_HXX
|
||||||
#define MPD_UPDATE_IO_HXX
|
#define MPD_UPDATE_IO_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
struct Directory;
|
struct Directory;
|
||||||
@ -43,11 +41,11 @@ GetInfo(Storage &storage, const char *uri_utf8, StorageFileInfo &info) noexcept;
|
|||||||
bool
|
bool
|
||||||
GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info) noexcept;
|
GetInfo(StorageDirectoryReader &reader, StorageFileInfo &info) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
DirectoryExists(Storage &storage, const Directory &directory) noexcept;
|
DirectoryExists(Storage &storage, const Directory &directory) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
directory_child_is_regular(Storage &storage, const Directory &directory,
|
directory_child_is_regular(Storage &storage, const Directory &directory,
|
||||||
std::string_view name_utf8) noexcept;
|
std::string_view name_utf8) noexcept;
|
||||||
@ -55,7 +53,7 @@ directory_child_is_regular(Storage &storage, const Directory &directory,
|
|||||||
/**
|
/**
|
||||||
* Checks if the given permissions on the mapped file are given.
|
* Checks if the given permissions on the mapped file are given.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
directory_child_access(Storage &storage, const Directory &directory,
|
directory_child_access(Storage &storage, const Directory &directory,
|
||||||
std::string_view name, int mode) noexcept;
|
std::string_view name, int mode) noexcept;
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "Config.hxx"
|
#include "Config.hxx"
|
||||||
#include "Editor.hxx"
|
#include "Editor.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
@ -76,7 +75,7 @@ public:
|
|||||||
bool Walk(Directory &root, const char *path, bool discard) noexcept;
|
bool Walk(Directory &root, const char *path, bool discard) noexcept;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool SkipSymlink(const Directory *directory,
|
bool SkipSymlink(const Directory *directory,
|
||||||
std::string_view utf8_name) const noexcept;
|
std::string_view utf8_name) const noexcept;
|
||||||
|
|
||||||
|
@ -132,7 +132,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Caller must lock the #DecoderControl object.
|
* Caller must lock the #DecoderControl object.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool CheckCancelRead() const noexcept;
|
bool CheckCancelRead() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "Command.hxx"
|
#include "Command.hxx"
|
||||||
#include "Chrono.hxx"
|
#include "Chrono.hxx"
|
||||||
#include "input/Ptr.hxx"
|
#include "input/Ptr.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@ -57,7 +56,7 @@ public:
|
|||||||
* @return the current command, or DecoderCommand::NONE if there is no
|
* @return the current command, or DecoderCommand::NONE if there is no
|
||||||
* command pending
|
* command pending
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual DecoderCommand GetCommand() noexcept = 0;
|
virtual DecoderCommand GetCommand() noexcept = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -72,7 +71,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return the destination position for the seek
|
* @return the destination position for the seek
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual SongTime GetSeekTime() noexcept = 0;
|
virtual SongTime GetSeekTime() noexcept = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -80,7 +79,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @return the destination position for the seek in frames
|
* @return the destination position for the seek in frames
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual uint64_t GetSeekFrame() noexcept = 0;
|
virtual uint64_t GetSeekFrame() noexcept = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -229,7 +229,7 @@ public:
|
|||||||
state == DecoderState::ERROR;
|
state == DecoderState::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool LockIsIdle() const noexcept {
|
bool LockIsIdle() const noexcept {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return IsIdle();
|
return IsIdle();
|
||||||
@ -239,7 +239,7 @@ public:
|
|||||||
return state == DecoderState::START;
|
return state == DecoderState::START;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool LockIsStarting() const noexcept {
|
bool LockIsStarting() const noexcept {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return IsStarting();
|
return IsStarting();
|
||||||
@ -251,7 +251,7 @@ public:
|
|||||||
return state == DecoderState::ERROR;
|
return state == DecoderState::ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool LockHasFailed() const noexcept {
|
bool LockHasFailed() const noexcept {
|
||||||
const std::lock_guard<Mutex> protect(mutex);
|
const std::lock_guard<Mutex> protect(mutex);
|
||||||
return HasFailed();
|
return HasFailed();
|
||||||
@ -307,15 +307,15 @@ public:
|
|||||||
*
|
*
|
||||||
* Caller must lock the object.
|
* Caller must lock the object.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsCurrentSong(const DetachedSong &_song) const noexcept;
|
bool IsCurrentSong(const DetachedSong &_song) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsUnseekableCurrentSong(const DetachedSong &_song) const noexcept {
|
bool IsUnseekableCurrentSong(const DetachedSong &_song) const noexcept {
|
||||||
return !seekable && IsCurrentSong(_song);
|
return !seekable && IsCurrentSong(_song);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsSeekableCurrentSong(const DetachedSong &_song) const noexcept {
|
bool IsSeekableCurrentSong(const DetachedSong &_song) const noexcept {
|
||||||
return seekable && IsCurrentSong(_song);
|
return seekable && IsCurrentSong(_song);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_DECODER_BUFFER_HXX
|
#ifndef MPD_DECODER_BUFFER_HXX
|
||||||
#define MPD_DECODER_BUFFER_HXX
|
#define MPD_DECODER_BUFFER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "util/DynamicFifoBuffer.hxx"
|
#include "util/DynamicFifoBuffer.hxx"
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
|
|
||||||
@ -74,7 +73,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* How many bytes are stored in the buffer?
|
* How many bytes are stored in the buffer?
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
size_t GetAvailable() const noexcept {
|
size_t GetAvailable() const noexcept {
|
||||||
return buffer.GetAvailable();
|
return buffer.GetAvailable();
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_DECODER_LIST_HXX
|
#ifndef MPD_DECODER_LIST_HXX
|
||||||
#define MPD_DECODER_LIST_HXX
|
#define MPD_DECODER_LIST_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
struct ConfigData;
|
struct ConfigData;
|
||||||
@ -32,7 +30,7 @@ extern bool decoder_plugins_enabled[];
|
|||||||
|
|
||||||
/* interface for using plugins */
|
/* interface for using plugins */
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const struct DecoderPlugin *
|
const struct DecoderPlugin *
|
||||||
decoder_plugin_from_name(const char *name) noexcept;
|
decoder_plugin_from_name(const char *name) noexcept;
|
||||||
|
|
||||||
@ -98,7 +96,7 @@ decoder_plugins_for_each_enabled(F f)
|
|||||||
* Is there at least once #DecoderPlugin that supports the specified
|
* Is there at least once #DecoderPlugin that supports the specified
|
||||||
* file name suffix?
|
* file name suffix?
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
decoder_plugins_supports_suffix(std::string_view suffix) noexcept;
|
decoder_plugins_supports_suffix(std::string_view suffix) noexcept;
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_DECODER_PLUGIN_HXX
|
#ifndef MPD_DECODER_PLUGIN_HXX
|
||||||
#define MPD_DECODER_PLUGIN_HXX
|
#define MPD_DECODER_PLUGIN_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <forward_list> // IWYU pragma: export
|
#include <forward_list> // IWYU pragma: export
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -246,19 +244,19 @@ struct DecoderPlugin {
|
|||||||
return container_scan(path, tnum);
|
return container_scan(path, tnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool SupportsUri(const char *uri) const noexcept;
|
bool SupportsUri(const char *uri) const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the plugin announce the specified file name suffix?
|
* Does the plugin announce the specified file name suffix?
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
bool SupportsSuffix(std::string_view suffix) const noexcept;
|
bool SupportsSuffix(std::string_view suffix) const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does the plugin announce the specified MIME type?
|
* Does the plugin announce the specified MIME type?
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
bool SupportsMimeType(std::string_view mime_type) const noexcept;
|
bool SupportsMimeType(std::string_view mime_type) const noexcept;
|
||||||
|
|
||||||
bool SupportsContainerSuffix(std::string_view suffix) const noexcept {
|
bool SupportsContainerSuffix(std::string_view suffix) const noexcept {
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "util/ByteOrder.hxx"
|
#include "util/ByteOrder.hxx"
|
||||||
#include "input/Offset.hxx"
|
#include "input/Offset.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
@ -33,7 +32,7 @@ class InputStream;
|
|||||||
struct DsdId {
|
struct DsdId {
|
||||||
char value[4];
|
char value[4];
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Equals(const char *s) const noexcept;
|
bool Equals(const char *s) const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -70,7 +69,7 @@ dsdlib_skip(DecoderClient *client, InputStream &is,
|
|||||||
/**
|
/**
|
||||||
* Check if the sample frequency is a valid DSD frequency.
|
* Check if the sample frequency is a valid DSD frequency.
|
||||||
**/
|
**/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
bool
|
bool
|
||||||
dsdlib_valid_freq(uint32_t samplefreq) noexcept;
|
dsdlib_valid_freq(uint32_t samplefreq) noexcept;
|
||||||
|
|
||||||
|
@ -26,11 +26,9 @@
|
|||||||
#ifndef MPD_FILTER_REGISTRY_HXX
|
#ifndef MPD_FILTER_REGISTRY_HXX
|
||||||
#define MPD_FILTER_REGISTRY_HXX
|
#define MPD_FILTER_REGISTRY_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
struct FilterPlugin;
|
struct FilterPlugin;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const FilterPlugin *
|
const FilterPlugin *
|
||||||
filter_plugin_by_name(const char *name) noexcept;
|
filter_plugin_by_name(const char *name) noexcept;
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_FS_ALLOCATED_PATH_HXX
|
#ifndef MPD_FS_ALLOCATED_PATH_HXX
|
||||||
#define MPD_FS_ALLOCATED_PATH_HXX
|
#define MPD_FS_ALLOCATED_PATH_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "Traits.hxx"
|
#include "Traits.hxx"
|
||||||
#include "Path.hxx"
|
#include "Path.hxx"
|
||||||
|
|
||||||
@ -81,7 +80,7 @@ public:
|
|||||||
|
|
||||||
~AllocatedPath() noexcept;
|
~AllocatedPath() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
operator Path() const noexcept {
|
operator Path() const noexcept {
|
||||||
return Path::FromFS(c_str());
|
return Path::FromFS(c_str());
|
||||||
}
|
}
|
||||||
@ -89,40 +88,40 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Join two path components with the path separator.
|
* Join two path components with the path separator.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(string_view a, string_view b) noexcept {
|
static AllocatedPath Build(string_view a, string_view b) noexcept {
|
||||||
return AllocatedPath(Traits::Build(a, b));
|
return AllocatedPath(Traits::Build(a, b));
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(Path a, string_view b) noexcept {
|
static AllocatedPath Build(Path a, string_view b) noexcept {
|
||||||
return Build(a.c_str(), b);
|
return Build(a.c_str(), b);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(Path a, Path b) noexcept {
|
static AllocatedPath Build(Path a, Path b) noexcept {
|
||||||
return Build(a, b.c_str());
|
return Build(a, b.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(string_view a,
|
static AllocatedPath Build(string_view a,
|
||||||
const AllocatedPath &b) noexcept {
|
const AllocatedPath &b) noexcept {
|
||||||
return Build(a, b.value);
|
return Build(a, b.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(const AllocatedPath &a,
|
static AllocatedPath Build(const AllocatedPath &a,
|
||||||
string_view b) noexcept {
|
string_view b) noexcept {
|
||||||
return Build(a.value, b);
|
return Build(a.value, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath Build(const AllocatedPath &a,
|
static AllocatedPath Build(const AllocatedPath &a,
|
||||||
const AllocatedPath &b) noexcept {
|
const AllocatedPath &b) noexcept {
|
||||||
return Build(a.value, b.value);
|
return Build(a.value, b.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath Apply(Path base, Path path) noexcept {
|
static AllocatedPath Apply(Path base, Path path) noexcept {
|
||||||
return Traits::Apply(base.c_str(), path.c_str());
|
return Traits::Apply(base.c_str(), path.c_str());
|
||||||
}
|
}
|
||||||
@ -131,17 +130,17 @@ public:
|
|||||||
* Convert a C string that is already in the filesystem
|
* Convert a C string that is already in the filesystem
|
||||||
* character set to a #Path instance.
|
* character set to a #Path instance.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromFS(const_pointer fs) noexcept {
|
static AllocatedPath FromFS(const_pointer fs) noexcept {
|
||||||
return AllocatedPath(fs);
|
return AllocatedPath(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromFS(string_view fs) noexcept {
|
static AllocatedPath FromFS(string_view fs) noexcept {
|
||||||
return AllocatedPath(fs);
|
return AllocatedPath(fs);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromFS(const_pointer _begin,
|
static AllocatedPath FromFS(const_pointer _begin,
|
||||||
const_pointer _end) noexcept {
|
const_pointer _end) noexcept {
|
||||||
return AllocatedPath(_begin, _end);
|
return AllocatedPath(_begin, _end);
|
||||||
@ -151,13 +150,13 @@ public:
|
|||||||
* Convert a C++ string that is already in the filesystem
|
* Convert a C++ string that is already in the filesystem
|
||||||
* character set to a #Path instance.
|
* character set to a #Path instance.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromFS(string &&fs) noexcept {
|
static AllocatedPath FromFS(string &&fs) noexcept {
|
||||||
return AllocatedPath(std::move(fs));
|
return AllocatedPath(std::move(fs));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromUTF8(std::string &&utf8) noexcept {
|
static AllocatedPath FromUTF8(std::string &&utf8) noexcept {
|
||||||
/* on Android, the filesystem charset is hard-coded to
|
/* on Android, the filesystem charset is hard-coded to
|
||||||
UTF-8 */
|
UTF-8 */
|
||||||
@ -173,7 +172,7 @@ public:
|
|||||||
* Convert a UTF-8 C string to an #AllocatedPath instance.
|
* Convert a UTF-8 C string to an #AllocatedPath instance.
|
||||||
* Returns return a "nulled" instance on error.
|
* Returns return a "nulled" instance on error.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static AllocatedPath FromUTF8(std::string_view path_utf8) noexcept;
|
static AllocatedPath FromUTF8(std::string_view path_utf8) noexcept;
|
||||||
|
|
||||||
static AllocatedPath FromUTF8(const char *path_utf8) noexcept {
|
static AllocatedPath FromUTF8(const char *path_utf8) noexcept {
|
||||||
@ -199,12 +198,12 @@ public:
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator==(const AllocatedPath &other) const noexcept {
|
bool operator==(const AllocatedPath &other) const noexcept {
|
||||||
return value == other.value;
|
return value == other.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator!=(const AllocatedPath &other) const noexcept {
|
bool operator!=(const AllocatedPath &other) const noexcept {
|
||||||
return value != other.value;
|
return value != other.value;
|
||||||
}
|
}
|
||||||
@ -238,7 +237,7 @@ public:
|
|||||||
* @return the length of this string in number of "value_type"
|
* @return the length of this string in number of "value_type"
|
||||||
* elements (which may not be the number of characters).
|
* elements (which may not be the number of characters).
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
size_t length() const noexcept {
|
size_t length() const noexcept {
|
||||||
return value.length();
|
return value.length();
|
||||||
}
|
}
|
||||||
@ -248,7 +247,7 @@ public:
|
|||||||
* pointer is invalidated whenever the value of life of this
|
* pointer is invalidated whenever the value of life of this
|
||||||
* instance ends.
|
* instance ends.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer c_str() const noexcept {
|
const_pointer c_str() const noexcept {
|
||||||
return value.c_str();
|
return value.c_str();
|
||||||
}
|
}
|
||||||
@ -257,7 +256,7 @@ public:
|
|||||||
* Returns a pointer to the raw value, not necessarily
|
* Returns a pointer to the raw value, not necessarily
|
||||||
* null-terminated.
|
* null-terminated.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer data() const noexcept {
|
const_pointer data() const noexcept {
|
||||||
return value.data();
|
return value.data();
|
||||||
}
|
}
|
||||||
@ -267,7 +266,7 @@ public:
|
|||||||
* Returns empty string on error or if this instance is "nulled"
|
* Returns empty string on error or if this instance is "nulled"
|
||||||
* (#IsNull returns true).
|
* (#IsNull returns true).
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::string ToUTF8() const noexcept {
|
std::string ToUTF8() const noexcept {
|
||||||
return ((Path)*this).ToUTF8();
|
return ((Path)*this).ToUTF8();
|
||||||
}
|
}
|
||||||
@ -280,7 +279,7 @@ public:
|
|||||||
* Gets directory name of this path.
|
* Gets directory name of this path.
|
||||||
* Returns a "nulled" instance on error.
|
* Returns a "nulled" instance on error.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AllocatedPath GetDirectoryName() const noexcept {
|
AllocatedPath GetDirectoryName() const noexcept {
|
||||||
return ((Path)*this).GetDirectoryName();
|
return ((Path)*this).GetDirectoryName();
|
||||||
}
|
}
|
||||||
@ -291,12 +290,12 @@ public:
|
|||||||
* empty string if the given path equals this object or
|
* empty string if the given path equals this object or
|
||||||
* nullptr on mismatch.
|
* nullptr on mismatch.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer Relative(Path other_fs) const noexcept {
|
const_pointer Relative(Path other_fs) const noexcept {
|
||||||
return Traits::Relative(c_str(), other_fs.c_str());
|
return Traits::Relative(c_str(), other_fs.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer GetSuffix() const noexcept {
|
const_pointer GetSuffix() const noexcept {
|
||||||
return ((Path)*this).GetSuffix();
|
return ((Path)*this).GetSuffix();
|
||||||
}
|
}
|
||||||
@ -306,7 +305,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
void ChopSeparators() noexcept;
|
void ChopSeparators() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsAbsolute() const noexcept {
|
bool IsAbsolute() const noexcept {
|
||||||
return Traits::IsAbsolute(c_str());
|
return Traits::IsAbsolute(c_str());
|
||||||
}
|
}
|
||||||
|
@ -20,13 +20,12 @@
|
|||||||
#ifndef MPD_FS_CHARSET_HXX
|
#ifndef MPD_FS_CHARSET_HXX
|
||||||
#define MPD_FS_CHARSET_HXX
|
#define MPD_FS_CHARSET_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "Traits.hxx"
|
#include "Traits.hxx"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets file system character set name.
|
* Gets file system character set name.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
const char *
|
const char *
|
||||||
GetFSCharset() noexcept;
|
GetFSCharset() noexcept;
|
||||||
|
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CLASS_GLOB
|
#ifdef HAVE_CLASS_GLOB
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -48,7 +46,7 @@ public:
|
|||||||
Glob(Glob &&other) noexcept = default;
|
Glob(Glob &&other) noexcept = default;
|
||||||
Glob &operator=(Glob &&other) noexcept = default;
|
Glob &operator=(Glob &&other) noexcept = default;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Check(const char *name_fs) const noexcept;
|
bool Check(const char *name_fs) const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_FS_PATH_HXX
|
#ifndef MPD_FS_PATH_HXX
|
||||||
#define MPD_FS_PATH_HXX
|
#define MPD_FS_PATH_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "Traits.hxx"
|
#include "Traits.hxx"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
@ -88,7 +87,7 @@ public:
|
|||||||
* @return the length of this string in number of "value_type"
|
* @return the length of this string in number of "value_type"
|
||||||
* elements (which may not be the number of characters).
|
* elements (which may not be the number of characters).
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
size_t length() const noexcept {
|
size_t length() const noexcept {
|
||||||
assert(!IsNull());
|
assert(!IsNull());
|
||||||
|
|
||||||
@ -117,7 +116,7 @@ public:
|
|||||||
* usually rejected by MPD because its protocol cannot
|
* usually rejected by MPD because its protocol cannot
|
||||||
* transfer newline characters).
|
* transfer newline characters).
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool HasNewline() const noexcept {
|
bool HasNewline() const noexcept {
|
||||||
return Traits::Find(c_str(), '\n') != nullptr;
|
return Traits::Find(c_str(), '\n') != nullptr;
|
||||||
}
|
}
|
||||||
@ -127,7 +126,7 @@ public:
|
|||||||
* Returns empty string on error or if this instance is "nulled"
|
* Returns empty string on error or if this instance is "nulled"
|
||||||
* (#IsNull returns true).
|
* (#IsNull returns true).
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::string ToUTF8() const noexcept;
|
std::string ToUTF8() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -139,7 +138,7 @@ public:
|
|||||||
* Determine the "base" file name.
|
* Determine the "base" file name.
|
||||||
* The return value points inside this object.
|
* The return value points inside this object.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
Path GetBase() const noexcept {
|
Path GetBase() const noexcept {
|
||||||
return FromFS(Traits::GetBase(c_str()));
|
return FromFS(Traits::GetBase(c_str()));
|
||||||
}
|
}
|
||||||
@ -148,7 +147,7 @@ public:
|
|||||||
* Gets directory name of this path.
|
* Gets directory name of this path.
|
||||||
* Returns a "nulled" instance on error.
|
* Returns a "nulled" instance on error.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AllocatedPath GetDirectoryName() const noexcept;
|
AllocatedPath GetDirectoryName() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -157,17 +156,17 @@ public:
|
|||||||
* empty string if the given path equals this object or
|
* empty string if the given path equals this object or
|
||||||
* nullptr on mismatch.
|
* nullptr on mismatch.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer Relative(Path other_fs) const noexcept {
|
const_pointer Relative(Path other_fs) const noexcept {
|
||||||
return Traits::Relative(c_str(), other_fs.c_str());
|
return Traits::Relative(c_str(), other_fs.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsAbsolute() const noexcept {
|
bool IsAbsolute() const noexcept {
|
||||||
return Traits::IsAbsolute(c_str());
|
return Traits::IsAbsolute(c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_pointer GetSuffix() const noexcept;
|
const_pointer GetSuffix() const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ GetUserMusicDir() noexcept;
|
|||||||
/**
|
/**
|
||||||
* Obtains cache directory for the current user.
|
* Obtains cache directory for the current user.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
AllocatedPath
|
AllocatedPath
|
||||||
GetUserCacheDir() noexcept;
|
GetUserCacheDir() noexcept;
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ struct PathTraitsFS {
|
|||||||
ch == SEPARATOR;
|
ch == SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer FindLastSeparator(const_pointer p) noexcept {
|
static const_pointer FindLastSeparator(const_pointer p) noexcept {
|
||||||
#if !CLANG_CHECK_VERSION(3,6)
|
#if !CLANG_CHECK_VERSION(3,6)
|
||||||
/* disabled on clang due to -Wtautological-pointer-compare */
|
/* disabled on clang due to -Wtautological-pointer-compare */
|
||||||
@ -100,7 +100,7 @@ struct PathTraitsFS {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
||||||
const_pointer dot = StringFindLast(filename, '.');
|
const_pointer dot = StringFindLast(filename, '.');
|
||||||
return dot != nullptr && dot > filename && dot[1] != 0
|
return dot != nullptr && dot > filename && dot[1] != 0
|
||||||
@ -108,13 +108,13 @@ struct PathTraitsFS {
|
|||||||
: nullptr;
|
: nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const_pointer GetPathSuffix(const_pointer path) noexcept {
|
static const_pointer GetPathSuffix(const_pointer path) noexcept {
|
||||||
return GetFilenameSuffix(GetBase(path));
|
return GetFilenameSuffix(GetBase(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static constexpr bool IsDrive(const_pointer p) noexcept {
|
static constexpr bool IsDrive(const_pointer p) noexcept {
|
||||||
return IsAlphaASCII(p[0]) && p[1] == ':';
|
return IsAlphaASCII(p[0]) && p[1] == ':';
|
||||||
}
|
}
|
||||||
@ -124,7 +124,7 @@ struct PathTraitsFS {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static bool IsAbsolute(const_pointer p) noexcept {
|
static bool IsAbsolute(const_pointer p) noexcept {
|
||||||
#if !CLANG_CHECK_VERSION(3,6)
|
#if !CLANG_CHECK_VERSION(3,6)
|
||||||
/* disabled on clang due to -Wtautological-pointer-compare */
|
/* disabled on clang due to -Wtautological-pointer-compare */
|
||||||
@ -138,18 +138,18 @@ struct PathTraitsFS {
|
|||||||
return IsSeparator(*p);
|
return IsSeparator(*p);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static bool IsSpecialFilename(const_pointer name) noexcept {
|
static bool IsSpecialFilename(const_pointer name) noexcept {
|
||||||
return (name[0] == '.' && name[1] == 0) ||
|
return (name[0] == '.' && name[1] == 0) ||
|
||||||
(name[0] == '.' && name[1] == '.' && name[2] == 0);
|
(name[0] == '.' && name[1] == '.' && name[2] == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static size_t GetLength(const_pointer p) noexcept {
|
static size_t GetLength(const_pointer p) noexcept {
|
||||||
return StringLength(p);
|
return StringLength(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer Find(const_pointer p, value_type ch) noexcept {
|
static const_pointer Find(const_pointer p, value_type ch) noexcept {
|
||||||
return StringFind(p, ch);
|
return StringFind(p, ch);
|
||||||
}
|
}
|
||||||
@ -158,7 +158,7 @@ struct PathTraitsFS {
|
|||||||
* Determine the "base" file name of the given native path.
|
* Determine the "base" file name of the given native path.
|
||||||
* The return value points inside the given string.
|
* The return value points inside the given string.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer GetBase(const_pointer p) noexcept;
|
static const_pointer GetBase(const_pointer p) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -166,7 +166,7 @@ struct PathTraitsFS {
|
|||||||
* As a special case, returns the string "." if there is no
|
* As a special case, returns the string "." if there is no
|
||||||
* separator in the given input string.
|
* separator in the given input string.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static string_view GetParent(const_pointer p) noexcept;
|
static string_view GetParent(const_pointer p) noexcept;
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
@ -178,10 +178,10 @@ struct PathTraitsFS {
|
|||||||
* empty string if the given path equals this object or
|
* empty string if the given path equals this object or
|
||||||
* nullptr on mismatch.
|
* nullptr on mismatch.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer Relative(string_view base, const_pointer other) noexcept;
|
static const_pointer Relative(string_view base, const_pointer other) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static string_view Relative(string_view base, string_view other) noexcept;
|
static string_view Relative(string_view base, string_view other) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -190,14 +190,14 @@ struct PathTraitsFS {
|
|||||||
* remaining component is returned unchanged.
|
* remaining component is returned unchanged.
|
||||||
* If both components are empty strings, empty string is returned.
|
* If both components are empty strings, empty string is returned.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static string Build(string_view a, string_view b) noexcept;
|
static string Build(string_view a, string_view b) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interpret the given path as being relative to the given
|
* Interpret the given path as being relative to the given
|
||||||
* base, and return the concatenated path.
|
* base, and return the concatenated path.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static string Apply(const_pointer base,
|
static string Apply(const_pointer base,
|
||||||
const_pointer path) noexcept;
|
const_pointer path) noexcept;
|
||||||
};
|
};
|
||||||
@ -221,7 +221,7 @@ struct PathTraitsUTF8 {
|
|||||||
return ch == SEPARATOR;
|
return ch == SEPARATOR;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer FindLastSeparator(const_pointer p) noexcept {
|
static const_pointer FindLastSeparator(const_pointer p) noexcept {
|
||||||
#if !CLANG_CHECK_VERSION(3,6)
|
#if !CLANG_CHECK_VERSION(3,6)
|
||||||
/* disabled on clang due to -Wtautological-pointer-compare */
|
/* disabled on clang due to -Wtautological-pointer-compare */
|
||||||
@ -236,7 +236,7 @@ struct PathTraitsUTF8 {
|
|||||||
return StringFindLast(p.data(), SEPARATOR, p.size());
|
return StringFindLast(p.data(), SEPARATOR, p.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
static const_pointer GetFilenameSuffix(const_pointer filename) noexcept {
|
||||||
const_pointer dot = StringFindLast(filename, '.');
|
const_pointer dot = StringFindLast(filename, '.');
|
||||||
return dot != nullptr && dot > filename && dot[1] != 0
|
return dot != nullptr && dot > filename && dot[1] != 0
|
||||||
@ -244,13 +244,13 @@ struct PathTraitsUTF8 {
|
|||||||
: nullptr;
|
: nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const_pointer GetPathSuffix(const_pointer path) noexcept {
|
static const_pointer GetPathSuffix(const_pointer path) noexcept {
|
||||||
return GetFilenameSuffix(GetBase(path));
|
return GetFilenameSuffix(GetBase(path));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static constexpr bool IsDrive(const_pointer p) noexcept {
|
static constexpr bool IsDrive(const_pointer p) noexcept {
|
||||||
return IsAlphaASCII(p[0]) && p[1] == ':';
|
return IsAlphaASCII(p[0]) && p[1] == ':';
|
||||||
}
|
}
|
||||||
@ -260,7 +260,7 @@ struct PathTraitsUTF8 {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static bool IsAbsolute(const_pointer p) noexcept {
|
static bool IsAbsolute(const_pointer p) noexcept {
|
||||||
#if !CLANG_CHECK_VERSION(3,6)
|
#if !CLANG_CHECK_VERSION(3,6)
|
||||||
/* disabled on clang due to -Wtautological-pointer-compare */
|
/* disabled on clang due to -Wtautological-pointer-compare */
|
||||||
@ -281,18 +281,18 @@ struct PathTraitsUTF8 {
|
|||||||
[[gnu::pure]] [[gnu::nonnull]]
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static bool IsAbsoluteOrHasScheme(const_pointer p) noexcept;
|
static bool IsAbsoluteOrHasScheme(const_pointer p) noexcept;
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static bool IsSpecialFilename(const_pointer name) noexcept {
|
static bool IsSpecialFilename(const_pointer name) noexcept {
|
||||||
return (name[0] == '.' && name[1] == 0) ||
|
return (name[0] == '.' && name[1] == 0) ||
|
||||||
(name[0] == '.' && name[1] == '.' && name[2] == 0);
|
(name[0] == '.' && name[1] == '.' && name[2] == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static size_t GetLength(const_pointer p) noexcept {
|
static size_t GetLength(const_pointer p) noexcept {
|
||||||
return StringLength(p);
|
return StringLength(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer Find(const_pointer p, value_type ch) noexcept {
|
static const_pointer Find(const_pointer p, value_type ch) noexcept {
|
||||||
return StringFind(p, ch);
|
return StringFind(p, ch);
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ struct PathTraitsUTF8 {
|
|||||||
* Determine the "base" file name of the given UTF-8 path.
|
* Determine the "base" file name of the given UTF-8 path.
|
||||||
* The return value points inside the given string.
|
* The return value points inside the given string.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer GetBase(const_pointer p) noexcept;
|
static const_pointer GetBase(const_pointer p) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -309,7 +309,7 @@ struct PathTraitsUTF8 {
|
|||||||
* As a special case, returns the string "." if there is no
|
* As a special case, returns the string "." if there is no
|
||||||
* separator in the given input string.
|
* separator in the given input string.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static string_view GetParent(const_pointer p) noexcept;
|
static string_view GetParent(const_pointer p) noexcept;
|
||||||
|
|
||||||
[[gnu::pure]]
|
[[gnu::pure]]
|
||||||
@ -321,10 +321,10 @@ struct PathTraitsUTF8 {
|
|||||||
* empty string if the given path equals this object or
|
* empty string if the given path equals this object or
|
||||||
* nullptr on mismatch.
|
* nullptr on mismatch.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static const_pointer Relative(string_view base, const_pointer other) noexcept;
|
static const_pointer Relative(string_view base, const_pointer other) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static string_view Relative(string_view base, string_view other) noexcept;
|
static string_view Relative(string_view base, string_view other) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -333,7 +333,7 @@ struct PathTraitsUTF8 {
|
|||||||
* remaining component is returned unchanged.
|
* remaining component is returned unchanged.
|
||||||
* If both components are empty strings, empty string is returned.
|
* If both components are empty strings, empty string is returned.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static string Build(string_view a, string_view b) noexcept;
|
static string Build(string_view a, string_view b) noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ AutoGunzipReader::AutoGunzipReader(Reader &_next) noexcept
|
|||||||
|
|
||||||
AutoGunzipReader::~AutoGunzipReader() noexcept = default;
|
AutoGunzipReader::~AutoGunzipReader() noexcept = default;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static bool
|
static bool
|
||||||
IsGzip(const uint8_t data[4]) noexcept
|
IsGzip(const uint8_t data[4]) noexcept
|
||||||
{
|
{
|
||||||
|
@ -30,7 +30,6 @@
|
|||||||
#ifndef BUFFERED_READER_HXX
|
#ifndef BUFFERED_READER_HXX
|
||||||
#define BUFFERED_READER_HXX
|
#define BUFFERED_READER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "util/DynamicFifoBuffer.hxx"
|
#include "util/DynamicFifoBuffer.hxx"
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
@ -64,7 +63,7 @@ public:
|
|||||||
|
|
||||||
bool Fill(bool need_more);
|
bool Fill(bool need_more);
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
WritableBuffer<void> Read() const noexcept {
|
WritableBuffer<void> Read() const noexcept {
|
||||||
return buffer.Read().ToVoid();
|
return buffer.Read().ToVoid();
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include "OutputStream.hxx"
|
#include "OutputStream.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
#include "io/FileDescriptor.hxx"
|
#include "io/FileDescriptor.hxx"
|
||||||
@ -133,7 +132,7 @@ public:
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
uint64_t Tell() const noexcept;
|
uint64_t Tell() const noexcept;
|
||||||
|
|
||||||
/* virtual methods from class OutputStream */
|
/* virtual methods from class OutputStream */
|
||||||
|
@ -32,7 +32,6 @@
|
|||||||
|
|
||||||
#include "Reader.hxx"
|
#include "Reader.hxx"
|
||||||
#include "fs/AllocatedPath.hxx"
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <fileapi.h>
|
#include <fileapi.h>
|
||||||
@ -94,7 +93,7 @@ public:
|
|||||||
|
|
||||||
FileInfo GetFileInfo() const;
|
FileInfo GetFileInfo() const;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
uint64_t GetSize() const noexcept {
|
uint64_t GetSize() const noexcept {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LARGE_INTEGER size;
|
LARGE_INTEGER size;
|
||||||
@ -106,7 +105,7 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
uint64_t GetPosition() const noexcept {
|
uint64_t GetPosition() const noexcept {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
LARGE_INTEGER zero;
|
LARGE_INTEGER zero;
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#ifndef READER_HXX
|
#ifndef READER_HXX
|
||||||
#define READER_HXX
|
#define READER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,7 +50,7 @@ public:
|
|||||||
* @return the number of bytes read into the given buffer or 0
|
* @return the number of bytes read into the given buffer or 0
|
||||||
* on end-of-stream
|
* on end-of-stream
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
virtual size_t Read(void *data, size_t size) = 0;
|
virtual size_t Read(void *data, size_t size) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ protected:
|
|||||||
/**
|
/**
|
||||||
* Determine how many bytes can be added to the buffer.
|
* Determine how many bytes can be added to the buffer.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
size_t GetBufferSpace() const noexcept {
|
size_t GetBufferSpace() const noexcept {
|
||||||
return buffer.GetSpace();
|
return buffer.GetSpace();
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef INPUT_ERROR_HXX
|
#ifndef INPUT_ERROR_HXX
|
||||||
#define INPUT_ERROR_HXX
|
#define INPUT_ERROR_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <exception>
|
#include <exception>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -29,7 +27,7 @@
|
|||||||
* exist? This function attempts to recognize exceptions thrown by
|
* exist? This function attempts to recognize exceptions thrown by
|
||||||
* various input plugins.
|
* various input plugins.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
IsFileNotFound(std::exception_ptr e) noexcept;
|
IsFileNotFound(std::exception_ptr e) noexcept;
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_ICY_INPUT_STREAM_HXX
|
#define MPD_ICY_INPUT_STREAM_HXX
|
||||||
|
|
||||||
#include "ProxyInputStream.hxx"
|
#include "ProxyInputStream.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
@ -63,7 +62,7 @@ public:
|
|||||||
IcyInputStream(const IcyInputStream &) = delete;
|
IcyInputStream(const IcyInputStream &) = delete;
|
||||||
IcyInputStream &operator=(const IcyInputStream &) = delete;
|
IcyInputStream &operator=(const IcyInputStream &) = delete;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEnabled() const noexcept;
|
bool IsEnabled() const noexcept;
|
||||||
|
|
||||||
/* virtual methods from InputStream */
|
/* virtual methods from InputStream */
|
||||||
|
@ -22,7 +22,6 @@
|
|||||||
|
|
||||||
#include "Ptr.hxx"
|
#include "Ptr.hxx"
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <set>
|
#include <set>
|
||||||
@ -83,7 +82,7 @@ struct InputPlugin {
|
|||||||
std::unique_ptr<RemoteTagScanner> (*scan_tags)(const char *uri,
|
std::unique_ptr<RemoteTagScanner> (*scan_tags)(const char *uri,
|
||||||
RemoteTagHandler &handler) = nullptr;
|
RemoteTagHandler &handler) = nullptr;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool SupportsUri(const char *uri) const noexcept;
|
bool SupportsUri(const char *uri) const noexcept;
|
||||||
|
|
||||||
template<typename F>
|
template<typename F>
|
||||||
@ -103,7 +102,7 @@ struct InputPlugin {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
protocol_is_whitelisted(const char *proto) noexcept;
|
protocol_is_whitelisted(const char *proto) noexcept;
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
#include "Offset.hxx"
|
#include "Offset.hxx"
|
||||||
#include "Ptr.hxx"
|
#include "Ptr.hxx"
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -123,14 +122,12 @@ public:
|
|||||||
* notifications
|
* notifications
|
||||||
* @return an #InputStream object on success
|
* @return an #InputStream object on success
|
||||||
*/
|
*/
|
||||||
gcc_nonnull(1)
|
|
||||||
static InputStreamPtr Open(const char *uri, Mutex &mutex);
|
static InputStreamPtr Open(const char *uri, Mutex &mutex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Just like Open(), but waits for the stream to become ready.
|
* Just like Open(), but waits for the stream to become ready.
|
||||||
* It is a wrapper for Open(), WaitReady() and Check().
|
* It is a wrapper for Open(), WaitReady() and Check().
|
||||||
*/
|
*/
|
||||||
gcc_nonnull(1)
|
|
||||||
static InputStreamPtr OpenReady(const char *uri, Mutex &mutex);
|
static InputStreamPtr OpenReady(const char *uri, Mutex &mutex);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -184,14 +181,14 @@ public:
|
|||||||
return ready;
|
return ready;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool HasMimeType() const noexcept {
|
bool HasMimeType() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
|
|
||||||
return !mime.empty();
|
return !mime.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetMimeType() const noexcept {
|
const char *GetMimeType() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
|
|
||||||
@ -202,7 +199,7 @@ public:
|
|||||||
mime.clear();
|
mime.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
void SetMimeType(const char *_mime) noexcept {
|
void SetMimeType(const char *_mime) noexcept {
|
||||||
assert(!ready);
|
assert(!ready);
|
||||||
|
|
||||||
@ -215,14 +212,14 @@ public:
|
|||||||
mime = std::move(_mime);
|
mime = std::move(_mime);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool KnownSize() const noexcept {
|
bool KnownSize() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
|
|
||||||
return size != UNKNOWN_SIZE;
|
return size != UNKNOWN_SIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
offset_type GetSize() const noexcept {
|
offset_type GetSize() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
assert(KnownSize());
|
assert(KnownSize());
|
||||||
@ -236,14 +233,14 @@ public:
|
|||||||
offset += delta;
|
offset += delta;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
offset_type GetOffset() const noexcept {
|
offset_type GetOffset() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
|
|
||||||
return offset;
|
return offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
offset_type GetRest() const noexcept {
|
offset_type GetRest() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
assert(KnownSize());
|
assert(KnownSize());
|
||||||
@ -251,7 +248,7 @@ public:
|
|||||||
return size - offset;
|
return size - offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsSeekable() const noexcept {
|
bool IsSeekable() const noexcept {
|
||||||
assert(ready);
|
assert(ready);
|
||||||
|
|
||||||
@ -261,7 +258,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Determines whether seeking is cheap. This is true for local files.
|
* Determines whether seeking is cheap. This is true for local files.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool CheapSeeking() const noexcept;
|
bool CheapSeeking() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -313,14 +310,14 @@ public:
|
|||||||
*
|
*
|
||||||
* The caller must lock the mutex.
|
* The caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual bool IsEOF() const noexcept = 0;
|
virtual bool IsEOF() const noexcept = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Wrapper for IsEOF() which locks and unlocks the mutex; the
|
* Wrapper for IsEOF() which locks and unlocks the mutex; the
|
||||||
* caller must not be holding it already.
|
* caller must not be holding it already.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool LockIsEOF() const noexcept;
|
bool LockIsEOF() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -346,7 +343,7 @@ public:
|
|||||||
*
|
*
|
||||||
* The caller must lock the mutex.
|
* The caller must lock the mutex.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
virtual bool IsAvailable() const noexcept;
|
virtual bool IsAvailable() const noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -363,7 +360,7 @@ public:
|
|||||||
* @param size the maximum number of bytes to read
|
* @param size the maximum number of bytes to read
|
||||||
* @return the number of bytes read
|
* @return the number of bytes read
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
virtual size_t Read(std::unique_lock<Mutex> &lock,
|
virtual size_t Read(std::unique_lock<Mutex> &lock,
|
||||||
void *ptr, size_t size) = 0;
|
void *ptr, size_t size) = 0;
|
||||||
|
|
||||||
@ -373,7 +370,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
size_t LockRead(void *ptr, size_t size);
|
size_t LockRead(void *ptr, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -387,7 +384,7 @@ public:
|
|||||||
* @param size the number of bytes to read
|
* @param size the number of bytes to read
|
||||||
* @return true if the whole data was read, false otherwise.
|
* @return true if the whole data was read, false otherwise.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
void ReadFull(std::unique_lock<Mutex> &lock, void *ptr, size_t size);
|
void ReadFull(std::unique_lock<Mutex> &lock, void *ptr, size_t size);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -396,7 +393,7 @@ public:
|
|||||||
*
|
*
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
void LockReadFull(void *ptr, size_t size);
|
void LockReadFull(void *ptr, size_t size);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_INPUT_REGISTRY_HXX
|
#ifndef MPD_INPUT_REGISTRY_HXX
|
||||||
#define MPD_INPUT_REGISTRY_HXX
|
#define MPD_INPUT_REGISTRY_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* NULL terminated list of all input plugins which were enabled at
|
* NULL terminated list of all input plugins which were enabled at
|
||||||
* compile time.
|
* compile time.
|
||||||
@ -40,7 +38,7 @@ extern bool input_plugins_enabled[];
|
|||||||
input_plugins_for_each(plugin) \
|
input_plugins_for_each(plugin) \
|
||||||
if (input_plugins_enabled[input_plugin_iterator - input_plugins])
|
if (input_plugins_enabled[input_plugin_iterator - input_plugins])
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool
|
bool
|
||||||
HasRemoteTagScanner(const char *uri) noexcept;
|
HasRemoteTagScanner(const char *uri) noexcept;
|
||||||
|
|
||||||
|
9
src/input/cache/Manager.hxx
vendored
9
src/input/cache/Manager.hxx
vendored
@ -21,7 +21,6 @@
|
|||||||
#define MPD_INPUT_CACHE_MANAGER_HXX
|
#define MPD_INPUT_CACHE_MANAGER_HXX
|
||||||
|
|
||||||
#include "thread/Mutex.hxx"
|
#include "thread/Mutex.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <boost/intrusive/set.hpp>
|
#include <boost/intrusive/set.hpp>
|
||||||
#include <boost/intrusive/list.hpp>
|
#include <boost/intrusive/list.hpp>
|
||||||
@ -43,15 +42,15 @@ class InputCacheManager {
|
|||||||
size_t total_size = 0;
|
size_t total_size = 0;
|
||||||
|
|
||||||
struct ItemCompare {
|
struct ItemCompare {
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const InputCacheItem &a,
|
bool operator()(const InputCacheItem &a,
|
||||||
const char *b) const noexcept;
|
const char *b) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const char *a,
|
bool operator()(const char *a,
|
||||||
const InputCacheItem &b) const noexcept;
|
const InputCacheItem &b) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const InputCacheItem &a,
|
bool operator()(const InputCacheItem &a,
|
||||||
const InputCacheItem &b) const noexcept;
|
const InputCacheItem &b) const noexcept;
|
||||||
};
|
};
|
||||||
@ -74,7 +73,7 @@ public:
|
|||||||
|
|
||||||
void Flush() noexcept;
|
void Flush() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Contains(const char *uri) noexcept;
|
bool Contains(const char *uri) noexcept;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public:
|
|||||||
offset_type offset) override;
|
offset_type offset) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static inline bool
|
static inline bool
|
||||||
input_ffmpeg_supported() noexcept
|
input_ffmpeg_supported() noexcept
|
||||||
{
|
{
|
||||||
|
@ -77,7 +77,7 @@ public:
|
|||||||
return format_id;
|
return format_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
CurlGlobal &GetCurl() noexcept;
|
CurlGlobal &GetCurl() noexcept;
|
||||||
|
|
||||||
void AddLoginHandler(QobuzSessionHandler &h) noexcept;
|
void AddLoginHandler(QobuzSessionHandler &h) noexcept;
|
||||||
|
@ -166,7 +166,7 @@ FinishQobuzInput() noexcept
|
|||||||
delete qobuz_client;
|
delete qobuz_client;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const char *
|
static const char *
|
||||||
ExtractQobuzTrackId(const char *uri)
|
ExtractQobuzTrackId(const char *uri)
|
||||||
{
|
{
|
||||||
|
@ -48,10 +48,10 @@ class File : public LocalObject {
|
|||||||
public:
|
public:
|
||||||
using LocalObject::LocalObject;
|
using LocalObject::LocalObject;
|
||||||
|
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
static void Initialise(JNIEnv *env) noexcept;
|
static void Initialise(JNIEnv *env) noexcept;
|
||||||
|
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
static jstring GetAbsolutePath(JNIEnv *env, jobject file) noexcept {
|
static jstring GetAbsolutePath(JNIEnv *env, jobject file) noexcept {
|
||||||
return (jstring)env->CallObjectMethod(file,
|
return (jstring)env->CallObjectMethod(file,
|
||||||
getAbsolutePath_method);
|
getAbsolutePath_method);
|
||||||
@ -69,7 +69,7 @@ public:
|
|||||||
* Invoke File.getAbsolutePath() and release the
|
* Invoke File.getAbsolutePath() and release the
|
||||||
* specified File reference.
|
* specified File reference.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]] [[gnu::nonnull]]
|
||||||
static AllocatedPath ToAbsolutePath(JNIEnv *env,
|
static AllocatedPath ToAbsolutePath(JNIEnv *env,
|
||||||
jobject file) noexcept;
|
jobject file) noexcept;
|
||||||
};
|
};
|
||||||
|
@ -30,8 +30,6 @@
|
|||||||
#ifndef JAVA_GLOBAL_HXX
|
#ifndef JAVA_GLOBAL_HXX
|
||||||
#define JAVA_GLOBAL_HXX
|
#define JAVA_GLOBAL_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
namespace Java {
|
namespace Java {
|
||||||
@ -47,8 +45,9 @@ DetachCurrentThread() noexcept
|
|||||||
jvm->DetachCurrentThread();
|
jvm->DetachCurrentThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline gcc_pure
|
[[gnu::pure]]
|
||||||
JNIEnv *GetEnv() noexcept
|
static inline JNIEnv *
|
||||||
|
GetEnv() noexcept
|
||||||
{
|
{
|
||||||
JNIEnv *env;
|
JNIEnv *env;
|
||||||
jvm->AttachCurrentThread(&env, nullptr);
|
jvm->AttachCurrentThread(&env, nullptr);
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
* enum. Returns SND_PCM_FORMAT_UNKNOWN if there is no according ALSA
|
* enum. Returns SND_PCM_FORMAT_UNKNOWN if there is no according ALSA
|
||||||
* PCM format.
|
* PCM format.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
inline snd_pcm_format_t
|
inline snd_pcm_format_t
|
||||||
ToAlsaPcmFormat(SampleFormat sample_format) noexcept
|
ToAlsaPcmFormat(SampleFormat sample_format) noexcept
|
||||||
{
|
{
|
||||||
@ -82,7 +82,7 @@ ToAlsaPcmFormat(SampleFormat sample_format) noexcept
|
|||||||
* Determine the byte-swapped PCM format. Returns
|
* Determine the byte-swapped PCM format. Returns
|
||||||
* SND_PCM_FORMAT_UNKNOWN if the format cannot be byte-swapped.
|
* SND_PCM_FORMAT_UNKNOWN if the format cannot be byte-swapped.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
inline snd_pcm_format_t
|
inline snd_pcm_format_t
|
||||||
ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
||||||
{
|
{
|
||||||
@ -123,8 +123,7 @@ ByteSwapAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
|||||||
* Check if there is a "packed" version of the give PCM format.
|
* Check if there is a "packed" version of the give PCM format.
|
||||||
* Returns SND_PCM_FORMAT_UNKNOWN if not.
|
* Returns SND_PCM_FORMAT_UNKNOWN if not.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
constexpr snd_pcm_format_t
|
||||||
inline snd_pcm_format_t
|
|
||||||
PackAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
PackAlsaPcmFormat(snd_pcm_format_t fmt) noexcept
|
||||||
{
|
{
|
||||||
switch (fmt) {
|
switch (fmt) {
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static uint_least32_t
|
static uint_least32_t
|
||||||
ParseAlsaVersion(const char *p) noexcept
|
ParseAlsaVersion(const char *p) noexcept
|
||||||
{
|
{
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_ALSA_VERSION_HXX
|
#ifndef MPD_ALSA_VERSION_HXX
|
||||||
#define MPD_ALSA_VERSION_HXX
|
#define MPD_ALSA_VERSION_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
|
||||||
static constexpr uint_least32_t
|
static constexpr uint_least32_t
|
||||||
@ -35,7 +33,7 @@ MakeAlsaVersion(uint_least32_t major, uint_least32_t minor,
|
|||||||
* Wrapper for snd_asoundlib_version() which translates the resulting
|
* Wrapper for snd_asoundlib_version() which translates the resulting
|
||||||
* string to an integer constructed with MakeAlsaVersion().
|
* string to an integer constructed with MakeAlsaVersion().
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
uint_least32_t
|
uint_least32_t
|
||||||
GetRuntimeAlsaVersion() noexcept;
|
GetRuntimeAlsaVersion() noexcept;
|
||||||
|
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#define CDIO_PARANOIA_HXX
|
#define CDIO_PARANOIA_HXX
|
||||||
|
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <cdio/version.h>
|
#include <cdio/version.h>
|
||||||
#include <cdio/paranoia/paranoia.h>
|
#include <cdio/paranoia/paranoia.h>
|
||||||
@ -88,7 +87,7 @@ public:
|
|||||||
return std::pair(first, last);
|
return std::pair(first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsAudioTrack(track_t i) const noexcept {
|
bool IsAudioTrack(track_t i) const noexcept {
|
||||||
return cdio_cddap_track_audiop(drv, i);
|
return cdio_cddap_track_audiop(drv, i);
|
||||||
}
|
}
|
||||||
@ -101,7 +100,7 @@ public:
|
|||||||
return std::pair(first, last);
|
return std::pair(first, last);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
unsigned GetTrackCount() const noexcept {
|
unsigned GetTrackCount() const noexcept {
|
||||||
return cdio_cddap_tracks(drv);
|
return cdio_cddap_tracks(drv);
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#define MD5_HXX
|
#define MD5_HXX
|
||||||
|
|
||||||
#include "util/StringBuffer.hxx"
|
#include "util/StringBuffer.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -41,11 +40,11 @@ template<typename T> struct ConstBuffer;
|
|||||||
void
|
void
|
||||||
GlobalInitMD5() noexcept;
|
GlobalInitMD5() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::array<uint8_t, 16>
|
std::array<uint8_t, 16>
|
||||||
MD5(ConstBuffer<void> input) noexcept;
|
MD5(ConstBuffer<void> input) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
StringBuffer<33>
|
StringBuffer<33>
|
||||||
MD5Hex(ConstBuffer<void> input) noexcept;
|
MD5Hex(ConstBuffer<void> input) noexcept;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2018 Max Kellermann <max.kellermann@gmail.com>
|
* Copyright 2016-2021 Max Kellermann <max.kellermann@gmail.com>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions
|
* modification, are permitted provided that the following conditions
|
||||||
@ -31,7 +31,6 @@
|
|||||||
#define CURL_EASY_HXX
|
#define CURL_EASY_HXX
|
||||||
|
|
||||||
#include "String.hxx"
|
#include "String.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <curl/curl.h>
|
#include <curl/curl.h>
|
||||||
|
|
||||||
@ -199,7 +198,7 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Returns the response body's size, or -1 if that is unknown.
|
* Returns the response body's size, or -1 if that is unknown.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
int64_t GetContentLength() const noexcept {
|
int64_t GetContentLength() const noexcept {
|
||||||
double value;
|
double value;
|
||||||
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value)
|
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value)
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include "Request.hxx"
|
#include "Request.hxx"
|
||||||
#include "event/Loop.hxx"
|
#include "event/Loop.hxx"
|
||||||
#include "event/SocketEvent.hxx"
|
#include "event/SocketEvent.hxx"
|
||||||
|
#include "util/Compiler.h"
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
@ -84,7 +85,7 @@ private:
|
|||||||
(flags & SocketEvent::ERROR ? CURL_CSELECT_ERR : 0);
|
(flags & SocketEvent::ERROR ? CURL_CSELECT_ERR : 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static unsigned CurlPollToFlags(int action) noexcept {
|
static unsigned CurlPollToFlags(int action) noexcept {
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case CURL_POLL_NONE:
|
case CURL_POLL_NONE:
|
||||||
@ -172,7 +173,7 @@ CurlGlobal::Remove(CurlRequest &r) noexcept
|
|||||||
/**
|
/**
|
||||||
* Find a request by its CURL "easy" handle.
|
* Find a request by its CURL "easy" handle.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static CurlRequest *
|
static CurlRequest *
|
||||||
ToRequest(CURL *easy) noexcept
|
ToRequest(CURL *easy) noexcept
|
||||||
{
|
{
|
||||||
|
@ -172,7 +172,7 @@ CurlRequest::Done(CURLcode result) noexcept
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static bool
|
static bool
|
||||||
IsResponseBoundaryHeader(StringView s) noexcept
|
IsResponseBoundaryHeader(StringView s) noexcept
|
||||||
{
|
{
|
||||||
|
@ -30,9 +30,7 @@
|
|||||||
#ifndef CURL_VERSION_HXX
|
#ifndef CURL_VERSION_HXX
|
||||||
#define CURL_VERSION_HXX
|
#define CURL_VERSION_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
[[gnu::const]]
|
||||||
|
|
||||||
gcc_const
|
|
||||||
bool
|
bool
|
||||||
IsCurlOlderThan(unsigned version_num) noexcept;
|
IsCurlOlderThan(unsigned version_num) noexcept;
|
||||||
|
|
||||||
|
@ -33,8 +33,6 @@
|
|||||||
#ifndef ODBUS_ERROR_HXX
|
#ifndef ODBUS_ERROR_HXX
|
||||||
#define ODBUS_ERROR_HXX
|
#define ODBUS_ERROR_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <dbus/dbus.h>
|
#include <dbus/dbus.h>
|
||||||
|
|
||||||
namespace ODBus {
|
namespace ODBus {
|
||||||
@ -54,7 +52,7 @@ public:
|
|||||||
Error(const Error &) = delete;
|
Error(const Error &) = delete;
|
||||||
Error &operator=(const Error &) = delete;
|
Error &operator=(const Error &) = delete;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
operator bool() const noexcept {
|
operator bool() const noexcept {
|
||||||
return dbus_error_is_set(&error);
|
return dbus_error_is_set(&error);
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_EXPAT_HXX
|
#ifndef MPD_EXPAT_HXX
|
||||||
#define MPD_EXPAT_HXX
|
#define MPD_EXPAT_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <expat.h>
|
#include <expat.h>
|
||||||
|
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
@ -80,11 +78,11 @@ public:
|
|||||||
|
|
||||||
void Parse(InputStream &is);
|
void Parse(InputStream &is);
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const char *GetAttribute(const XML_Char **atts,
|
static const char *GetAttribute(const XML_Char **atts,
|
||||||
const char *name) noexcept;
|
const char *name) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const char *GetAttributeCase(const XML_Char **atts,
|
static const char *GetAttributeCase(const XML_Char **atts,
|
||||||
const char *name) noexcept;
|
const char *name) noexcept;
|
||||||
};
|
};
|
||||||
@ -117,13 +115,13 @@ public:
|
|||||||
parser.CompleteParse();
|
parser.CompleteParse();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const char *GetAttribute(const XML_Char **atts,
|
static const char *GetAttribute(const XML_Char **atts,
|
||||||
const char *name) noexcept {
|
const char *name) noexcept {
|
||||||
return ExpatParser::GetAttribute(atts, name);
|
return ExpatParser::GetAttribute(atts, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
static const char *GetAttributeCase(const XML_Char **atts,
|
static const char *GetAttributeCase(const XML_Char **atts,
|
||||||
const char *name) noexcept {
|
const char *name) noexcept {
|
||||||
return ExpatParser::GetAttributeCase(atts, name);
|
return ExpatParser::GetAttributeCase(atts, name);
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_FFMPEG_BUFFER_HXX
|
#ifndef MPD_FFMPEG_BUFFER_HXX
|
||||||
#define MPD_FFMPEG_BUFFER_HXX
|
#define MPD_FFMPEG_BUFFER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavutil/mem.h>
|
#include <libavutil/mem.h>
|
||||||
}
|
}
|
||||||
@ -42,7 +40,7 @@ public:
|
|||||||
FfmpegBuffer(const FfmpegBuffer &) = delete;
|
FfmpegBuffer(const FfmpegBuffer &) = delete;
|
||||||
FfmpegBuffer &operator=(const FfmpegBuffer &) = delete;
|
FfmpegBuffer &operator=(const FfmpegBuffer &) = delete;
|
||||||
|
|
||||||
gcc_malloc
|
[[gnu::malloc]]
|
||||||
void *Get(size_t min_size) noexcept {
|
void *Get(size_t min_size) noexcept {
|
||||||
av_fast_malloc(&data, &size, min_size);
|
av_fast_malloc(&data, &size, min_size);
|
||||||
return data;
|
return data;
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_FFMPEG_IO_CONTEXT_HXX
|
#ifndef MPD_FFMPEG_IO_CONTEXT_HXX
|
||||||
#define MPD_FFMPEG_IO_CONTEXT_HXX
|
#define MPD_FFMPEG_IO_CONTEXT_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "Error.hxx"
|
#include "Error.hxx"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
@ -65,12 +64,12 @@ public:
|
|||||||
return io_context;
|
return io_context;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
auto GetSize() const noexcept {
|
auto GetSize() const noexcept {
|
||||||
return avio_size(io_context);
|
return avio_size(io_context);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEOF() const noexcept {
|
bool IsEOF() const noexcept {
|
||||||
return avio_feof(io_context) != 0;
|
return avio_feof(io_context) != 0;
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_FFMPEG_TIME_HXX
|
#define MPD_FFMPEG_TIME_HXX
|
||||||
|
|
||||||
#include "Chrono.hxx"
|
#include "Chrono.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavutil/avutil.h>
|
#include <libavutil/avutil.h>
|
||||||
@ -41,7 +40,7 @@ static constexpr AVRational AV_TIME_BASE_Q{1, AV_TIME_BASE};
|
|||||||
/**
|
/**
|
||||||
* Convert a FFmpeg time stamp to a floating point value (in seconds).
|
* Convert a FFmpeg time stamp to a floating point value (in seconds).
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static inline FloatDuration
|
static inline FloatDuration
|
||||||
FfmpegTimeToDouble(int64_t t, const AVRational time_base) noexcept
|
FfmpegTimeToDouble(int64_t t, const AVRational time_base) noexcept
|
||||||
{
|
{
|
||||||
@ -64,7 +63,7 @@ RatioToAVRational()
|
|||||||
/**
|
/**
|
||||||
* Convert a FFmpeg time stamp to a #SongTime.
|
* Convert a FFmpeg time stamp to a #SongTime.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static inline SongTime
|
static inline SongTime
|
||||||
FromFfmpegTime(int64_t t, const AVRational time_base) noexcept
|
FromFfmpegTime(int64_t t, const AVRational time_base) noexcept
|
||||||
{
|
{
|
||||||
@ -77,7 +76,7 @@ FromFfmpegTime(int64_t t, const AVRational time_base) noexcept
|
|||||||
/**
|
/**
|
||||||
* Convert a FFmpeg time stamp to a #SignedSongTime.
|
* Convert a FFmpeg time stamp to a #SignedSongTime.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static inline SignedSongTime
|
static inline SignedSongTime
|
||||||
FromFfmpegTimeChecked(int64_t t, const AVRational time_base) noexcept
|
FromFfmpegTimeChecked(int64_t t, const AVRational time_base) noexcept
|
||||||
{
|
{
|
||||||
@ -89,7 +88,7 @@ FromFfmpegTimeChecked(int64_t t, const AVRational time_base) noexcept
|
|||||||
/**
|
/**
|
||||||
* Convert a #SongTime to a FFmpeg time stamp with the given base.
|
* Convert a #SongTime to a FFmpeg time stamp with the given base.
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
static inline int64_t
|
static inline int64_t
|
||||||
ToFfmpegTime(SongTime t, const AVRational time_base) noexcept
|
ToFfmpegTime(SongTime t, const AVRational time_base) noexcept
|
||||||
{
|
{
|
||||||
@ -104,7 +103,7 @@ ToFfmpegTime(SongTime t, const AVRational time_base) noexcept
|
|||||||
constexpr int64_t
|
constexpr int64_t
|
||||||
FfmpegTimestampFallback(int64_t t, int64_t fallback)
|
FfmpegTimestampFallback(int64_t t, int64_t fallback)
|
||||||
{
|
{
|
||||||
return gcc_likely(t != int64_t(AV_NOPTS_VALUE))
|
return t != int64_t(AV_NOPTS_VALUE)
|
||||||
? t
|
? t
|
||||||
: fallback;
|
: fallback;
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#define GCRYPT_HASH_HXX
|
#define GCRYPT_HASH_HXX
|
||||||
|
|
||||||
#include "util/ConstBuffer.hxx"
|
#include "util/ConstBuffer.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
|
|
||||||
@ -40,7 +39,7 @@
|
|||||||
namespace Gcrypt {
|
namespace Gcrypt {
|
||||||
|
|
||||||
template<int algo, size_t size>
|
template<int algo, size_t size>
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
auto
|
auto
|
||||||
Hash(ConstBuffer<void> input) noexcept
|
Hash(ConstBuffer<void> input) noexcept
|
||||||
{
|
{
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#define GCRYPT_MD5_HXX
|
#define GCRYPT_MD5_HXX
|
||||||
|
|
||||||
#include "util/StringBuffer.hxx"
|
#include "util/StringBuffer.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
@ -40,7 +39,7 @@ template<typename T> struct ConstBuffer;
|
|||||||
|
|
||||||
namespace Gcrypt {
|
namespace Gcrypt {
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::array<uint8_t, 16>
|
std::array<uint8_t, 16>
|
||||||
MD5(ConstBuffer<void> input) noexcept;
|
MD5(ConstBuffer<void> input) noexcept;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ IcuCollateFinish() noexcept
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
int
|
int
|
||||||
IcuCollate(std::string_view a, std::string_view b) noexcept
|
IcuCollate(std::string_view a, std::string_view b) noexcept
|
||||||
{
|
{
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_ICU_COLLATE_HXX
|
#ifndef MPD_ICU_COLLATE_HXX
|
||||||
#define MPD_ICU_COLLATE_HXX
|
#define MPD_ICU_COLLATE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +31,7 @@ IcuCollateInit();
|
|||||||
void
|
void
|
||||||
IcuCollateFinish() noexcept;
|
IcuCollateFinish() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
int
|
int
|
||||||
IcuCollate(std::string_view a, std::string_view b) noexcept;
|
IcuCollate(std::string_view a, std::string_view b) noexcept;
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_ICU_COMPARE_HXX
|
#ifndef MPD_ICU_COMPARE_HXX
|
||||||
#define MPD_ICU_COMPARE_HXX
|
#define MPD_ICU_COMPARE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "util/AllocatedString.hxx"
|
#include "util/AllocatedString.hxx"
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
@ -63,15 +62,15 @@ public:
|
|||||||
IcuCompare(IcuCompare &&) = default;
|
IcuCompare(IcuCompare &&) = default;
|
||||||
IcuCompare &operator=(IcuCompare &&) = default;
|
IcuCompare &operator=(IcuCompare &&) = default;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
operator bool() const noexcept {
|
operator bool() const noexcept {
|
||||||
return needle != nullptr;
|
return needle != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator==(const char *haystack) const noexcept;
|
bool operator==(const char *haystack) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsIn(const char *haystack) const noexcept;
|
bool IsIn(const char *haystack) const noexcept;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,7 +20,6 @@
|
|||||||
#ifndef MPD_ICU_CONVERTER_HXX
|
#ifndef MPD_ICU_CONVERTER_HXX
|
||||||
#define MPD_ICU_CONVERTER_HXX
|
#define MPD_ICU_CONVERTER_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifdef HAVE_ICU
|
#ifdef HAVE_ICU
|
||||||
@ -84,7 +83,6 @@ public:
|
|||||||
*
|
*
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
|
||||||
AllocatedString ToUTF8(std::string_view s) const;
|
AllocatedString ToUTF8(std::string_view s) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -92,7 +90,6 @@ public:
|
|||||||
*
|
*
|
||||||
* Throws std::runtime_error on error.
|
* Throws std::runtime_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_nonnull_all
|
|
||||||
AllocatedString FromUTF8(std::string_view s) const;
|
AllocatedString FromUTF8(std::string_view s) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_ICU_WIN32_HXX
|
#ifndef MPD_ICU_WIN32_HXX
|
||||||
#define MPD_ICU_WIN32_HXX
|
#define MPD_ICU_WIN32_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string_view>
|
#include <string_view>
|
||||||
|
|
||||||
class AllocatedString;
|
class AllocatedString;
|
||||||
@ -30,14 +28,14 @@ template<typename T> class BasicAllocatedString;
|
|||||||
/**
|
/**
|
||||||
* Throws std::system_error on error.
|
* Throws std::system_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
AllocatedString
|
AllocatedString
|
||||||
WideCharToMultiByte(unsigned code_page, std::wstring_view src);
|
WideCharToMultiByte(unsigned code_page, std::wstring_view src);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Throws std::system_error on error.
|
* Throws std::system_error on error.
|
||||||
*/
|
*/
|
||||||
gcc_pure gcc_nonnull_all
|
[[gnu::pure]]
|
||||||
BasicAllocatedString<wchar_t>
|
BasicAllocatedString<wchar_t>
|
||||||
MultiByteToWideChar(unsigned code_page, std::string_view src);
|
MultiByteToWideChar(unsigned code_page, std::string_view src);
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_NFS_BASE_HXX
|
#ifndef MPD_NFS_BASE_HXX
|
||||||
#define MPD_NFS_BASE_HXX
|
#define MPD_NFS_BASE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the "base" NFS server and export name. This will be the
|
* Set the "base" NFS server and export name. This will be the
|
||||||
* default export that will be mounted if a file within this export is
|
* default export that will be mounted if a file within this export is
|
||||||
@ -38,7 +36,7 @@ nfs_set_base(const char *server, const char *export_name) noexcept;
|
|||||||
* "path" after the export_name is returned; otherwise, nullptr is
|
* "path" after the export_name is returned; otherwise, nullptr is
|
||||||
* returned.
|
* returned.
|
||||||
*/
|
*/
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *
|
const char *
|
||||||
nfs_check_base(const char *server, const char *path) noexcept;
|
nfs_check_base(const char *server, const char *path) noexcept;
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_NFS_CANCELLABLE_HXX
|
#ifndef MPD_NFS_CANCELLABLE_HXX
|
||||||
#define MPD_NFS_CANCELLABLE_HXX
|
#define MPD_NFS_CANCELLABLE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <boost/intrusive/list.hpp>
|
#include <boost/intrusive/list.hpp>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -89,35 +87,35 @@ private:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
iterator Find(reference p) noexcept {
|
iterator Find(reference p) noexcept {
|
||||||
return std::find_if(list.begin(), list.end(), MatchPointer(p));
|
return std::find_if(list.begin(), list.end(), MatchPointer(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_iterator Find(const_reference p) const noexcept {
|
const_iterator Find(const_reference p) const noexcept {
|
||||||
return std::find_if(list.begin(), list.end(), MatchPointer(p));
|
return std::find_if(list.begin(), list.end(), MatchPointer(p));
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
iterator Find(CT &c) noexcept {
|
iterator Find(CT &c) noexcept {
|
||||||
return list.iterator_to(c);
|
return list.iterator_to(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const_iterator Find(const CT &c) const noexcept {
|
const_iterator Find(const CT &c) const noexcept {
|
||||||
return list.iterator_to(c);
|
return list.iterator_to(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool IsEmpty() const noexcept {
|
bool IsEmpty() const noexcept {
|
||||||
return std::all_of(list.begin(), list.end(), [](const auto &c) { return c.IsCancelled(); });
|
return std::all_of(list.begin(), list.end(), [](const auto &c) { return c.IsCancelled(); });
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Contains(const_reference p) const noexcept {
|
bool Contains(const_reference p) const noexcept {
|
||||||
return Find(p) != list.end();
|
return Find(p) != list.end();
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "event/SocketEvent.hxx"
|
#include "event/SocketEvent.hxx"
|
||||||
#include "event/CoarseTimerEvent.hxx"
|
#include "event/CoarseTimerEvent.hxx"
|
||||||
#include "event/DeferEvent.hxx"
|
#include "event/DeferEvent.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
@ -139,7 +138,7 @@ class NfsConnection {
|
|||||||
bool mount_finished;
|
bool mount_finished;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
gcc_nonnull_all
|
[[gnu::nonnull]]
|
||||||
NfsConnection(EventLoop &_loop,
|
NfsConnection(EventLoop &_loop,
|
||||||
const char *_server, const char *_export_name) noexcept
|
const char *_server, const char *_export_name) noexcept
|
||||||
:socket_event(_loop, BIND_THIS_METHOD(OnSocketReady)),
|
:socket_event(_loop, BIND_THIS_METHOD(OnSocketReady)),
|
||||||
@ -157,12 +156,12 @@ public:
|
|||||||
return socket_event.GetEventLoop();
|
return socket_event.GetEventLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetServer() const noexcept {
|
const char *GetServer() const noexcept {
|
||||||
return server.c_str();
|
return server.c_str();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetExportName() const noexcept {
|
const char *GetExportName() const noexcept {
|
||||||
return export_name.c_str();
|
return export_name.c_str();
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_NFS_GLUE_HXX
|
#ifndef MPD_NFS_GLUE_HXX
|
||||||
#define MPD_NFS_GLUE_HXX
|
#define MPD_NFS_GLUE_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
class EventLoop;
|
class EventLoop;
|
||||||
class NfsConnection;
|
class NfsConnection;
|
||||||
|
|
||||||
@ -34,11 +32,11 @@ nfs_finish() noexcept;
|
|||||||
/**
|
/**
|
||||||
* Return the EventLoop that was passed to nfs_init().
|
* Return the EventLoop that was passed to nfs_init().
|
||||||
*/
|
*/
|
||||||
gcc_const
|
[[gnu::const]]
|
||||||
EventLoop &
|
EventLoop &
|
||||||
nfs_get_event_loop() noexcept;
|
nfs_get_event_loop() noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
NfsConnection &
|
NfsConnection &
|
||||||
nfs_get_connection(const char *server, const char *export_name) noexcept;
|
nfs_get_connection(const char *server, const char *export_name) noexcept;
|
||||||
|
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define MPD_NFS_MANAGER_HXX
|
#define MPD_NFS_MANAGER_HXX
|
||||||
|
|
||||||
#include "Connection.hxx"
|
#include "Connection.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
#include "event/IdleEvent.hxx"
|
#include "event/IdleEvent.hxx"
|
||||||
|
|
||||||
#include <boost/intrusive/set.hpp>
|
#include <boost/intrusive/set.hpp>
|
||||||
@ -56,15 +55,15 @@ class NfsManager final {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct Compare {
|
struct Compare {
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const LookupKey a,
|
bool operator()(const LookupKey a,
|
||||||
const ManagedConnection &b) const noexcept;
|
const ManagedConnection &b) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const ManagedConnection &a,
|
bool operator()(const ManagedConnection &a,
|
||||||
const LookupKey b) const noexcept;
|
const LookupKey b) const noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool operator()(const ManagedConnection &a,
|
bool operator()(const ManagedConnection &a,
|
||||||
const ManagedConnection &b) const noexcept;
|
const ManagedConnection &b) const noexcept;
|
||||||
};
|
};
|
||||||
@ -102,7 +101,7 @@ public:
|
|||||||
return idle_event.GetEventLoop();
|
return idle_event.GetEventLoop();
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
NfsConnection &GetConnection(const char *server,
|
NfsConnection &GetConnection(const char *server,
|
||||||
const char *export_name) noexcept;
|
const char *export_name) noexcept;
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public:
|
|||||||
return re != nullptr;
|
return re != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
bool Match(StringView s) const noexcept {
|
bool Match(StringView s) const noexcept {
|
||||||
/* we don't need the data written to ovector, but PCRE can
|
/* we don't need the data written to ovector, but PCRE can
|
||||||
omit internal allocations if we pass a buffer to
|
omit internal allocations if we pass a buffer to
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
#define _UPNPDIR_HXX_INCLUDED_
|
#define _UPNPDIR_HXX_INCLUDED_
|
||||||
|
|
||||||
#include "Compat.hxx"
|
#include "Compat.hxx"
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <forward_list>
|
#include <forward_list>
|
||||||
@ -112,7 +111,7 @@ public:
|
|||||||
*/
|
*/
|
||||||
std::forward_list<std::string> getSearchCapabilities(UpnpClient_Handle handle) const;
|
std::forward_list<std::string> getSearchCapabilities(UpnpClient_Handle handle) const;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
std::string GetURI() const noexcept {
|
std::string GetURI() const noexcept {
|
||||||
return "upnp://" + m_deviceId + "/" + m_serviceType;
|
return "upnp://" + m_deviceId + "/" + m_serviceType;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +20,6 @@
|
|||||||
#ifndef MPD_FLAC_METADATA_CHAIN_HXX
|
#ifndef MPD_FLAC_METADATA_CHAIN_HXX
|
||||||
#define MPD_FLAC_METADATA_CHAIN_HXX
|
#define MPD_FLAC_METADATA_CHAIN_HXX
|
||||||
|
|
||||||
#include "util/Compiler.h"
|
|
||||||
|
|
||||||
#include <FLAC/metadata.h>
|
#include <FLAC/metadata.h>
|
||||||
|
|
||||||
class InputStream;
|
class InputStream;
|
||||||
@ -67,12 +65,12 @@ public:
|
|||||||
|
|
||||||
bool ReadOgg(InputStream &is) noexcept;
|
bool ReadOgg(InputStream &is) noexcept;
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
FLAC__Metadata_ChainStatus GetStatus() const noexcept {
|
FLAC__Metadata_ChainStatus GetStatus() const noexcept {
|
||||||
return ::FLAC__metadata_chain_status(chain);
|
return ::FLAC__metadata_chain_status(chain);
|
||||||
}
|
}
|
||||||
|
|
||||||
gcc_pure
|
[[gnu::pure]]
|
||||||
const char *GetStatusString() const noexcept {
|
const char *GetStatusString() const noexcept {
|
||||||
return FLAC__Metadata_ChainStatusString[GetStatus()];
|
return FLAC__Metadata_ChainStatusString[GetStatus()];
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user