Changeset View
Changeset View
Standalone View
Standalone View
src/qt/rpcconsole.cpp
Show First 20 Lines • Show All 263 Lines • ▼ Show 20 Lines | for (chpos = 0; chpos < strCommandTerminated.size(); ++chpos) { | ||||
else | else | ||||
strResult = curarg; | strResult = curarg; | ||||
} | } | ||||
curarg.clear(); | curarg.clear(); | ||||
// assume eating space state | // assume eating space state | ||||
state = STATE_EATING_SPACES; | state = STATE_EATING_SPACES; | ||||
} | } | ||||
if (breakParsing) break; | if (breakParsing) break; | ||||
// FALLTHROUGH | |||||
} | } | ||||
case STATE_ARGUMENT: // In or after argument | case STATE_ARGUMENT: // In or after argument | ||||
case STATE_EATING_SPACES_IN_ARG: | case STATE_EATING_SPACES_IN_ARG: | ||||
case STATE_EATING_SPACES_IN_BRACKETS: | case STATE_EATING_SPACES_IN_BRACKETS: | ||||
case STATE_EATING_SPACES: // Handle runs of whitespace | case STATE_EATING_SPACES: // Handle runs of whitespace | ||||
switch (ch) { | switch (ch) { | ||||
case '"': | case '"': | ||||
state = STATE_DOUBLEQUOTED; | state = STATE_DOUBLEQUOTED; | ||||
▲ Show 20 Lines • Show All 118 Lines • ▼ Show 20 Lines | bool RPCConsole::RPCParseCommandLine(std::string &strResult, | ||||
} | } | ||||
switch (state) // final state | switch (state) // final state | ||||
{ | { | ||||
case STATE_COMMAND_EXECUTED: | case STATE_COMMAND_EXECUTED: | ||||
if (lastResult.isStr()) | if (lastResult.isStr()) | ||||
strResult = lastResult.get_str(); | strResult = lastResult.get_str(); | ||||
else | else | ||||
strResult = lastResult.write(2); | strResult = lastResult.write(2); | ||||
// FALLTHROUGH | |||||
case STATE_ARGUMENT: | case STATE_ARGUMENT: | ||||
case STATE_EATING_SPACES: | case STATE_EATING_SPACES: | ||||
return true; | return true; | ||||
default: // ERROR to end in one of the other states | default: // ERROR to end in one of the other states | ||||
return false; | return false; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 867 Lines • Show Last 20 Lines |