upd: ready to lex the command

This commit is contained in:
2023-12-13 04:42:33 +00:00
parent af3d49c3d3
commit 132eeded36
6 changed files with 139 additions and 6 deletions

View File

@ -140,4 +140,21 @@ class OperationLogItemClass {
char command[256];
int fid;
};
enum OperationType {
__Ksu,
__Klogout,
__Kregister,
__Kpasswd,
__Kuseradd,
__Kdelete,
__Kshow,
__Kbuy,
__Kselect,
__Kmodify,
__Kimport,
__Kshowfinance,
__Klog,
__Kreport,
};
#endif // PROTECTOR_UTILITY_H

View File

@ -5,13 +5,14 @@
#include <vector>
#include "database.h"
#include "lexer.h"
class BookStoreEngineClass {
std::string config_dir;
UserDataBase user_data_base;
bool is_server;
public:
BookStoreEngineClass() = delete;
BookStoreEngineClass(std::string __config_dir);
BookStoreEngineClass(std::string __config_dir, bool __is_server);
std::vector<std::string> Execute(const std::string &cmd,
std::stack<std::string> &login_stack);
};

10
backend/include/lexer.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef PROTECTOR_LEXER_H
#define PROTECTOR_LEXER_H
#include <regex>
#include <sstream>
#include <string>
#include <vector>
bool CommandShowLexer(const std::string &command, std::string &ISBN,
std::string &name, std::string &author,
std::string &keyword);
#endif // PROTECTOR_LEXER_H