| 37 | } |
| 38 | |
| 39 | bool Confirm(const std::string& prompt) |
| 40 | { |
| 41 | cout << prompt << " (Y/N)> " << flush; |
| 42 | while (true) |
| 43 | { |
| 44 | string buffer; |
| 45 | getline(cin, buffer); |
| 46 | stringstream ss(buffer); |
| 47 | if (ss >> buffer) |
| 48 | { |
| 49 | transform(buffer.begin(), buffer.end(), buffer.begin(), [](char c) {return tolower(c); }); |
| 50 | if (buffer == "y" || buffer == "yes") return true; |
| 51 | if (buffer == "n" || buffer == "no") return false; |
| 52 | } |
| 53 | cout << "��Ч�����롣> " << flush; |
| 54 | } |
| 55 | } |
| 56 | |
| 57 | void ReportException(const exception& ex, int level) |
| 58 | { |