summaryrefslogtreecommitdiff
path: root/core/dictionary.cpp
diff options
context:
space:
mode:
authorJ08nY <jancar.jj@gmail.com>2016-06-05 14:20:52 +0200
committerJ08nY <jancar.jj@gmail.com>2016-06-05 14:50:06 +0200
commitdcce477f5e2b6572e3b9579e288986c969f1a816 (patch)
treef35313ae16b39fb1a5bc54597e01872f1440b8a2 /core/dictionary.cpp
parent56348cbbfe82c2f5e2b95875e0687b664cc6e2d8 (diff)
Added Dictionary.values()
Diffstat (limited to 'core/dictionary.cpp')
-rw-r--r--core/dictionary.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/core/dictionary.cpp b/core/dictionary.cpp
index 75c8531251..6204a87054 100644
--- a/core/dictionary.cpp
+++ b/core/dictionary.cpp
@@ -199,6 +199,18 @@ Array Dictionary::keys() const {
}
+Array Dictionary::values() const {
+
+ Array varr;
+ varr.resize(size());
+ const Variant *key=NULL;
+ int i=0;
+ while((key=next(key))){
+ varr[i++] = _p->variant_map[*key];
+ }
+ return varr;
+}
+
const Variant* Dictionary::next(const Variant* p_key) const {
return _p->variant_map.next(p_key);
@@ -250,5 +262,3 @@ Dictionary::~Dictionary() {
_unref();
}
-
-