os/textandloc/fontservices/textbase/sgdi/TextBasePanic.cpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/textandloc/fontservices/textbase/sgdi/TextBasePanic.cpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,56 @@
     1.4 +// Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     1.5 +// All rights reserved.
     1.6 +// This component and the accompanying materials are made available
     1.7 +// under the terms of "Eclipse Public License v1.0"
     1.8 +// which accompanies this distribution, and is available
     1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.10 +//
    1.11 +// Initial Contributors:
    1.12 +// Nokia Corporation - initial contribution.
    1.13 +//
    1.14 +// Contributors:
    1.15 +//
    1.16 +// Description:
    1.17 +//
    1.18 +
    1.19 +#include <textbase.h>
    1.20 +#include "TextBasePanic.h"
    1.21 +//#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS	
    1.22 +//#include <graphics/gdi/gdistructs.h>
    1.23 +//#include <graphics/gdi/gdiconsts.h>
    1.24 +//#endif //SYMBIAN_ENABLE_SPLIT_HEADERS	
    1.25 +
    1.26 +
    1.27 +// Global panic function
    1.28 +
    1.29 +_LIT(KTextBasePanicCategory,"TextBase");
    1.30 +
    1.31 +void TextBasePanic(TTextBasePanic aError)
    1.32 +	{
    1.33 +	User::Panic(KTextBasePanicCategory,aError);
    1.34 +	}
    1.35 +
    1.36 +_LIT(KTextBasePanicDesc1, "TextBase internal Panic %S, in file %S @ line %i");
    1.37 +_LIT(KTextBasePanicDesc2, "Assert condition = \"%S\"");
    1.38 +_LIT(KTextBasePanicDesc3, "TextBase internal %S, in file %S @ line %i");
    1.39 +
    1.40 +void TextBasePanicWithCondAndInfo(TTextBasePanic aError, const TDesC& aCondition, const TDesC& aFileName, const TDesC& aPanicName, TInt aLine)
    1.41 +	{
    1.42 +	TBuf<256> buf;
    1.43 +	buf.Format(KTextBasePanicDesc1, &aPanicName, &aFileName, aLine);
    1.44 +	RDebug::Print(buf);
    1.45 +
    1.46 +	buf.Format(KTextBasePanicDesc2, &aCondition);
    1.47 +	RDebug::Print(buf);
    1.48 +	TextBasePanic(aError);
    1.49 +	}
    1.50 +	
    1.51 +void TextBasePanicLogWithInfo(const TDesC& aCommand, const TDesC& aCondition, const TDesC& aFileName, TInt aLine)
    1.52 +	{
    1.53 +	TBuf<256> buf;
    1.54 +	buf.Format(KTextBasePanicDesc3, &aCommand, &aFileName, aLine);
    1.55 +	RDebug::Print(buf);
    1.56 +	
    1.57 +	buf.Format(KTextBasePanicDesc2, &aCondition);
    1.58 +	RDebug::Print(buf);
    1.59 +	}