- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/CommandLineUI/Query/ElementCommandLineQuery.cpp
rf130d4 r2f429e 36 36 #include "CodePatterns/MemDebug.hpp" 37 37 38 #include <string> 39 38 40 #include "CommandLineUI/Query/CommandLineQuery.hpp" 39 41 #include "CommandLineUI/CommandLineParser.hpp" … … 54 56 // TODO: vector of ints and removing first is not correctly implemented yet. How to remove from a vector? 55 57 periodentafel *periode = World::getInstance().getPeriode(); 56 int Z = -1;57 58 if (CommandLineParser::getInstance().vm.count(getTitle())) { 59 std::string argument("none"); 58 60 try { 59 Z = CommandLineParser::getInstance().vm[getTitle()].as< int >(); 61 argument = CommandLineParser::getInstance().vm[getTitle()].as< std::string >(); 62 try { 63 int Z = -1; 64 Z = boost::lexical_cast<int>(argument); 65 temp = periode->FindElement(Z); 66 } catch(boost::bad_lexical_cast &e) { 67 temp = periode->FindElement(argument); 68 } 60 69 } catch(boost::bad_any_cast &e) { 61 Z = -1;62 70 return false; 63 71 } 64 temp = periode->FindElement(Z);65 72 ASSERT(temp != NULL, "Invalid element specified in ElementCommandLineQuery"); 66 73 return true;
Note:
See TracChangeset
for help on using the changeset viewer.