Update contrib.
1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
20 // -------------- Stream implementation ------------------------
22 EXPORT_C void CStreamBase2::CompleteRead(const RMessage2 &aMessage)
24 // retrieve the max length of the buffer the client has allocated
25 TInt length = aMessage.Int1();
26 // create a local buffer for placing characters to be written to
27 // client. This is a copy of the the iBuf internal buffer of the stream
30 if (length < buf.Length() )
32 // then we can't copy all the buffer to the client so we have reduce
34 buf.SetLength(length);
35 // delete appropriate part of stream's internal buffer
36 iBuf.Delete(0,length);
40 // we can copy all of the buffer to the client so we set the streams
41 // descriptor to zero length
44 // copy the local descriptor to the client.
45 TRAPD(ret,aMessage.WriteL(0, buf));
46 // inform the client of success/failure by completing the message
47 aMessage.Complete(ret);
51 EXPORT_C void CStreamFactoryBase2::AppendToStatus(const TDesC& aMsg) { iStatusMsg.Append(aMsg); }
53 EXPORT_C const TDesC& CStreamFactoryBase2::GetStatus() const { return iStatusMsg; }
55 // Dummy functions to replace previous exports so def file does not need reordering.
56 EXPORT_C void DummyReserved1() {};
57 EXPORT_C void DummyReserved2() {};
58 EXPORT_C void DummyReserved3() {};
59 EXPORT_C void DummyReserved4() {};
60 EXPORT_C void DummyReserved5() {};
61 EXPORT_C void DummyReserved6() {};
62 EXPORT_C void DummyReserved7() {};
63 EXPORT_C void DummyReserved8() {};
64 EXPORT_C void DummyReserved9() {};
65 EXPORT_C void DummyReserved10() {};
66 EXPORT_C void DummyReserved11() {};