MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / splitstring

Function splitstring

src/core/stringutil.h:108–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106
107
108template<class IterT> void splitstring(IterT& iter, const TSTRING& str, const TSTRING& delims)
109{
110
111 TSTRING::size_type where;
112 TSTRING tmpStr;
113 TSTRING workingString = str;
114
115 while (workingString.length() > 0)
116 {
117
118 where = workingString.find_first_of(delims, 0);
119
120 // in the case of no delimeters, setp to
121 // grab the entire string.
122 //
123 if (where == TSTRING::npos)
124 where = workingString.length();
125
126 tmpStr = workingString.substr(0, where);
127 workingString.erase(0, where + 1);
128
129 iter.push_back(tmpStr);
130 }
131}
132
133
134} // namespace cStringUtil

Callers 1

GetGlobalEmailRecipientsFunction · 0.85

Calls 1

lengthMethod · 0.45

Tested by

no test coverage detected