Code Cleanup
- Removed unused util.cpp confirm3 function.
This commit is contained in:
38
src/util.cpp
38
src/util.cpp
@@ -93,44 +93,6 @@ bool confirm (const std::string& question)
|
|||||||
return matches[0] == STRING_UTIL_CONFIRM_YES ? true : false;
|
return matches[0] == STRING_UTIL_CONFIRM_YES ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
|
||||||
// 0 = no
|
|
||||||
// 1 = yes
|
|
||||||
// 2 = all
|
|
||||||
int confirm3 (const std::string& question)
|
|
||||||
{
|
|
||||||
std::vector <std::string> options;
|
|
||||||
options.push_back (STRING_UTIL_CONFIRM_YES_U);
|
|
||||||
options.push_back (STRING_UTIL_CONFIRM_YES);
|
|
||||||
options.push_back (STRING_UTIL_CONFIRM_NO);
|
|
||||||
options.push_back (STRING_UTIL_CONFIRM_ALL_U);
|
|
||||||
options.push_back (STRING_UTIL_CONFIRM_ALL);
|
|
||||||
|
|
||||||
std::string answer;
|
|
||||||
std::vector <std::string> matches;
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
std::cout << question
|
|
||||||
<< " ("
|
|
||||||
<< options[1] << "/"
|
|
||||||
<< options[2] << "/"
|
|
||||||
<< options[4]
|
|
||||||
<< ") ";
|
|
||||||
|
|
||||||
std::getline (std::cin, answer);
|
|
||||||
answer = trim (answer);
|
|
||||||
autoComplete (answer, options, matches, 1); // Hard-coded 1.
|
|
||||||
}
|
|
||||||
while (matches.size () != 1);
|
|
||||||
|
|
||||||
if (matches[0] == STRING_UTIL_CONFIRM_YES_U) return 1;
|
|
||||||
else if (matches[0] == STRING_UTIL_CONFIRM_YES) return 1;
|
|
||||||
else if (matches[0] == STRING_UTIL_CONFIRM_ALL_U) return 2;
|
|
||||||
else if (matches[0] == STRING_UTIL_CONFIRM_ALL) return 2;
|
|
||||||
else return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// 0 = no
|
// 0 = no
|
||||||
// 1 = yes
|
// 1 = yes
|
||||||
|
|||||||
@@ -41,7 +41,6 @@
|
|||||||
|
|
||||||
// util.cpp
|
// util.cpp
|
||||||
bool confirm (const std::string&);
|
bool confirm (const std::string&);
|
||||||
int confirm3 (const std::string&);
|
|
||||||
int confirm4 (const std::string&);
|
int confirm4 (const std::string&);
|
||||||
void delay (float);
|
void delay (float);
|
||||||
std::string formatBytes (size_t);
|
std::string formatBytes (size_t);
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ int main (int argc, char** argv)
|
|||||||
unsetenv ("TASKRC");
|
unsetenv ("TASKRC");
|
||||||
|
|
||||||
// TODO bool confirm (const std::string&);
|
// TODO bool confirm (const std::string&);
|
||||||
// TODO int confirm3 (const std::string&);
|
|
||||||
// TODO int confirm4 (const std::string&);
|
// TODO int confirm4 (const std::string&);
|
||||||
// TODO void delay (float);
|
// TODO void delay (float);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user