Ignore:
Timestamp:
05/01/19 13:32:11 (5 years ago)
Author:
Maciej Komosinski
Message:

Added two methods for dictionary iteration: for(x in dict) and for(x in dict.keys)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/vm/classes/collectionobj.h

    r849 r868  
    7979        PARAMPROCDEF(p_clone);
    8080        PARAMPROCDEF(p_assign);
     81        PARAMGETDEF(iterator);
     82        PARAMGETDEF(keys);
    8183#undef STATRICKCLASS
    8284        ExtValue get(SString key);
     
    107109};
    108110
     111class DictionaryIterator : public DestrBase
     112{
     113public:
     114        DictionaryObject *dic;
     115        HashEntryIterator it;
     116        bool initial, keys;
     117        DictionaryIterator(DictionaryObject* d, bool _keys);
     118        ~DictionaryIterator();
     119#define STATRICKCLASS DictionaryIterator
     120        PARAMGETDEF(next);
     121        PARAMGETDEF(value);
     122        PARAMGETDEF(iterator);
     123#undef STATRICKCLASS
     124        static ExtObject makeFrom(DictionaryObject *v, bool _keys = false);
     125};
     126
    109127#endif
Note: See TracChangeset for help on using the changeset viewer.