MCPcopy Create free account
hub / github.com/Yaafe/Yaafe / decodeParameterMap

Function decodeParameterMap

src_cpp/yaafe-core/utils.cpp:82–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 ParameterMap decodeParameterMap(const std::string& thestr)
83 {
84 ParameterMap attrs;
85 string str = thestr;
86 while (str.size()>0)
87 {
88 size_t attrEnd = str.find('#');
89 if (attrEnd==string::npos)
90 attrEnd = str.size();
91 size_t keyEnd = str.find('%');
92 if (keyEnd==string::npos)
93 {
94 cerr << "ERROR: cannot parse H5 Attribute : " << str.substr(0,attrEnd) << " !" << endl;
95 return ParameterMap();
96 }
97 string key = str.substr(0,keyEnd);
98 string value = str.substr(keyEnd+1,attrEnd-keyEnd-1);
99 attrs[key] = value;
100 if (attrEnd==str.size())
101 break;
102 str = str.substr(attrEnd+1);
103 }
104 return attrs;
105 }
106
107
108#ifdef WITH_TIMERS

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected