MCPcopy Create free account
hub / github.com/DFHack/dfhack / getAllByKeyRange

Method getAllByKeyRange

library/modules/Persistence.cpp:400–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

398}
399
400void Persistence::getAllByKeyRange(std::vector<PersistentDataItem> &vec, int entity_id,
401 const std::string &min, const std::string &max) {
402 vec.clear();
403
404 if (!is_good_entity_id(entity_id) || !Core::getInstance().isWorldLoaded())
405 return;
406
407 CoreSuspender suspend;
408
409 if (!store.contains(entity_id))
410 return;
411
412 auto begin = store[entity_id].lower_bound(min);
413 auto end = store[entity_id].lower_bound(max);
414 for (auto it = begin; it != end; ++it)
415 vec.emplace_back(it->second);
416}
417
418void Persistence::getAllByKey(std::vector<PersistentDataItem> &vec, int entity_id, const std::string &key) {
419 vec.clear();

Callers

nothing calls this directly

Calls 3

is_good_entity_idFunction · 0.85
containsMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected