⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 variable.h

📁 这是一个能够自动生成文档的程序
💻 H
字号:
#ifndef __VARIABLE_H__
#define __VARIABLE_H__
#pragma once

#include "Identifier.h"
class CVariable;
#include "afxtempl.h"
typedef CList<CVariable*, CVariable*> CVariableList;


//变量对象
class CVariable : public CIdentifier
{
public:
	//构造函数
	CVariable(LPCTSTR iName=NULL, LPCTSTR iPureType=NULL, LPCTSTR iType=NULL);
	//析构函数
	virtual ~CVariable();

public:
	//解析变量代码
	static void ParseVariable(CTokenList& iList, UINT iAccessTrim, CVariableList& oVarList, BOOL iDefinition=TRUE);
	//将从变量定义代码中解析得到的对象合并到由声明解析得到的变量
	//也可能是使用extern在多处声明
	void UniteVariable(CVariable* ipOther);

	//插入类型的一部分,插入到类型字串的前面
	//如CMyClas*&, 将按这种顺序加入&, *, CMyClass
	void InsertTypePart(LPCTSTR iType) {mType.Insert(0, iType);};
	//不知道是干什么的
	void UniteType(CToken* ipOperator);
    //取得变量的类型
	void GetType(CString& oType) {oType = mType;};
	//取得变量的纯粹的类型
	void GetPureType(CString& oPureType) { oPureType = mPureType;};
	//设置变量的类型
	void SetType(LPCTSTR iType) { mType = iType;};
	//设置变量的纯粹的类型
	void SetPureType(LPCTSTR iPureType) { mPureType = iPureType;};
	//设置变量中的数组部分
	void SetArray(LPCTSTR iArray) {mArray = iArray;};

private:
	//解析一个变量
	static BOOL ParseOneVariable(CVariable*& opVar, CTokenList& iList, 
		POSITION& ioPos, LPCTSTR iType);
	//解析变量类型
	static void ParseVariableType(CTokenList& ioList, POSITION& ioPos, 
		BOOL& oDefinition, CString& oType, UINT& oTrim);


private:
	CString  mType;       //完整的类名 如 const CList<CString*, CString*>*
	CString  mPureType;   //单纯的类名 如 CList;
	CString  mArray;      //记录表示数组的字串

    UNIT_TEST(CVariable)
};

DECLARE_TEST_DUMP(CVariable)

#endif

⌨️ 快捷键说明

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