MCPcopy Create free account
hub / github.com/CMU-Perceptual-Computing-Lab/openpose / splitString

Function splitString

src/openpose/utilities/string.cpp:67–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65 template OP_API std::string toFixedLengthString<unsigned long long>(const unsigned long long number, const unsigned long long stringLength);
66
67 std::vector<std::string> splitString(const std::string& stringToSplit, const std::string& delimiter)
68 {
69 try
70 {
71 std::vector<std::string> result;
72 size_t pos = 0;
73 auto stringToSplitAux = stringToSplit;
74 while ((pos = stringToSplitAux.find(delimiter)) != std::string::npos)
75 {
76 result.emplace_back(stringToSplitAux.substr(0, pos));
77 stringToSplitAux.erase(0, pos + delimiter.length());
78 }
79 result.emplace_back(stringToSplitAux);
80 return result;
81 }
82 catch (const std::exception& e)
83 {
84 error(e.what(), __LINE__, __FUNCTION__, __FILE__);
85 return {};
86 }
87 }
88
89 std::string toLower(const std::string& string)
90 {

Callers 1

loadHandDetectorTxtFunction · 0.85

Calls 2

whatMethod · 0.80
errorFunction · 0.70

Tested by

no test coverage detected