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);
char quit = '&';
char searchby = '&';
while(tolower(quit) != 'q') {
std::cout << "========================\n";
@ -38,12 +39,22 @@ int main() {
std::cout << "(Q)uit hardware database\n";
std::cin >> quit;
switch(tolower(quit)) {
case 's':
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;
case 's':
std::cout << "What would you like to search by?\n";
std::cout << "(M)odel name\n";
std::cout << "(Q)uit\n";
std::cin >> searchby;
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':
break;
// default: