MCPcopy Index your code
hub / github.com/Persper/code-analytics / Confirm

Function Confirm

test/cpp_test_repo/D/Utility.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39bool 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
57void ReportException(const exception& ex, int level)
58{

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected