stringtable.h
来自「这是一个用来编译pascal的一个小程序有些还不行但也发了」· C头文件 代码 · 共 69 行
H
69 行
// StringTable.h: interface for the StringTable class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_STRINGTABLE_H__FF3024B7_09CB_419C_89C8_CD8CA5E90E09__INCLUDED_)
#define AFX_STRINGTABLE_H__FF3024B7_09CB_419C_89C8_CD8CA5E90E09__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "stringtableelement.h"
#define DEFAULT_LENGTH 1024
class StringTable
{
private:
int i_length;
// talbe length
StringTableElement* table;
// table
int i_maxLength;
// table max size
CString s_tableName;
// table name
int i_enlargeLength;
// enlarge length
bool b_sort;
// if sort, init at contruct function
public:
StringTable();
StringTable(StringTable& table);
StringTable(CString tableName, bool sort = true);
virtual ~StringTable();
public:
bool CreateTable(int maxLength = DEFAULT_LENGTH);
// creat table, if this table is black
void EnlargeTable(int enlargeLength = DEFAULT_LENGTH);
// enlarge the table
void SetEnlargeLength(int length);
// set enlarge length
void DeleteTable();
// delete table
bool InsertElement(int type, CString name);
// insert element
bool InsertElement(StringTableElement te);
// insert element
StringTableElement operator [](int index);
// get element
int MatchType(CString ename);
// match string, get element type
CString ToString();
// ToString
int GetLength();
// get table length
void SetName(CString name);
// set table name
private:
int IndexToInsert(StringTableElement te);
// get where in the table can insert the element
};
#endif // !defined(AFX_STRINGTABLE_H__FF3024B7_09CB_419C_89C8_CD8CA5E90E09__INCLUDED_)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?