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

Function find_enum_item

library/include/DataDefs.h:848–855  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846 */
847 template<class T>
848 inline bool find_enum_item(T *var, const std::string &name) {
849 using traits = df::enum_traits<T>;
850 int size = traits::last_item_value-traits::first_item_value+1;
851 int idx = findEnumItem(name, size, traits::key_table);
852 if (idx < 0) return false;
853 *var = T(traits::first_item_value+idx);
854 return true;
855 }
856
857 /*
858 * Bitfield tools.

Callers 7

findMethod · 0.85
find_flagarray_fieldFunction · 0.85
set_flagarray_fieldFunction · 0.85
get_flagarray_fieldFunction · 0.85
processTileTypeFunction · 0.85
orders_importFunction · 0.85
token_to_enum_valFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected