mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-09-22 09:18:43 +00:00
Config/Layer: Allow all keys of a section to be iterated over
This commit is contained in:
parent
4c24629b95
commit
37419b9a57
2 changed files with 39 additions and 0 deletions
|
@ -62,6 +62,30 @@ private:
|
|||
const LayerType m_layer;
|
||||
};
|
||||
|
||||
class Section
|
||||
{
|
||||
public:
|
||||
using iterator = LayerMap::iterator;
|
||||
Section(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
|
||||
iterator begin() const { return m_begin; }
|
||||
iterator end() const { return m_end; }
|
||||
private:
|
||||
iterator m_begin;
|
||||
iterator m_end;
|
||||
};
|
||||
|
||||
class ConstSection
|
||||
{
|
||||
public:
|
||||
using iterator = LayerMap::const_iterator;
|
||||
ConstSection(iterator begin_, iterator end_) : m_begin(begin_), m_end(end_) {}
|
||||
iterator begin() const { return m_begin; }
|
||||
iterator end() const { return m_end; }
|
||||
private:
|
||||
iterator m_begin;
|
||||
iterator m_end;
|
||||
};
|
||||
|
||||
class Layer
|
||||
{
|
||||
public:
|
||||
|
@ -106,6 +130,9 @@ public:
|
|||
current_value = new_value;
|
||||
}
|
||||
|
||||
Section GetSection(System system, const std::string& section);
|
||||
ConstSection GetSection(System system, const std::string& section) const;
|
||||
|
||||
// Explicit load and save of layers
|
||||
void Load();
|
||||
void Save();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue