|
|
@ -19,13 +19,14 @@ void CommandDecoder::checkIfEnoughArgsAreProvided(int argc) |
|
|
|
{ |
|
|
|
if(argc < 2) |
|
|
|
{ |
|
|
|
throw"the usage should lookLike this Sin <parameter>"; |
|
|
|
throw"the usage should lookLike this Cin <parameter>"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|
QList<CommandsType> CommandDecoder::CommandValueDecoder(char* argv[]) |
|
|
|
{ |
|
|
|
int j = 0; |
|
|
|
while(j < _argc) |
|
|
|
{ |
|
|
|
CommandsType sample; |
|
|
@ -41,18 +42,18 @@ QList<CommandsType> CommandDecoder::CommandValueDecoder(char* argv[]) |
|
|
|
j++; |
|
|
|
} |
|
|
|
|
|
|
|
return decodedList; |
|
|
|
return _decodedList; |
|
|
|
} |
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|
void CommandDecoder::checkIfNextItemShallBeValue(char* argv) |
|
|
|
{ |
|
|
|
if(!isNextItemValue) |
|
|
|
if(!_isNextItemValue) |
|
|
|
{ |
|
|
|
throw"duplicated Value and its wrong"; |
|
|
|
} |
|
|
|
decodedList.last().value = argv; |
|
|
|
isNextItemValue = false; |
|
|
|
_decodedList.last().value = argv; |
|
|
|
_isNextItemValue = false; |
|
|
|
} |
|
|
|
|
|
|
|
//****************************************************************
|
|
|
@ -60,8 +61,8 @@ void CommandDecoder::initCommandStrcut(char* argv, CommandsType& sample) |
|
|
|
{ |
|
|
|
sample.command = argv; |
|
|
|
sample.value = Q_NULLPTR; |
|
|
|
isNextItemValue = true; |
|
|
|
decodedList.append(sample); |
|
|
|
_isNextItemValue = true; |
|
|
|
_decodedList.append(sample); |
|
|
|
} |
|
|
|
|
|
|
|
//****************************************************************
|
|
|
|