Added Dictionary.values()

This commit is contained in:
J08nY
2016-06-05 14:20:52 +02:00
parent 56348cbbfe
commit dcce477f5e
4 changed files with 78 additions and 58 deletions

View File

@ -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();
}