📄 stringtable.h
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -