First public contribution.
1 // Copyright (c) 2007-2009 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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // General inline utility and logging functions for use with DirectGDI.
24 #ifndef DIRECTGDIPANICS_INL
25 #define DIRECTGDIPANICS_INL
30 _LIT(KDGDILogFormat, "File %S +%i: %S");
31 _LIT(KDGDINonConditionalPanicFormat, "Panic: %S %i.");
32 _LIT(KDGDIConditionalPanicFormat, "Panic: %S %i, assert \"%S\" failed.");
38 Helper function used by the GRAPHICS_LOG_ALWAYS and GRAPHICS_LOGD_ALWAYS macros.
40 inline void Log(const TDesC& aFileName, TInt aLine, const TDesC& aLogMessage)
43 buf.Format(KDGDILogFormat, &aFileName, aLine, &aLogMessage);
48 Helper function used by GRAPHICS_ASSERT_ALWAYS and GRAPHICS_PANIC_ALWAYS macros
49 which allows a panic category and code to be logged.
51 inline void PanicWithDebugLog (
52 const TDesC& aPanicCategory,
54 const TDesC& aFileName,
56 const TDesC* aCondition)
62 message.Format(KDGDIConditionalPanicFormat, &aPanicCategory, aPanicCode, aCondition);
66 message.Format(KDGDINonConditionalPanicFormat, &aPanicCategory, aPanicCode);
69 Log(aFileName, aLine, message);
71 User::Panic(aPanicCategory, aPanicCode);
75 #endif // DIRECTGDIPANICS_INL