writing book system

This commit is contained in:
2023-12-13 12:48:58 +00:00
parent b7a17f2997
commit 9df19f31f2
4 changed files with 90 additions and 8 deletions

View File

@ -23,16 +23,19 @@ class UserDataBase {
};
class BookDataBase {
DriveArray<BookItemClass> full_book_data;
String2Index indexer;
String2Index ISBN2index, name2index, author2index, keyword2index;
public:
void Open(std::string file_name);
bool HaveISBN(const std::string &ISBN);
void CreateEmptyBook(const std::string &ISBN);
void QueryBook(const std::string &ISBN, const std::string &name,
const std::string &author, const std::string &keyword,
std::vector<BookItemClass> &ret);
void ModifyInfo(const std::string &ISBN,const std::string &new_ISBN, const std::string &name,
const std::string &author, const std::string &keyword,
double price);
void ModifyInfo(const std::string &ISBN, const std::string &new_ISBN,
const std::string &name, const std::string &author,
const std::string &keyword, double price,
int quantity_remain);
};
class LogDataBase {
DriveArray<FinanceItemClass> finance_data;

View File

@ -27,4 +27,5 @@ bool CommandModifyLexer(const std::string &command, std::string &ISBN,
bool CommandImportLexer(const std::string &command, int &quantity,
double &total_cost);
bool CommandShowfinanceLexer(const std::string &command,int &count);
bool KeyWordSpliter(const std::string &keyword, std::vector<std::string> &words);
#endif // PROTECTOR_LEXER_H