mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-21 20:00:22 +00:00
Uninlined, added validity check, and documented functions.
This commit is contained in:
parent
10b7dfd773
commit
997643d2eb
@ -491,6 +491,12 @@ const config::attribute_value &config::operator[](const std::string &key) const
|
||||
return empty_attribute;
|
||||
}
|
||||
|
||||
config::attribute_value &config::operator[](const std::string &key)
|
||||
{
|
||||
check_valid();
|
||||
return values[key];
|
||||
}
|
||||
|
||||
const config::attribute_value &config::get_old_attribute(const std::string &key, const std::string &old_key, const std::string &msg) const
|
||||
{
|
||||
check_valid();
|
||||
|
@ -254,8 +254,16 @@ public:
|
||||
config& add_child(const std::string& key, const config& val);
|
||||
config& add_child_at(const std::string& key, const config& val, size_t index);
|
||||
|
||||
attribute_value &operator[](const std::string &key)
|
||||
{ return values[key]; }
|
||||
/**
|
||||
* Returns a reference to the attribute with the given @a key.
|
||||
* Creates it if it does not exist.
|
||||
*/
|
||||
attribute_value &operator[](const std::string &key);
|
||||
|
||||
/**
|
||||
* Returns a reference to the attribute with the given @a key
|
||||
* or to a dummy empty attribute if it does not exist.
|
||||
*/
|
||||
const attribute_value &operator[](const std::string &key) const;
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user