1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef CONFIG_FILE_H
- #define CONFIG_FILE_H
- #include "core/ordered_hash_map.h"
- #include "reference.h"
- class ConfigFile : public Reference {
- GDCLASS(ConfigFile, Reference);
- OrderedHashMap<String, OrderedHashMap<String, Variant> > values;
- PoolStringArray _get_sections() const;
- PoolStringArray _get_section_keys(const String &p_section) const;
- protected:
- static void _bind_methods();
- public:
- void set_value(const String &p_section, const String &p_key, const Variant &p_value);
- Variant get_value(const String &p_section, const String &p_key, Variant p_default = Variant()) const;
- bool has_section(const String &p_section) const;
- bool has_section_key(const String &p_section, const String &p_key) const;
- void get_sections(List<String> *r_sections) const;
- void get_section_keys(const String &p_section, List<String> *r_keys) const;
- void erase_section(const String &p_section);
- Error save(const String &p_path);
- Error load(const String &p_path);
- ConfigFile();
- };
- #endif
|