Added a nested switch for different search methods, still only model
search available
This commit is contained in:
parent
dc11fd691f
commit
97ed88bd3a
23
src/main.cpp
23
src/main.cpp
@ -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";
|
||||||
@ -38,12 +39,22 @@ int main() {
|
|||||||
std::cout << "(Q)uit hardware database\n";
|
std::cout << "(Q)uit hardware database\n";
|
||||||
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:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user