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

📄 callstack.cpp

📁 本例是SYMBIAN C++一个创建短信的例子
💻 CPP
字号:
#include "CallStack.h"

TCallStackItem::TCallStackItem(const TDesC8& Name)
{
#ifdef CALLSTACK_DEBUG
	iNqLogger.Write(Name);

	if(Name.Length() > iName.MaxLength())
		iName.Copy(Name.Left(iName.MaxLength()));
	else
		iName.Copy(Name);

#ifdef FUNCTION_LEVEL_STATISTICS		
		iStartTicks=User::TickCount();
#endif // FUNCTION_LEVEL_STATISTICS
#endif // CALLSTACK_DEBUG
}

TCallStackItem::TCallStackItem(const TDesC8& Class, const TDesC8& Func)
{
#ifdef CALLSTACK_DEBUG
	iNqLogger.WriteFormat(_L8("%S::%S"), &Class, &Func);

	if(Class.Length() >  iName.MaxLength())
	{
		iName.Copy(Class.Left(iName.MaxLength()));
	}
	else
	{
		iName.Copy(Class);
		iName.Append(_L8("::"));

		if(Func.Length() >  (iName.MaxLength() - iName.Length()))
			iName.Append(Func.Left((iName.MaxLength() - iName.Length())));
		else
			iName.Append(Func);
	}

#ifdef FUNCTION_LEVEL_STATISTICS		
		iStartTicks=User::TickCount();
#endif // FUNCTION_LEVEL_STATISTICS
#endif // CALLSTACK_DEBUG
}

TCallStackItem::~TCallStackItem()
{
#ifdef CALLSTACK_DEBUG
#ifdef FUNCTION_LEVEL_STATISTICS
	TUint elapsed=User::TickCount()- iStartTicks;
	iNqLogger.WriteFormat(_L8("~%S : %d ELAPSED"), &iName, elapsed);
#else
	iNqLogger.WriteFormat(_L8("~%S"), &iName);
#endif // FUNCTION_LEVEL_STATISTICS
#endif // CALLSTACK_DEBUG
}

#ifdef CALLSTACK_DEBUG
TBool DbAssertFailedLine(const TDesC8& aExpression, const TDesC8& aFileName, int aLine)
{
	iNqLogger.WriteFormat(_L8("(%S)... File %S, Line %d"), &aExpression, &aFileName, aLine);
	return ETrue;
}
#endif // CALLSTACK_DEBUG

⌨️ 快捷键说明

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