45
|
1 |
// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#include <textbase.h>
|
|
17 |
#include "TextBasePanic.h"
|
|
18 |
//#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
|
19 |
//#include <graphics/gdi/gdistructs.h>
|
|
20 |
//#include <graphics/gdi/gdiconsts.h>
|
|
21 |
//#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
|
|
22 |
|
|
23 |
|
|
24 |
// Global panic function
|
|
25 |
|
|
26 |
_LIT(KTextBasePanicCategory,"TextBase");
|
|
27 |
|
|
28 |
void TextBasePanic(TTextBasePanic aError)
|
|
29 |
{
|
|
30 |
User::Panic(KTextBasePanicCategory,aError);
|
|
31 |
}
|
|
32 |
|
|
33 |
_LIT(KTextBasePanicDesc1, "TextBase internal Panic %S, in file %S @ line %i");
|
|
34 |
_LIT(KTextBasePanicDesc2, "Assert condition = \"%S\"");
|
|
35 |
_LIT(KTextBasePanicDesc3, "TextBase internal %S, in file %S @ line %i");
|
|
36 |
|
|
37 |
void TextBasePanicWithCondAndInfo(TTextBasePanic aError, const TDesC& aCondition, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine)
|
|
38 |
{
|
|
39 |
TBuf<256> buf;
|
|
40 |
buf.Format(KTextBasePanicDesc1, &aPanicName, &aFileName, aLine);
|
|
41 |
RDebug::Print(buf);
|
|
42 |
|
|
43 |
buf.Format(KTextBasePanicDesc2, &aCondition);
|
|
44 |
RDebug::Print(buf);
|
|
45 |
TextBasePanic(aError);
|
|
46 |
}
|
|
47 |
|
|
48 |
void TextBasePanicLogWithInfo(const TDesC& aCommand, const TDesC& aCondition, const TDesC& aFileName, TInt aLine)
|
|
49 |
{
|
|
50 |
TBuf<256> buf;
|
|
51 |
buf.Format(KTextBasePanicDesc3, &aCommand, &aFileName, aLine);
|
|
52 |
RDebug::Print(buf);
|
|
53 |
|
|
54 |
buf.Format(KTextBasePanicDesc2, &aCondition);
|
|
55 |
RDebug::Print(buf);
|
|
56 |
}
|