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

📄 scope.cpp

📁 这是一个能够自动生成文档的程序
💻 CPP
字号:

#include "stdafx.h"

#include "Scope.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

BEGIN_TEST_DUMP(CScope)
    TEST_DUMP(mCurrScope)
    TEST_DUMP(mCurrScopeName)
    TEST_DUMP(mEyeableScopes)
END_TEST_DUMP()


CScope::CScope()
{
    Init();
}

CScope::~CScope()
{
    Init();
}

NOTEST
void CScope::Init()
{
	POSITION pos = NULL;

	pos = mCurrScope.GetHeadPosition();
	while(pos != NULL)
		delete mCurrScope.GetNext(pos);
	mCurrScope.RemoveAll();

	pos = mEyeableScopes.GetHeadPosition();
	while(pos != NULL)
	    delete mEyeableScopes.GetNext(pos);
    mEyeableScopes.RemoveAll();

	mCurrScopeName = "";
}

void CScope::EnterScope(LPCTSTR iScope) 
{
	ASSERT(iScope != NULL);

	CString* pScope = new CString(iScope); 
	mCurrScope.AddTail(pScope);

    mCurrScopeName.Empty();
	POSITION pos = mCurrScope.GetHeadPosition();
	while(pos != NULL)
	{
		CString* pScope = mCurrScope.GetNext(pos);
		ASSERT(pScope != NULL);
		mCurrScopeName += *pScope;
		mCurrScopeName += "::";
	}

	TEST_TRACE(mCurrScopeName);
}

void CScope::ExitScope() 
{
	if(!mCurrScope.IsEmpty())
	{
	    delete mCurrScope.GetTail();
	    mCurrScope.RemoveTail();
    }

    if(mCurrScope.IsEmpty())
	{
		mCurrScopeName = "";
		return;
	}

    mCurrScopeName.Empty();
	POSITION pos = mCurrScope.GetHeadPosition();
	while(pos != NULL)
	{
		CString* pScope = mCurrScope.GetNext(pos);
		ASSERT(pScope != NULL);
		mCurrScopeName += *pScope;
		mCurrScopeName += "::";
	}

	TEST_TRACE(mCurrScopeName);
}

⌨️ 快捷键说明

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