MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / parseString

Method parseString

Source/UIComponents/CtrlrValueMap.cpp:19–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17}
18
19void CtrlrValueMap::parseString (const String &stringToParseAsMap)
20{
21 values.clear();
22 numericValues.clear();
23 additionalData.clear();
24
25 StringArray arLines;
26 arLines.addTokens (stringToParseAsMap.trim(), "\n", "\"\'");
27 for (int line=0; line<arLines.size(); line++)
28 {
29 if (arLines[line].startsWith("__"))
30 {
31 addAdditionalData (line, arLines[line]);
32 continue;
33 }
34
35 CtrlrValue val;
36 StringArray arLine;
37 arLine.addTokens (arLines[line], "=", "\'\"");
38
39 if (arLine.size() == 2)
40 {
41 val.numericValue = arLine[1].getIntValue();
42 val.textRepresentation = arLine[0];
43 }
44 if (arLine.size() == 1)
45 {
46 val.textRepresentation = arLine[0];
47 val.numericValue = line;
48 }
49
50 values.add (val);
51 numericValues.add (val.numericValue);
52 }
53
54 DefaultElementComparator<int> sorter;
55 numericValues.sort (sorter);
56}
57
58int CtrlrValueMap::getMappedMax() const
59{

Callers 2

formatDataMethod · 0.45

Calls 8

addTokensMethod · 0.80
clearMethod · 0.45
trimMethod · 0.45
sizeMethod · 0.45
startsWithMethod · 0.45
getIntValueMethod · 0.45
addMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected