mirror of
https://github.com/Relintai/sfw.git
synced 2025-04-07 17:01:48 +02:00
- Now unicode error printing is disabled by default. Also can be enabled via a macro. 2e41d4dfcda7ff2c35a1326f0de71b0714524f11 - Added to_real helper methods to String. 43b14a071c6ccf7c3062e0568e3d7bb05d8a83d2 - Fix AABB.encloses failing on shared upper bound. 8341ddc450bd160b5cb44eeb0400da2e5a151ed0 - Fix incorrect clipping in String::substr_index(). dcd00dec81a2841ad5244e043379697c68d681f7 - Backported create_reference() helper methods for InputEvents from godot 4. 4cdb1636264d8a6cef0881a37a7fad72ac262f3f - Backported comparison operators to Array from godot4. 7779439e284bf8a0534f606d5c7f929674764941 - Removed Vector2i(Vector2) constructor, added a Vector2i conversion operator to Vector2 instead. This solves ambigous Variant to Vector2i conversion errors. 27b73fa9f9984709b0c8eb77bfeea5cab8d9fee3 - Added exp2 to the Math singleton. e17cc864bc339c1f4d1ce6acd4cabf4a6593c6cc - Add a get_or_add method to Dictionary. 487b454506259c080306098093875ea7bda5b5ad - Add is_zero_approx methods to Vector{2,3} 441bb29fd3bd758ff783e4122e6b2d512dc8529f - Also add is_zero_approx() to Vector4. ed224298e5ae951093b42a004afacbd275e54494 - Transform now uses Basis::create_looking_at. 6f53257e05d72088c28028eb568526f4da146ae0 - Backported from godot4: Add the ability to look-at in model-space. 951ae7b11db0376dd0dbdf080e2f2e3652ac33ed - Fix split_floats behavior when spaces are used as separators 4585110a298487081f026827e3395c4feaf35f9a - Better solution for the previous fix. d75d3591edf13ae0dd6aa989962595aa1280ae73 - Fix the fix. 48935e93b3f5849a52b0e7fc0b6ede36a7b61123
78 lines
2.0 KiB
C++
78 lines
2.0 KiB
C++
//--STRIP
|
|
#ifndef DICTIONARY_H
|
|
#define DICTIONARY_H
|
|
//--STRIP
|
|
|
|
/*************************************************************************/
|
|
/* dictionary.h */
|
|
/* From https://github.com/Relintai/pandemonium_engine (MIT) */
|
|
/*************************************************************************/
|
|
|
|
//--STRIP
|
|
#include "core/list.h"
|
|
#include "core/ustring.h"
|
|
#include "object/array.h"
|
|
//--STRIP
|
|
|
|
class Variant;
|
|
|
|
struct DictionaryPrivate;
|
|
|
|
class Dictionary {
|
|
mutable DictionaryPrivate *_p;
|
|
|
|
void _ref(const Dictionary &p_from) const;
|
|
void _unref() const;
|
|
|
|
public:
|
|
void get_key_list(List<Variant> *p_keys) const;
|
|
Variant get_key_at_index(int p_index) const;
|
|
Variant get_value_at_index(int p_index) const;
|
|
|
|
Variant &operator[](const Variant &p_key);
|
|
const Variant &operator[](const Variant &p_key) const;
|
|
|
|
const Variant *getptr(const Variant &p_key) const;
|
|
Variant *getptr(const Variant &p_key);
|
|
|
|
Variant get_valid(const Variant &p_key) const;
|
|
Variant get(const Variant &p_key, const Variant &p_default) const;
|
|
Variant get_or_add(const Variant &p_key, const Variant &p_default);
|
|
|
|
int size() const;
|
|
bool empty() const;
|
|
void clear();
|
|
void merge(const Dictionary &p_dictionary, bool p_overwrite = false);
|
|
|
|
bool has(const Variant &p_key) const;
|
|
bool has_all(const Array &p_keys) const;
|
|
Variant find_key(const Variant &p_value) const;
|
|
|
|
bool erase(const Variant &p_key);
|
|
|
|
bool deep_equal(const Dictionary &p_dictionary, int p_recursion_count = 0) const;
|
|
bool operator==(const Dictionary &p_dictionary) const;
|
|
bool operator!=(const Dictionary &p_dictionary) const;
|
|
|
|
uint32_t hash() const;
|
|
uint32_t recursive_hash(int p_recursion_count) const;
|
|
void operator=(const Dictionary &p_dictionary);
|
|
|
|
const Variant *next(const Variant *p_key = nullptr) const;
|
|
|
|
Array keys() const;
|
|
Array values() const;
|
|
|
|
Dictionary duplicate(bool p_deep = false) const;
|
|
|
|
const void *id() const;
|
|
|
|
Dictionary(const Dictionary &p_from);
|
|
Dictionary();
|
|
~Dictionary();
|
|
};
|
|
|
|
//--STRIP
|
|
#endif // DICTIONARY_H
|
|
//--STRIP
|