MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / loadValidTexts

Method loadValidTexts

native/events/Preference.cpp:481–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

479 }
480
481 void Preference::loadValidTexts(const std::string &pathOfValidTexts) {
482 std::string fileContent = loadFileContent(pathOfValidTexts);
483 if (fileContent.empty())
484 return;
485 this->_validTexts.clear();
486 std::vector<std::string> validStringLines;
487 splitString(fileContent, validStringLines, '\n');
488 for (auto &line: validStringLines) {
489 auto iter = line.find(": ");
490 if (iter != std::string::npos &&
491 line.find("String #") != std::string::npos) {
492 this->_validTexts.emplace(line.substr(iter + 2));
493 } else {
494 this->_validTexts.emplace(line);
495 }
496 }
497 if (!this->_validTexts.empty())
498 this->_pruningValidTexts = true;
499 }
500
501 void Preference::loadConfigs() {
502#if defined(__ANDROID__) || defined(_DEBUG_)

Callers

nothing calls this directly

Calls 2

splitStringFunction · 0.85
emptyMethod · 0.80

Tested by

no test coverage detected