-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDBStatement.h
60 lines (38 loc) · 1.28 KB
/
DBStatement.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// Created by Cao Zongheng on 4/14/20.
//
// Database Statements: DescribeStatement, separate from DBManager
// Show all the blocks in this database file
#ifndef ECE141_SP20_ASSIGNMENT2_ZONGHENG_CAO_DBSTATEMENT_H
#define ECE141_SP20_ASSIGNMENT2_ZONGHENG_CAO_DBSTATEMENT_H
#include "Interface/Statement.hpp"
namespace ECE141{
class DBStatement : public Statement{
public:
DBStatement(std::string aname, Keywords aStatementType = Keywords::unknown_kw){
stmtType = aStatementType;
name = aname;
}
DBStatement(const DBStatement &aCopy){
name = aCopy.name;
stmtType = aCopy.stmtType;
}
~DBStatement(){};
//getter
virtual std::string getName() const{ return name;}
protected:
std::string name;
};
class DescribeStatement : public Statement{
public:
DescribeStatement(std::string aname, Keywords aStatementType = Keywords::unknown_kw){
stmtType = aStatementType;
name = aname;
}
virtual std::string getName() const{ return name;}
virtual StatusResult run(std::ostream &aStream) const;
protected:
string name;
};
}
#endif //ECE141_SP20_ASSIGNMENT2_ZONGHENG_CAO_DBSTATEMENT_H