MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / split

Function split

SRC/recorder/MPCORecorder.cpp:586–613  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

584 }
585
586 inline void split(const std::string &text, char sep, std::vector<std::string> &tokens, bool skip_empty = false)
587 {
588 if (tokens.size() > 0) tokens.clear();
589 std::size_t start = 0, end = 0;
590 while (true)
591 {
592 end = text.find(sep, start);
593 if (end == std::string::npos)
594 {
595 if (start < text.size())
596 tokens.push_back(text.substr(start));
597 else if (!skip_empty)
598 tokens.push_back("");
599 break;
600 }
601 std::string subs = text.substr(start, end - start);
602 if (skip_empty)
603 {
604 if (subs.size() > 0)
605 tokens.push_back(subs);
606 }
607 else
608 {
609 tokens.push_back(subs);
610 }
611 start = end + 1;
612 }
613 }
614
615 struct concatenator {
616 template<class T>

Callers 3

recvSelfMethod · 0.85
initializeMethod · 0.85
OPS_MPCORecorderFunction · 0.85

Calls 3

push_backMethod · 0.80
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected