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