MCPcopy Create free account
hub / github.com/Snapchat/Valdi / split

Method split

valdi_core/src/valdi_core/cpp/Utils/StringBox.cpp:371–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

369}
370
371std::pair<StringBox, StringBox> StringBox::split(size_t index) const noexcept {
372 SC_ASSERT(index < length());
373
374 auto left = Valdi::StringCache::getGlobal().makeString(getCStr(), index);
375 auto right = Valdi::StringCache::getGlobal().makeString(getCStr() + index + 1, length() - index - 1);
376
377 return std::make_pair(std::move(left), std::move(right));
378}
379
380std::vector<StringBox> StringBox::split(char separator) const noexcept {
381 return split(separator, false);

Callers 15

_parse_interfacesFunction · 0.80
deserializeValueFunction · 0.80
parseMethod · 0.80
getPreferredLocalesMethod · 0.80
trimLineWhitespaceFunction · 0.80
_getLocationMethod · 0.80
_sanitizeMethod · 0.80
assertSkipFilesFunction · 0.80
simpleUrlToAbsoluteMethod · 0.80
getWebviewPortMethod · 0.80
readEnvFileFunction · 0.80

Calls 5

lengthMethod · 0.95
getGlobalFunction · 0.85
splitFunction · 0.85
makeStringMethod · 0.80
lengthFunction · 0.50

Tested by 4

assertSkipFilesFunction · 0.64
TEST_PMethod · 0.64
compileAsCFunction · 0.64
sanitizeFunction · 0.64