📄 table.h
字号:
#ifndef TABLE_H#define TABLE_H#include "source.h"// Table is a class which is built up upon the Source class. It// constructs an array according to the source. Each line in// the source is a row in the table. Each field separated by// the delimiter is a column class Table { int row; // Number of instance int col; // Number of fields (attributes and class column)public: Description **head; Table(); Table(Source &src); Table(Source &src, int isExtended); ~Table(); Description **alloc(); // allocate memory to the head void dealloc(Description **head); // deallocate memory to the head int numOfRows() { return row; } int numOfColumns() { return col; } int setRow(int r) { row = r; } int setCol(int c) { col = c; } int Row() { return row; } int Col() { return col; } int isInRange(int r, int c); // is the (r,c) out of bound int isEmpty(); // is the table empty? Description value(int r, int c); // return the value description void setValue(int r, int c, Description d); // set the description Description* getRow(int r); // return the row pointer or instance void removeSerialColumn();private: void read(Source &src); // read from the source // read from the source, but keep the extension column // skipped void readForExtension(Source &src);};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -