1 /* |
|
2 * Copyright (c) 2010 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __HELLOTRACEINTERFACEDUP2_H__ |
|
20 #define __HELLOTRACEINTERFACEDUP2_H__ |
|
21 |
|
22 #include "HelloTracePanic.h" |
|
23 #include "OstTraceDefinitions.h" |
|
24 #ifdef OST_TRACE_COMPILER_IN_USE |
|
25 #include "HelloTraceInterfaceDup2Traces.h" |
|
26 #endif |
|
27 |
|
28 inline EXPORT_C TVersion CHelloTraceInterface::VersionDup2() |
|
29 { |
|
30 const TInt KMajor = 1; |
|
31 const TInt KMinor = 0; |
|
32 const TInt KBuild = 1; |
|
33 TVersion version = TVersion(KMajor, KMinor, KBuild); |
|
34 OstTraceExt1( TRACE_BORDER, CHELLOTRACEDLL_VERSION_DUP2, "CHelloTraceInterface::Version = %S", version.Name()); |
|
35 return version; |
|
36 } |
|
37 |
|
38 inline EXPORT_C const TPtrC CHelloTraceInterface::StringDup2() const |
|
39 { |
|
40 __ASSERT_ALWAYS(iString != NULL, Panic(EHelloTraceDllNullPointer)); |
|
41 |
|
42 OstTraceDefExt2( OST_TRACE_CATEGORY_DEBUG, TRACE_BORDER, CHELLOTRACEDLL_STRING_DUP2, |
|
43 "[0x%08x] Returned %S", (TUint32) this, *iString); |
|
44 return *iString; |
|
45 } |
|
46 |
|
47 inline EXPORT_C void CHelloTraceInterface::AddCharDup2L(const TChar& aChar) |
|
48 { |
|
49 __ASSERT_ALWAYS(iString != NULL, Panic(EHelloTraceDllNullPointer)); |
|
50 |
|
51 OstTraceExt3( TRACE_BORDER, CHELLOTRACEDLL_ADDCHARL_DUP2, |
|
52 "[0x%08x] Adding %d to %S", (TUint32) this, (TInt32) aChar, *iString); |
|
53 if (iString->Length() >= KHelloTraceDllBufferLength) |
|
54 { |
|
55 OstTrace1( TRACE_ERROR, CHELLOTRACEDLL_ADDCHARL_ERR_DUP2, |
|
56 "[0x%08x] Not enough space to add character", (TUint32) this); |
|
57 User::Leave( KErrTooBig); |
|
58 } |
|
59 iString->Append(aChar); |
|
60 } |
|
61 |
|
62 inline EXPORT_C void CHelloTraceInterface::RemoveLastDup2() |
|
63 { |
|
64 __ASSERT_ALWAYS(iString != NULL, Panic(EHelloTraceDllNullPointer)); |
|
65 |
|
66 OstTraceExt2( TRACE_BORDER, CHELLOTRACEDLL_REMOVELAST_DUP2, |
|
67 "[0x%08x] Attempting to remove last character from %S", (TUint32) this, *iString); |
|
68 if (iString->Length() > 0) |
|
69 { |
|
70 iString->SetLength(iString->Length() - 1); |
|
71 } |
|
72 else |
|
73 { |
|
74 OstTrace1( TRACE_WARNING, CHELLOTRACEDLL_REMOVELAST_WARN_DUP2, "[0x%08x] String already empty", (TUint32) this); |
|
75 } |
|
76 } |
|
77 |
|
78 inline EXPORT_C void CHelloTraceInterface::ResetStringDup2() |
|
79 { |
|
80 OstTraceExt2( TRACE_BORDER, CHELLOTRACEDLL_RESETSTRING_DUP2, "[0x%08x] Reseting string %S", (TUint32) this, *iString); |
|
81 if (iString == NULL) |
|
82 { |
|
83 iString = new (ELeave) THelloTraceDllExampleString; |
|
84 } |
|
85 else |
|
86 { |
|
87 iString->SetLength(0); |
|
88 } |
|
89 } |
|
90 #endif // __HELLOTRACEINTERFACEDUP2_H__ |
|
91 |
|