diff options
| author | 2015-08-27 01:29:13 +0200 | |
|---|---|---|
| committer | 2015-08-27 01:29:13 +0200 | |
| commit | 26e813ad2e4fa13f4b2873df99cb8e3be380c875 (patch) | |
| tree | 6c10dce6b0f5d2422de9225e51bad687c6d8cdb7 /diceparser.cpp | |
| parent | 11df3a32160259768d58ff26b24b28d9d68571ca (diff) | |
| download | OneRoll-26e813ad2e4fa13f4b2873df99cb8e3be380c875.tar.gz OneRoll-26e813ad2e4fa13f4b2873df99cb8e3be380c875.zip | |
add method to get all string results
Diffstat (limited to 'diceparser.cpp')
| -rw-r--r-- | diceparser.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/diceparser.cpp b/diceparser.cpp index 3831400..8c910a2 100644 --- a/diceparser.cpp +++ b/diceparser.cpp @@ -393,6 +393,29 @@ QString DiceParser::getStringResult() } return str; } +QStringList DiceParser::getAllStringResult(bool& hasAlias) +{ + ExecutionNode* next = getLeafNode(); + Result* result=next->getResult(); + QStringList stringListResult; + + while(NULL!=result) + { + if(result->hasResultOfType(Result::STRING)) + { + StringResult* stringResult = dynamic_cast<StringResult*>(result); + if(NULL!=stringResult) + { + stringListResult << stringResult->getText(); + hasAlias = stringResult->hasHighLight(); + } + } + result = result->getPrevious(); + } + + return stringListResult; +} + void DiceParser::getLastDiceResult(ExportedDiceResult& diceValues) { ExecutionNode* next = getLeafNode(); |