2017-03-04 02:04:16 +00:00
|
|
|
#ifndef DICTIONARY_H
|
|
|
|
#define DICTIONARY_H
|
|
|
|
|
2017-03-06 07:49:24 +00:00
|
|
|
#include "Variant.hpp"
|
2017-03-04 02:04:16 +00:00
|
|
|
|
2017-03-06 07:49:24 +00:00
|
|
|
#include "Array.hpp"
|
2017-03-04 02:04:16 +00:00
|
|
|
|
2017-10-03 10:37:34 +00:00
|
|
|
#include <gdnative/dictionary.h>
|
2017-03-04 02:04:16 +00:00
|
|
|
|
|
|
|
namespace godot {
|
|
|
|
|
2017-07-23 15:53:50 +00:00
|
|
|
class Dictionary {
|
2017-03-04 02:04:16 +00:00
|
|
|
godot_dictionary _godot_dictionary;
|
|
|
|
public:
|
2017-03-06 02:30:46 +00:00
|
|
|
Dictionary();
|
2018-01-17 00:57:01 +00:00
|
|
|
Dictionary(const Dictionary & other);
|
|
|
|
Dictionary & operator=(const Dictionary & other);
|
2017-03-06 02:30:46 +00:00
|
|
|
|
2018-03-07 10:27:34 +00:00
|
|
|
template <class... Args>
|
|
|
|
static Dictionary make(Args... args) {
|
|
|
|
return helpers::add_all(Dictionary(), args...);
|
|
|
|
}
|
|
|
|
|
2017-03-06 02:30:46 +00:00
|
|
|
void clear();
|
|
|
|
|
|
|
|
bool empty() const;
|
|
|
|
|
|
|
|
void erase(const Variant& key);
|
|
|
|
|
|
|
|
bool has(const Variant& key) const;
|
|
|
|
|
|
|
|
bool has_all(const Array& keys) const;
|
|
|
|
|
|
|
|
uint32_t hash() const;
|
|
|
|
|
|
|
|
Array keys() const;
|
|
|
|
|
|
|
|
Variant &operator [](const Variant& key);
|
|
|
|
|
|
|
|
const Variant &operator [](const Variant& key) const;
|
|
|
|
|
|
|
|
int size() const;
|
|
|
|
|
|
|
|
String to_json() const;
|
|
|
|
|
|
|
|
Array values() const;
|
|
|
|
|
|
|
|
~Dictionary();
|
2017-03-04 02:04:16 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // DICTIONARY_H
|