column.h

来自「一个经典的词法分析器」· C头文件 代码 · 共 35 行

H
35
字号
enum columnTypes {
	CUNDEFINED,
	CSTRING,
	CFLOAT,
	CLONG,
	CINT,
	CUNSIGNED,
	CTIME
};

class CColumn : public CObject
{
public:
	DLL_EXPORT CColumn(CString name, int type, int width);	// create a column descriptor
	DLL_EXPORT ~CColumn();
	DLL_EXPORT CString Name();								// name of this column
	DLL_EXPORT int Type();									// type of this column
	DLL_EXPORT int Width();									// maximum width of this column
	DLL_EXPORT void *Value();								// return what this thing points to
	DLL_EXPORT void Value(const void *);					// set the value pointer

	DLL_EXPORT void Value(char *s);							// set a string value
	DLL_EXPORT void Value(int);								// set a value from the int
	DLL_EXPORT void Value(double);							// set a value from a float
	DLL_EXPORT void Value(unsigned);						// set a value from an unsigned
	DLL_EXPORT void SetValueByType(CString);				// set a value from string by type
	DLL_EXPORT void *operator new(size_t t);
	DLL_EXPORT void operator delete(void *ptr);

private:
	SCString *name;							// column name attribute
	int width;								// max width attribute
	int type;								// type of this attribute
	void *value;							// value of this attribute	
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?