MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / GetNextToken

Function GetNextToken

layers/layer_options.cpp:396–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396std::string GetNextToken(std::string* token_list, const std::string& delimiter, size_t* pos) {
397 std::string token;
398 *pos = token_list->find(delimiter);
399 if (*pos != std::string::npos) {
400 token = token_list->substr(0, *pos);
401 } else {
402 *pos = token_list->length() - delimiter.length();
403 token = *token_list;
404 }
405 token_list->erase(0, *pos + delimiter.length());
406
407 // Remove quotes from quoted strings
408 if ((token.length() > 0) && (token[0] == '\"')) {
409 token.erase(token.begin());
410 if ((token.length() > 0) && (token[token.length() - 1] == '\"')) {
411 token.erase(--token.end());
412 }
413 }
414 return token;
415}
416
417// Given a string representation of a list of enable enum values, call the appropriate setter function
418bool SetLocalEnableSetting(std::string list_of_enabled, const std::string& delimiter, ValidationEnabled& enabled) {

Callers 2

SetLocalEnableSettingFunction · 0.85
SetLocalDisableSettingFunction · 0.85

Calls 5

lengthMethod · 0.80
findMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected