equal
deleted
inserted
replaced
|
1 /* |
|
2 * Copyright (c) 2007-2009 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: Serializard data buffer container |
|
15 * |
|
16 */ |
|
17 |
|
18 #include <mdedatabuffer.h> |
|
19 |
|
20 #include "mdcserializationbuffer.h" |
|
21 |
|
22 EXPORT_C RMdEDataBuffer::RMdEDataBuffer() : iBuffer( NULL ) |
|
23 { |
|
24 } |
|
25 |
|
26 EXPORT_C void RMdEDataBuffer::Close() |
|
27 { |
|
28 if( iBuffer ) |
|
29 { |
|
30 delete iBuffer; |
|
31 iBuffer = NULL; |
|
32 } |
|
33 } |
|
34 |
|
35 void RMdEDataBuffer::SetBufferL(CMdCSerializationBuffer* aBuffer) |
|
36 { |
|
37 if( !iBuffer ) |
|
38 { |
|
39 iBuffer = aBuffer; |
|
40 } |
|
41 else |
|
42 { |
|
43 User::Leave( KErrCorrupt ); |
|
44 } |
|
45 } |
|
46 |
|
47 CMdCSerializationBuffer* RMdEDataBuffer::GetBufferLC() |
|
48 { |
|
49 CMdCSerializationBuffer* buffer = iBuffer; |
|
50 iBuffer = NULL; // cleanup stack handles deletion, if PushL leaves |
|
51 CleanupStack::PushL( buffer ); |
|
52 return buffer; |
|
53 } |
|
54 |