MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / splitString

Function splitString

src/utilities/core/StringHelpers.cpp:270–283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268}
269
270std::vector<std::string> splitString(const std::string& string, char delimiter) {
271 std::vector<std::string> results;
272 if (!string.empty()) { // Only do work if there is work to do
273 std::stringstream stream(string);
274 std::string substring;
275 while (std::getline(stream, substring, delimiter)) { // Loop and fill the results vector
276 results.push_back(substring);
277 }
278 if (*(string.end() - 1) == delimiter) { // Add an empty string if the last char is the delimiter
279 results.push_back(std::string());
280 }
281 }
282 return results;
283}
284
285std::vector<std::string> splitEMSLineToTokens(const std::string& line, const std::string& delimiters) {
286

Callers 15

setBodyMethod · 0.85
addLineMethod · 0.85
setBodyMethod · 0.85
addLineMethod · 0.85
illuminanceMapRefPtMethod · 0.85
TESTFunction · 0.85
fromEpwStringMethod · 0.85
parseMethod · 0.85
parseLocationMethod · 0.85
parseDesignConditionsMethod · 0.85

Calls 3

emptyMethod · 0.45
push_backMethod · 0.45
endMethod · 0.45

Tested by 1

TESTFunction · 0.68