Dictionary.hpp 902 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #ifndef DICTIONARY_H
  2. #define DICTIONARY_H
  3. #if defined(_WIN32)
  4. # ifdef _GD_CPP_CORE_API_IMPL
  5. # define GD_CPP_CORE_API __declspec(dllexport)
  6. # else
  7. # define GD_CPP_CORE_API __declspec(dllimport)
  8. # endif
  9. #else
  10. # define GD_CPP_CORE_API
  11. #endif
  12. #include "Variant.hpp"
  13. #include "Array.hpp"
  14. #include <godot/godot_dictionary.h>
  15. namespace godot {
  16. class GD_CPP_CORE_API Dictionary {
  17. godot_dictionary _godot_dictionary;
  18. public:
  19. Dictionary();
  20. void clear();
  21. bool empty() const;
  22. void erase(const Variant& key);
  23. bool has(const Variant& key) const;
  24. bool has_all(const Array& keys) const;
  25. uint32_t hash() const;
  26. Array keys() const;
  27. int parse_json(const String& json);
  28. Variant &operator [](const Variant& key);
  29. const Variant &operator [](const Variant& key) const;
  30. int size() const;
  31. String to_json() const;
  32. Array values() const;
  33. ~Dictionary();
  34. };
  35. }
  36. #endif // DICTIONARY_H