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

Function util_FindNextDelim

src/twparser/parserhelper.cpp:1053–1069  ·  view source on GitHub ↗

finds first '&', '+', '-' on or after str[i]

Source from the content-addressed store, hash-verified

1051
1052// finds first '&', '+', '-' on or after str[i]
1053TSTRING::size_type util_FindNextDelim(const TSTRING& str, TSTRING::size_type i)
1054{
1055 TSTRING::size_type min = TSTRING::npos;
1056 TSTRING::size_type amp = str.find('&', i);
1057 TSTRING::size_type plus = str.find('+', i);
1058 TSTRING::size_type minus = str.find('-', i);
1059
1060 // now find minimum of the three
1061 if (amp != TSTRING::npos)
1062 min = amp;
1063 if (min != TSTRING::npos && plus != TSTRING::npos && plus < min)
1064 min = plus;
1065 if (min != TSTRING::npos && minus != TSTRING::npos && minus < min)
1066 min = minus;
1067
1068 return min;
1069}
1070
1071void util_LoseSurroundingWS(TSTRING& str)
1072{

Callers 1

CreatePropVectorMethod · 0.85

Calls 1

findMethod · 0.45

Tested by

no test coverage detected