|
1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Active Scheduler Test Module |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef OUTPUT_PRINTER_H |
|
20 #define OUTPUT_PRINTER_H |
|
21 |
|
22 #if defined (_MSC_VER) && (_MSC_VER >= 1000) |
|
23 #pragma once |
|
24 #endif |
|
25 |
|
26 #include <StifTestInterface.h> |
|
27 #include <StifLogger.h> |
|
28 #include "TestModuleConstants.h" |
|
29 |
|
30 class COutputPrinter : CBase |
|
31 { |
|
32 public: |
|
33 COutputPrinter(CTestModuleBase *aTestModule, CStifLogger *aLogger, const TDesC &aConsoleTrace, const TDesC &aTracePrefix, TInt aPrintPriority=0); |
|
34 |
|
35 private: |
|
36 void Echo(const TDesC &aMessage); |
|
37 void Echo(const TDesC &aFormat, const TDesC &aMessage); |
|
38 template<class T> void Echo (const TDesC &aFormat, T aMessage); |
|
39 public: |
|
40 void Printf(TRefByValue<const TDesC> aLogInfo, ...); |
|
41 |
|
42 CStifLogger *SetLogger(CStifLogger *aNewLogger); |
|
43 CTestModuleBase *SetTestModule(CTestModuleBase *aNewTestModule); |
|
44 |
|
45 private: |
|
46 TInt iPrintPriority; |
|
47 TBufC<KMaxMessageLength> iConsoleTrace; |
|
48 TBufC<KMaxMessageLength> iRDebugTracePrefix; |
|
49 CStifLogger *iOutLogger; //COutputPrinter does not own iLogger |
|
50 CTestModuleBase *iTestModule; //COutputPrinter does not own iTestModule |
|
51 }; |
|
52 #endif // OUTPUT_PRINTER_H |