MCPcopy Create free account
hub / github.com/anjo76/angelscript / GetKeys

Method GetKeys

sdk/add_on/scriptdictionary/scriptdictionary.cpp:426–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426CScriptArray* CScriptDictionary::GetKeys() const
427{
428 // Retrieve the object type for the array<string> from the cache
429 SDictionaryCache *cache = reinterpret_cast<SDictionaryCache*>(engine->GetUserData(DICTIONARY_CACHE));
430 asITypeInfo *ti = cache->arrayType;
431
432 // Create the array object
433 CScriptArray *array = CScriptArray::Create(ti, asUINT(dict.size()));
434 long current = -1;
435 dictMap_t::const_iterator it;
436 for( it = dict.begin(); it != dict.end(); it++ )
437 {
438 current++;
439 *(dictKey_t*)array->At(current) = it->first;
440 }
441
442 return array;
443}
444
445//--------------------------------------------------------------------------
446// Generic wrappers

Callers 1

Calls 5

beginMethod · 0.80
endMethod · 0.80
GetUserDataMethod · 0.45
sizeMethod · 0.45
AtMethod · 0.45

Tested by

no test coverage detected