?? minisql.cpp
字號:
#include "MiniSQL.h"
#include<iostream.h>
extern _M_Buffer Buffer;
extern unsigned int BTreeNodeSize;
extern char* ErrorMessage[];
extern char CurLocation[256];
extern char CurRelationName[33];
extern unsigned int SizeOfPageHead;
void Init_MiniSQL();
void Run_MiniSQL();
void Exit_MiniSQL();
void Init_MiniSQL()
{
cout<<" WELCOME TO USE OUR MINISQL!";
Buffer.Start(); // initialize the buffer
}
void Exit_MiniSQL()
{
Buffer.End(); // close the buffer
return;
}
void Run_MiniSQL()
{
MSG msg = DEFAULT; // make msg != QUIT
while(QUIT != msg) // quit the program
{
try
{
TB_Create_Info* pCreateInfo;
TB_Select_Info* pSelectInfo;
TB_Insert_Info* pInsertInfo;
TB_Update_Info* pUpdateInfo;
TB_Delete_Info* pDeleteInfo;
// get commmand from API and execute according operation
msg = GetCommand(&pCreateInfo,&pSelectInfo,
&pInsertInfo,&pUpdateInfo,&pDeleteInfo);
switch(msg)
{
case CREATE : Create( *pCreateInfo ); break;
case SELECT : Select( *pSelectInfo ); break;
case INSERT : Insert( *pInsertInfo ); break;
case UPDATE : Update( *pUpdateInfo ); break;
case DELETE : Delete( *pDeleteInfo ); break;
case DROP : Ctrl_DropTB(); break;
case DROPDB : Ctrl_DropDB(); break;
case QUIT : break;
default : break;
}
}
catch (int ERROR_CODE)
{
//print the error message
// DispatchError(ERROR_CODE);
}
}
return;
}
#include "MiniSQL.h"
extern _M_Buffer Buffer;
extern unsigned int BTreeNodeSize;
extern char* ErrorMessage[];
extern char CurLocation[256];
extern char CurRelationName[33];
extern unsigned int SizeOfPageHead;
void Init_MiniSQL();
void Run_MiniSQL();
void Exit_MiniSQL();
/*
void Init_MiniSQL()
{
cout<<" WELCOME TO USE OUR MINISQL!";
Buffer.Start(); // initialize the buffer
}
void Exit_MiniSQL()
{
Buffer.End(); // close the buffer
return;
}
void Run_MiniSQL()
{
MSG msg = DEFAULT; // make msg != QUIT
while(QUIT != msg) // quit the program
{
try
{
TB_Create_Info* pCreateInfo;
TB_Select_Info* pSelectInfo;
TB_Insert_Info* pInsertInfo;
TB_Update_Info* pUpdateInfo;
TB_Delete_Info* pDeleteInfo;
// get commmand from API and execute according operation
msg = GetCommand(&pCreateInfo,&pSelectInfo,
&pInsertInfo,&pUpdateInfo,&pDeleteInfo);
switch(msg)
{
case CREATE : Create( *pCreateInfo ); break;
case SELECT : Select( *pSelectInfo ); break;
case INSERT : Insert( *pInsertInfo ); break;
case UPDATE : Update( *pUpdateInfo ); break;
case DELETE : Delete( *pDeleteInfo ); break;
case DROP : Ctrl_DropTB(); break;
case DROPDB : Ctrl_DropDB(); break;
case QUIT : break;
default : break;
}
}
catch (int ERROR_CODE)
{
//print the error message
DispatchError(ERROR_CODE);
}
}
return;
}
*/
int main()
{
Init_MiniSQL(); //初始化一些基本配置
Run_MiniSQL(); //交互操作,是本程序的主體
Exit_MiniSQL(); //善后操作,在退出
return 1;
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -