diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-05 15:18:25 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-05 15:18:25 (GMT) |
commit | 799ca6d265d7a362526d66e7f615f914695b867e (patch) | |
tree | 357afa5281dcfe72c7fee3e12c75505eca8dea1a /src/uscxml/transform/FlatStateIdentifier.h | |
parent | 83ef70ebc7527240f56e2e601777a613bce6e47e (diff) | |
download | uscxml-799ca6d265d7a362526d66e7f615f914695b867e.zip uscxml-799ca6d265d7a362526d66e7f615f914695b867e.tar.gz uscxml-799ca6d265d7a362526d66e7f615f914695b867e.tar.bz2 |
Catch std::exception before ... and output e.what()
Diffstat (limited to 'src/uscxml/transform/FlatStateIdentifier.h')
-rw-r--r-- | src/uscxml/transform/FlatStateIdentifier.h | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/uscxml/transform/FlatStateIdentifier.h b/src/uscxml/transform/FlatStateIdentifier.h index 3a9ee49..61d0f1b 100644 --- a/src/uscxml/transform/FlatStateIdentifier.h +++ b/src/uscxml/transform/FlatStateIdentifier.h @@ -142,34 +142,39 @@ protected: std::stringstream stateIdSS; std::string seperator; + stateIdSS << "active:{"; for (std::list<std::string>::const_iterator actIter = active.begin(); actIter != active.end(); actIter++) { stateIdSS << seperator << *actIter; seperator = ","; } - stateIdSS << "};"; + stateIdSS << "}"; - seperator = ""; - stateIdSS << "entered:{"; - for (std::list<std::string>::const_iterator visitIter = visited.begin(); visitIter != visited.end(); visitIter++) { - stateIdSS << seperator << *visitIter; - seperator = ","; + if (visited.size() > 0) { + seperator = ""; + stateIdSS << ";entered:{"; + for (std::list<std::string>::const_iterator visitIter = visited.begin(); visitIter != visited.end(); visitIter++) { + stateIdSS << seperator << *visitIter; + seperator = ","; + } + stateIdSS << "}"; } - stateIdSS << "};"; - seperator = ""; - stateIdSS << "history:{"; - for (std::map<std::string, std::list<std::string> >::const_iterator histIter = histories.begin(); histIter != histories.end(); histIter++) { - stateIdSS << seperator << histIter->first << ":{"; - seperator = ","; - std::string itemSeperator; - for (std::list<std::string>::const_iterator histItemIter = histIter->second.begin(); histItemIter != histIter->second.end(); histItemIter++) { - stateIdSS << itemSeperator << *histItemIter; - itemSeperator = ","; + if (histories.size() > 0) { + seperator = ""; + stateIdSS << ";history:{"; + for (std::map<std::string, std::list<std::string> >::const_iterator histIter = histories.begin(); histIter != histories.end(); histIter++) { + stateIdSS << seperator << histIter->first << ":{"; + seperator = ","; + std::string itemSeperator; + for (std::list<std::string>::const_iterator histItemIter = histIter->second.begin(); histItemIter != histIter->second.end(); histItemIter++) { + stateIdSS << itemSeperator << *histItemIter; + itemSeperator = ","; + } + stateIdSS << "}"; } stateIdSS << "}"; } - stateIdSS << "}"; stateId = stateIdSS.str(); } |