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

Function get_flagarray_field

library/include/DataDefs.h:954–960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952 */
953 template<class T>
954 inline bool get_flagarray_field(int *value, const BitArray<T> &bitfield, const std::string &name)
955 {
956 T tmp;
957 if (!find_enum_item(&tmp, name) || tmp < 0) return false;
958 *value = (bitfield->is_set(tmp) ? 1 : 0);
959 return true;
960 }
961
962 DFHACK_EXPORT void flagarrayToString(std::vector<std::string> *pvec, const void *p,
963 int bytes, int base, int size, const char *const *items);

Callers

nothing calls this directly

Calls 2

find_enum_itemFunction · 0.85
is_setMethod · 0.80

Tested by

no test coverage detected