1
0
mirror of https://github.com/RPCS3/rpcs3.git synced 2024-11-22 10:42:36 +01:00

cfg: move get_name to _base

This commit is contained in:
Megamouse 2021-03-20 17:06:43 +01:00 committed by Ivan
parent 2766e5ca6f
commit ae01e1d2c3
2 changed files with 4 additions and 9 deletions

View File

@ -20,7 +20,7 @@ namespace cfg
} }
_base::_base(type _type, node* owner, const std::string& name, bool dynamic) _base::_base(type _type, node* owner, const std::string& name, bool dynamic)
: m_type(_type), m_dynamic(dynamic) : m_type(_type), m_dynamic(dynamic), m_name(name)
{ {
for (const auto& pair : owner->m_nodes) for (const auto& pair : owner->m_nodes)
{ {

View File

@ -52,6 +52,7 @@ namespace cfg
protected: protected:
bool m_dynamic = true; bool m_dynamic = true;
const std::string m_name;
// Ownerless entry constructor // Ownerless entry constructor
_base(type _type); _base(type _type);
@ -67,6 +68,8 @@ namespace cfg
// Get type // Get type
type get_type() const { return m_type; } type get_type() const { return m_type; }
const std::string& get_name() const { return m_name; };
// Get dynamic property for reloading configs during games // Get dynamic property for reloading configs during games
bool get_is_dynamic() const { return m_dynamic; }; bool get_is_dynamic() const { return m_dynamic; };
@ -391,8 +394,6 @@ namespace cfg
// Simple string entry with mutex // Simple string entry with mutex
class string : public _base class string : public _base
{ {
const std::string m_name;
atomic_ptr<std::string> m_value; atomic_ptr<std::string> m_value;
public: public:
@ -400,7 +401,6 @@ namespace cfg
string(node* owner, std::string name, std::string def = {}, bool dynamic = false) string(node* owner, std::string name, std::string def = {}, bool dynamic = false)
: _base(type::string, owner, name, dynamic) : _base(type::string, owner, name, dynamic)
, m_name(std::move(name))
, m_value(def) , m_value(def)
, def(std::move(def)) , def(std::move(def))
{ {
@ -426,11 +426,6 @@ namespace cfg
} }
} }
const std::string& get_name() const
{
return m_name;
}
void from_default() override; void from_default() override;
std::string to_string() const override std::string to_string() const override