MCPcopy Create free account
hub / github.com/bruderstein/nppPluginManager / replaceVariables

Method replaceVariables

libinstall/src/VariableHandler.cpp:38–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38void VariableHandler::replaceVariables(tstring &source)
39{
40 tstring::size_type startPos, endPos;
41 startPos = 0;
42 endPos = tstring::npos;
43
44 do
45 {
46 startPos = source.find(_T('$'), startPos);
47 if (startPos != tstring::npos)
48 {
49 endPos = source.find(_T('$'), startPos + 1);
50 if (endPos == tstring::npos)
51 break;
52 }
53
54 if (endPos != tstring::npos)
55 {
56 tstring varValue = (*_variables)[source.substr(startPos + 1, endPos - startPos - 1)];
57 source.replace(startPos, endPos - startPos + 1, varValue);
58 startPos = startPos + varValue.size();
59 endPos = tstring::npos;
60 }
61
62
63 } while(startPos != tstring::npos);
64
65
66
67}
68
69
70const tstring& VariableHandler::getVariable(const TCHAR* variableName)

Callers

nothing calls this directly

Calls 1

findMethod · 0.45

Tested by

no test coverage detected