|
1 /* |
|
2 * Copyright (c) 2002 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: ExifLibTest |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include "AssertFailure.h" |
|
20 |
|
21 |
|
22 CAssertFailure* CAssertFailure::NewL (const TDesC8& aMessage, |
|
23 TInt aLineNumber, |
|
24 const TDesC8& aFileName) |
|
25 { |
|
26 CAssertFailure* self=NewLC(aMessage, aLineNumber, aFileName); |
|
27 CleanupStack::Pop(); |
|
28 return self; |
|
29 } |
|
30 |
|
31 |
|
32 CAssertFailure* CAssertFailure::NewLC (const TDesC8& aMessage, |
|
33 TInt aLineNumber, |
|
34 const TDesC8& aFileName) |
|
35 |
|
36 { |
|
37 CAssertFailure* self = new (ELeave) CAssertFailure(aLineNumber); |
|
38 CleanupStack::PushL(self); |
|
39 self->ConstructL(aMessage, aFileName); |
|
40 return self; |
|
41 } |
|
42 |
|
43 |
|
44 CAssertFailure* CAssertFailure::NewL (CAssertFailure& aAssertFailure) |
|
45 { |
|
46 CAssertFailure* self=NewLC(aAssertFailure); |
|
47 CleanupStack::Pop(); |
|
48 return self; |
|
49 } |
|
50 |
|
51 |
|
52 CAssertFailure* CAssertFailure::NewLC (CAssertFailure& aAssertFailure) |
|
53 { |
|
54 CAssertFailure* self = new(ELeave)CAssertFailure; |
|
55 CleanupStack::PushL(self); |
|
56 self->ConstructL(aAssertFailure); |
|
57 return self; |
|
58 } |
|
59 |
|
60 |
|
61 void CAssertFailure::ConstructL (const TDesC8& aMessage, |
|
62 const TDesC8& aFileName) |
|
63 { |
|
64 iMessage = aMessage.AllocL(); |
|
65 iFileName = aFileName.AllocL(); |
|
66 } |
|
67 |
|
68 |
|
69 void CAssertFailure::ConstructL (CAssertFailure& aAssertFailure) |
|
70 { |
|
71 iLineNumber = aAssertFailure.iLineNumber; |
|
72 iMessage = aAssertFailure.iMessage->AllocL(); |
|
73 iFileName = aAssertFailure.iFileName->AllocL(); |
|
74 } |
|
75 |
|
76 |
|
77 CAssertFailure::CAssertFailure () |
|
78 { |
|
79 } |
|
80 |
|
81 |
|
82 CAssertFailure::CAssertFailure (TInt aLineNumber) |
|
83 : iLineNumber (aLineNumber) |
|
84 { |
|
85 } |
|
86 |
|
87 |
|
88 CAssertFailure::~CAssertFailure () |
|
89 { |
|
90 delete iFileName; |
|
91 delete iMessage; |
|
92 } |
|
93 |
|
94 |
|
95 const TDesC8& CAssertFailure::What() const |
|
96 { |
|
97 return *iMessage; |
|
98 } |
|
99 |
|
100 |
|
101 TInt CAssertFailure::LineNumber() const |
|
102 { |
|
103 return iLineNumber; |
|
104 } |
|
105 |
|
106 |
|
107 const TDesC8& CAssertFailure::FileName() const |
|
108 { |
|
109 return *iFileName; |
|
110 } |
|
111 |
|
112 |
|
113 void CAssertFailure::SetMyHeapCellCount (TInt aHeapCellCount) |
|
114 { |
|
115 iMyHeapCellCount = aHeapCellCount; |
|
116 } |
|
117 |
|
118 |
|
119 TInt CAssertFailure::MyHeapCellCount () |
|
120 { |
|
121 return iMyHeapCellCount; |
|
122 } |