MCPcopy Create free account
hub / github.com/SaschaWillems/HowToVulkan / parseOnOff

Function parseOnOff

source/external/tinyobj/tiny_obj_loader.h:1132–1145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1130}
1131
1132static inline bool parseOnOff(const char **token, bool default_value = true) {
1133 (*token) += strspn((*token), " \t");
1134 const char *end = (*token) + strcspn((*token), " \t\r");
1135
1136 bool ret = default_value;
1137 if ((0 == strncmp((*token), "on", 2))) {
1138 ret = true;
1139 } else if ((0 == strncmp((*token), "off", 3))) {
1140 ret = false;
1141 }
1142
1143 (*token) = end;
1144 return ret;
1145}
1146
1147static inline texture_type_t parseTextureType(
1148 const char **token, texture_type_t default_value = TEXTURE_TYPE_NONE) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected