sl@0: // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: // sl@0: // -------------- Stream implementation ------------------------ sl@0: // sl@0: EXPORT_C void CStreamBase2::CompleteRead(const RMessage2 &aMessage) sl@0: { sl@0: // retrieve the max length of the buffer the client has allocated sl@0: TInt length = aMessage.Int1(); sl@0: // create a local buffer for placing characters to be written to sl@0: // client. This is a copy of the the iBuf internal buffer of the stream sl@0: TBuf8<256> buf(iBuf); sl@0: sl@0: if (length < buf.Length() ) sl@0: { sl@0: // then we can't copy all the buffer to the client so we have reduce sl@0: // the buffers length sl@0: buf.SetLength(length); sl@0: // delete appropriate part of stream's internal buffer sl@0: iBuf.Delete(0,length); sl@0: } sl@0: else sl@0: { sl@0: // we can copy all of the buffer to the client so we set the streams sl@0: // descriptor to zero length sl@0: iBuf.Zero(); sl@0: } sl@0: // copy the local descriptor to the client. sl@0: TRAPD(ret,aMessage.WriteL(0, buf)); sl@0: // inform the client of success/failure by completing the message sl@0: aMessage.Complete(ret); sl@0: return; sl@0: } sl@0: sl@0: EXPORT_C void CStreamFactoryBase2::AppendToStatus(const TDesC& aMsg) { iStatusMsg.Append(aMsg); } sl@0: sl@0: EXPORT_C const TDesC& CStreamFactoryBase2::GetStatus() const { return iStatusMsg; } sl@0: sl@0: // Dummy functions to replace previous exports so def file does not need reordering. sl@0: EXPORT_C void DummyReserved1() {}; sl@0: EXPORT_C void DummyReserved2() {}; sl@0: EXPORT_C void DummyReserved3() {}; sl@0: EXPORT_C void DummyReserved4() {}; sl@0: EXPORT_C void DummyReserved5() {}; sl@0: EXPORT_C void DummyReserved6() {}; sl@0: EXPORT_C void DummyReserved7() {}; sl@0: EXPORT_C void DummyReserved8() {}; sl@0: EXPORT_C void DummyReserved9() {}; sl@0: EXPORT_C void DummyReserved10() {}; sl@0: EXPORT_C void DummyReserved11() {};