MCPcopy Create free account
hub / github.com/PixarAnimationStudios/OpenUSD / TfStringSplit

Function TfStringSplit

pxr/base/tf/stringUtils.cpp:439–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439vector<string>
440TfStringSplit(string const &src, string const &separator)
441{
442 vector<string> split;
443
444 if (src.empty())
445 return split;
446
447 // XXX python throws a ValueError in this case, we exit silently.
448 if (separator.empty())
449 return split;
450
451 size_t from=0;
452 size_t pos=0;
453
454 while (true) {
455 pos = src.find(separator, from);
456 if (pos == string::npos)
457 break;
458 split.push_back(src.substr(from, pos-from));
459 from = pos + separator.size();
460 }
461
462 // Also add the 'last' substring
463 split.push_back(src.substr(from));
464
465 return split;
466}
467
468vector<string>
469TfStringTokenize(string const &src, const char* delimiters)

Callers 15

_URIMethod · 0.85
_URIClass · 0.85
AppendCommentsMethod · 0.85
PrependCommentsMethod · 0.85
AppendArbitraryTextMethod · 0.85
PrependArbitraryTextMethod · 0.85
LFunction · 0.85
_ParseFunction · 0.85
AddMethod · 0.85
CreateFromFrameSpecMethod · 0.85

Calls 4

push_backMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
sizeMethod · 0.45

Tested by 3

LFunction · 0.68
_ParseFunction · 0.68
_ParseLocFunction · 0.68