- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified src/UIElements/TextUI/Query/FileTextQuery.cpp ¶
r8df74d rd754bb 21 21 22 22 #include <iostream> 23 #include <string> 23 24 24 25 #include <boost/filesystem.hpp> 25 26 26 #include "TextUI/ TextDialog.hpp"27 #include "TextUI/Query/TextQuery.hpp" 27 28 28 29 #include "Helpers/Log.hpp" … … 37 38 38 39 bool TextDialog::FileTextQuery::handle() { 39 Log() << Verbose(0) << getTitle();40 bool badInput = false; 40 41 std::string tempstring; 41 getline(cin,tempstring); 42 do{ 43 badInput = false; 44 std::cout << getDescription() << ": "; 45 std::cin >> tempstring; 46 if(std::cin.fail()){ 47 badInput = true; 48 std::cin.clear(); 49 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 50 std::cout << "Input was not a number!" << std::endl; 51 continue; 52 } 53 } while(badInput); 54 std::cin.ignore(std::numeric_limits<streamsize>::max(),'\n'); 42 55 tmp = tempstring; 43 56 return true;
Note:
See TracChangeset
for help on using the changeset viewer.