- File:
-
- 1 edited
-
src/UIElements/TextUI/Query/FileTextQuery.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/TextUI/Query/FileTextQuery.cpp
rd754bb r8df74d 21 21 22 22 #include <iostream> 23 #include <string>24 23 25 24 #include <boost/filesystem.hpp> 26 25 27 #include "TextUI/ Query/TextQuery.hpp"26 #include "TextUI/TextDialog.hpp" 28 27 29 28 #include "Helpers/Log.hpp" … … 38 37 39 38 bool TextDialog::FileTextQuery::handle() { 40 bool badInput = false;39 Log() << Verbose(0) << getTitle(); 41 40 std::string 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'); 41 getline(cin,tempstring); 55 42 tmp = tempstring; 56 43 return true;
Note:
See TracChangeset
for help on using the changeset viewer.
