diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-09 10:08:29 +0200 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2014-04-09 10:08:29 +0200 |
commit | 3953d8833e070fa1d6cc7b264dd19ed56c909f02 (patch) | |
tree | b57091d0bfc1dd6234be9d09b6ba55e77948c8e4 /include/hashparent.h | |
parent | 614d95ad69f4e1d3457f2831abc94ecb0809c12e (diff) |
added support for accessing array keys by other value objects, support for unsetting array members, support for array_key_exists(), isset() and unset() functions (feature request in from issue #71)
Diffstat (limited to 'include/hashparent.h')
-rw-r--r-- | include/hashparent.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/include/hashparent.h b/include/hashparent.h index 4c2ee68..5ba05bd 100644 --- a/include/hashparent.h +++ b/include/hashparent.h @@ -56,6 +56,13 @@ public: virtual bool contains(int index) const = 0; /** + * Check if a certain index exists in the array/object + * @param key + * @return bool + */ + virtual bool contains(const Value &index) const = 0; + + /** * Retrieve the value at a string index * @param key * @return Value @@ -68,6 +75,13 @@ public: * @return Value */ virtual Value get(int index) const = 0; + + /** + * Retrieve the value at a value index + * @param key + * @return Value + */ + virtual Value get(const Value &key) const = 0; /** * Overwrite the value at a certain string index @@ -83,6 +97,31 @@ public: */ virtual void set(int index, const Value &value) = 0; + /** + * Overwrite the value at a certain variant index + * @param key + * @param value + */ + virtual void set(const Value &key, const Value &value) = 0; + + /** + * Unset a member by its index + * @param index + */ + virtual void unset(int index) = 0; + + /** + * Unset a member by its key + * @param key + */ + virtual void unset(const std::string &key) = 0; + + /** + * Unset a member by its key + * @param key + */ + virtual void unset(const Value &key) = 0; + }; /** |