MCPcopy Create free account
hub / github.com/BoomingTech/Piccolo / StringToVector

Function StringToVector

engine/3rdparty/JoltPhysics/Jolt/Core/StringTools.cpp:41–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void StringToVector(const string_view &inString, vector<string> &outVector, const string_view &inDelimiter, bool inClearVector)
42{
43 JPH_ASSERT(inDelimiter.size() > 0);
44
45 // Ensure vector empty
46 if (inClearVector)
47 outVector.clear();
48
49 // No string? no elements
50 if (inString.empty())
51 return;
52
53 // Start with initial string
54 string s(inString);
55
56 // Add to vector while we have a delimiter
57 size_t i;
58 while (!s.empty() && (i = s.find(inDelimiter)) != string::npos)
59 {
60 outVector.push_back(s.substr(0, i));
61 s.erase(0, i + inDelimiter.length());
62 }
63
64 // Add final element
65 outVector.push_back(s);
66}
67
68void VectorToString(const vector<string> &inVector, string &outString, const string_view &inDelimiter)
69{

Callers 4

JoltViewerMethod · 0.85
SamplesAppMethod · 0.85
DrawCustomMethod · 0.85

Calls 7

substrMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45
emptyMethod · 0.45
findMethod · 0.45
push_backMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected