diff options
author | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-08-29 00:10:50 -0700 |
---|---|---|
committer | Emiel Bruijntjes <emiel.bruijntjes@copernica.com> | 2013-08-29 00:10:50 -0700 |
commit | 05c421983a0a57fa735fcccee76ad67ca6c67ea4 (patch) | |
tree | 15ce11571309983d2fcf4430da3528cf9c9c1b8f /include | |
parent | 5ab6927a5fa17e73161d7126ca506e5e51ba0e55 (diff) |
Extended interface of value class to be ready to deal with arrays
Diffstat (limited to 'include')
-rw-r--r-- | include/value.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/value.h b/include/value.h index 157a456..bf4beef 100644 --- a/include/value.h +++ b/include/value.h @@ -195,6 +195,24 @@ public: double decimalValue(); /** + * The number of members in case of an array or object + * @return int + */ + int size(); + + /** + * The number of members in case of an array or object + * @return int + */ + int count(); + + /** + * The number of members in case of an array or object + * @return int + */ + int length(); + + /** * Cast to an int * @return int */ @@ -229,6 +247,24 @@ public: { return decimalValue(); } + + /** + * Array access operator + * This can be used for accessing arrays + * Be aware: if the 'this' object is not already an array, it will be converted into one! + * @param index + * @return Value + */ + Value &operator[](int index); + + /** + * Array access operator + * This can be used for accessing associative arrays + * Be aware: if the 'this' object is not already an array, it will be converted into one! + * @param key + * @return Value + */ + Value &operator[](const std::string &key); protected: /** |