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 the License "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 * Library to add s32strm support for IPC (ie. stream via multiple IPC read/writes instead of |
|
16 * copying to a buffer and streaming to/from there. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 /** |
|
22 @file |
|
23 */ |
|
24 #include "sisregistryserveripcbuf.h" |
|
25 |
|
26 |
|
27 void RIpcBuf::Open(const RMessage2& aMessage, TInt aMessageSlot) |
|
28 { |
|
29 iMessage = aMessage; |
|
30 iMessageSlot = aMessageSlot; |
|
31 iReadPos = 0; |
|
32 iWritePos = 0; |
|
33 } |
|
34 |
|
35 |
|
36 |
|
37 TInt RIpcBuf::DoReadL(TAny *aPtr, TInt aMaxLength) |
|
38 { |
|
39 TPtr8 ptr((TUint8*)aPtr, aMaxLength); |
|
40 iMessage.ReadL(iMessageSlot, ptr, iReadPos); |
|
41 TInt len = ptr.Length(); |
|
42 iReadPos += len; |
|
43 return len; |
|
44 } |
|
45 |
|
46 void RIpcBuf::DoWriteL(const TAny* aPtr,TInt aLength) |
|
47 { |
|
48 TPtr8 ptr((TUint8*)aPtr, aLength, aLength); |
|
49 iMessage.WriteL(iMessageSlot, ptr, iWritePos); |
|
50 iWritePos += aLength; |
|
51 } |
|
52 |
|
53 |