Added a nested switch for different search methods, still only model

search available
This commit is contained in:
ganome 2025-01-31 16:32:12 -07:00
parent dc11fd691f
commit 97ed88bd3a
Signed by untrusted user who does not match committer: Ganome
GPG Key ID: 944DE53336D81B83

View File

@ -30,6 +30,7 @@ int main() {
createDB(dbFile); createDB(dbFile);
char quit = '&'; char quit = '&';
char searchby = '&';
while(tolower(quit) != 'q') { while(tolower(quit) != 'q') {
std::cout << "========================\n"; std::cout << "========================\n";
@ -39,11 +40,21 @@ int main() {
std::cin >> quit; std::cin >> quit;
switch(tolower(quit)) { switch(tolower(quit)) {
case 's': case 's':
std::cout << "Enter search string: "; std::cout << "What would you like to search by?\n";
std::cin >> msearch; std::cout << "(M)odel name\n";
msearchlower = boost::algorithm::to_lower_copy(msearch); std::cout << "(Q)uit\n";
searchTable(dbFile, msearchlower); // Replace this string with a variable that is the query grabbed from the user! std::cin >> searchby;
break; switch(tolower(searchby)) {
case 'm':
std::cout << "Enter search string: ";
std::cin >> msearch;
msearchlower = boost::algorithm::to_lower_copy(msearch);
searchTable(dbFile, msearchlower); // Replace this string with a variable that is the query grabbed from the user!
break;
default:
break;
}
break;
case 'q': case 'q':
break; break;
// default: // default: