mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-21 07:25:39 -04:00
Misc: Fix build on Debian Bullseye
This commit is contained in:
@ -47,6 +47,14 @@ struct transparent_string_less
|
||||
};
|
||||
} // namespace detail
|
||||
|
||||
template<typename ValueType>
|
||||
using StringMap = std::map<std::string, ValueType, detail::transparent_string_less>;
|
||||
template<typename ValueType>
|
||||
using StringMultiMap = std::multimap<std::string, ValueType, detail::transparent_string_less>;
|
||||
using StringSet = std::set<std::string, detail::transparent_string_less>;
|
||||
using StringMultiSet = std::multiset<std::string, detail::transparent_string_less>;
|
||||
|
||||
#if defined(__cpp_lib_generic_unordered_lookup) && __cpp_lib_generic_unordered_lookup >= 201811L
|
||||
template<typename ValueType>
|
||||
using UnorderedStringMap =
|
||||
std::unordered_map<std::string, ValueType, detail::transparent_string_hash, detail::transparent_string_equal>;
|
||||
@ -59,8 +67,21 @@ using UnorderedStringMultiSet =
|
||||
std::unordered_multiset<std::string, detail::transparent_string_hash, detail::transparent_string_equal>;
|
||||
|
||||
template<typename ValueType>
|
||||
using StringMap = std::map<std::string, ValueType, detail::transparent_string_less>;
|
||||
using PreferUnorderedStringMap = UnorderedStringMap<ValueType>;
|
||||
template<typename ValueType>
|
||||
using StringMultiMap = std::multimap<std::string, ValueType, detail::transparent_string_less>;
|
||||
using StringSet = std::set<std::string, detail::transparent_string_less>;
|
||||
using StringMultiSet = std::multiset<std::string, detail::transparent_string_less>;
|
||||
using PreferUnorderedStringMultimap = UnorderedStringMultimap<ValueType>;
|
||||
using PreferUnorderedStringSet = UnorderedStringSet;
|
||||
using PreferUnorderedStringMultiSet = UnorderedStringMultiSet;
|
||||
#else
|
||||
|
||||
#pragma message "__cpp_lib_generic_unordered_lookup is missing, performance will be slower."
|
||||
|
||||
// GCC 10 doesn't support generic_unordered_lookup...
|
||||
template<typename ValueType>
|
||||
using PreferUnorderedStringMap = StringMap<ValueType>;
|
||||
template<typename ValueType>
|
||||
using PreferUnorderedStringMultimap = StringMultiMap<ValueType>;
|
||||
using PreferUnorderedStringSet = StringSet;
|
||||
using PreferUnorderedStringMultiSet = StringMultiSet;
|
||||
|
||||
#endif
|
||||
|
@ -9,52 +9,52 @@
|
||||
class MemorySettingsInterface final : public SettingsInterface
|
||||
{
|
||||
public:
|
||||
MemorySettingsInterface();
|
||||
~MemorySettingsInterface();
|
||||
MemorySettingsInterface();
|
||||
~MemorySettingsInterface();
|
||||
|
||||
bool Save() override;
|
||||
bool Save() override;
|
||||
|
||||
void Clear() override;
|
||||
void Clear() override;
|
||||
|
||||
bool GetIntValue(const char* section, const char* key, s32* value) const override;
|
||||
bool GetUIntValue(const char* section, const char* key, u32* value) const override;
|
||||
bool GetFloatValue(const char* section, const char* key, float* value) const override;
|
||||
bool GetDoubleValue(const char* section, const char* key, double* value) const override;
|
||||
bool GetBoolValue(const char* section, const char* key, bool* value) const override;
|
||||
bool GetStringValue(const char* section, const char* key, std::string* value) const override;
|
||||
bool GetIntValue(const char* section, const char* key, s32* value) const override;
|
||||
bool GetUIntValue(const char* section, const char* key, u32* value) const override;
|
||||
bool GetFloatValue(const char* section, const char* key, float* value) const override;
|
||||
bool GetDoubleValue(const char* section, const char* key, double* value) const override;
|
||||
bool GetBoolValue(const char* section, const char* key, bool* value) const override;
|
||||
bool GetStringValue(const char* section, const char* key, std::string* value) const override;
|
||||
|
||||
void SetIntValue(const char* section, const char* key, s32 value) override;
|
||||
void SetUIntValue(const char* section, const char* key, u32 value) override;
|
||||
void SetFloatValue(const char* section, const char* key, float value) override;
|
||||
void SetDoubleValue(const char* section, const char* key, double value) override;
|
||||
void SetBoolValue(const char* section, const char* key, bool value) override;
|
||||
void SetStringValue(const char* section, const char* key, const char* value) override;
|
||||
void SetIntValue(const char* section, const char* key, s32 value) override;
|
||||
void SetUIntValue(const char* section, const char* key, u32 value) override;
|
||||
void SetFloatValue(const char* section, const char* key, float value) override;
|
||||
void SetDoubleValue(const char* section, const char* key, double value) override;
|
||||
void SetBoolValue(const char* section, const char* key, bool value) override;
|
||||
void SetStringValue(const char* section, const char* key, const char* value) override;
|
||||
|
||||
std::vector<std::pair<std::string, std::string>> GetKeyValueList(const char* section) const override;
|
||||
void SetKeyValueList(const char* section, const std::vector<std::pair<std::string, std::string>>& items) override;
|
||||
std::vector<std::pair<std::string, std::string>> GetKeyValueList(const char* section) const override;
|
||||
void SetKeyValueList(const char* section, const std::vector<std::pair<std::string, std::string>>& items) override;
|
||||
|
||||
bool ContainsValue(const char* section, const char* key) const override;
|
||||
void DeleteValue(const char* section, const char* key) override;
|
||||
void ClearSection(const char* section) override;
|
||||
bool ContainsValue(const char* section, const char* key) const override;
|
||||
void DeleteValue(const char* section, const char* key) override;
|
||||
void ClearSection(const char* section) override;
|
||||
|
||||
std::vector<std::string> GetStringList(const char* section, const char* key) const override;
|
||||
void SetStringList(const char* section, const char* key, const std::vector<std::string>& items) override;
|
||||
bool RemoveFromStringList(const char* section, const char* key, const char* item) override;
|
||||
bool AddToStringList(const char* section, const char* key, const char* item) override;
|
||||
std::vector<std::string> GetStringList(const char* section, const char* key) const override;
|
||||
void SetStringList(const char* section, const char* key, const std::vector<std::string>& items) override;
|
||||
bool RemoveFromStringList(const char* section, const char* key, const char* item) override;
|
||||
bool AddToStringList(const char* section, const char* key, const char* item) override;
|
||||
|
||||
// default parameter overloads
|
||||
using SettingsInterface::GetBoolValue;
|
||||
using SettingsInterface::GetDoubleValue;
|
||||
using SettingsInterface::GetFloatValue;
|
||||
using SettingsInterface::GetIntValue;
|
||||
using SettingsInterface::GetStringValue;
|
||||
using SettingsInterface::GetUIntValue;
|
||||
// default parameter overloads
|
||||
using SettingsInterface::GetBoolValue;
|
||||
using SettingsInterface::GetDoubleValue;
|
||||
using SettingsInterface::GetFloatValue;
|
||||
using SettingsInterface::GetIntValue;
|
||||
using SettingsInterface::GetStringValue;
|
||||
using SettingsInterface::GetUIntValue;
|
||||
|
||||
private:
|
||||
using KeyMap = UnorderedStringMultimap<std::string>;
|
||||
using SectionMap = UnorderedStringMap<KeyMap>;
|
||||
using KeyMap = PreferUnorderedStringMultimap<std::string>;
|
||||
using SectionMap = PreferUnorderedStringMap<KeyMap>;
|
||||
|
||||
void SetValue(const char* section, const char* key, std::string value);
|
||||
void SetValue(const char* section, const char* key, std::string value);
|
||||
|
||||
SectionMap m_sections;
|
||||
};
|
||||
SectionMap m_sections;
|
||||
};
|
||||
|
Reference in New Issue
Block a user