| 
sl@0
 | 
     1  | 
// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
  | 
| 
sl@0
 | 
     2  | 
// All rights reserved.
  | 
| 
sl@0
 | 
     3  | 
// This component and the accompanying materials are made available
  | 
| 
sl@0
 | 
     4  | 
// under the terms of "Eclipse Public License v1.0"
  | 
| 
sl@0
 | 
     5  | 
// which accompanies this distribution, and is available
  | 
| 
sl@0
 | 
     6  | 
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
  | 
| 
sl@0
 | 
     7  | 
//
  | 
| 
sl@0
 | 
     8  | 
// Initial Contributors:
  | 
| 
sl@0
 | 
     9  | 
// Nokia Corporation - initial contribution.
  | 
| 
sl@0
 | 
    10  | 
//
  | 
| 
sl@0
 | 
    11  | 
// Contributors:
  | 
| 
sl@0
 | 
    12  | 
//
  | 
| 
sl@0
 | 
    13  | 
// Description:
  | 
| 
sl@0
 | 
    14  | 
//
  | 
| 
sl@0
 | 
    15  | 
  | 
| 
sl@0
 | 
    16  | 
// Class TStreamMark
  | 
| 
sl@0
 | 
    17  | 
inline TStreamMark::TStreamMark()
  | 
| 
sl@0
 | 
    18  | 
	: iPos(KStreamBeginning-1)
  | 
| 
sl@0
 | 
    19  | 
/** Constructs a default shared stream mark object.
  | 
| 
sl@0
 | 
    20  | 
  | 
| 
sl@0
 | 
    21  | 
The position for the mark is uninitialised.
  | 
| 
sl@0
 | 
    22  | 
  | 
| 
sl@0
 | 
    23  | 
An uninitialised mark means that a call to IsEmpty() returns true.
  | 
| 
sl@0
 | 
    24  | 
  | 
| 
sl@0
 | 
    25  | 
@see IsEmpty() */
  | 
| 
sl@0
 | 
    26  | 
	{}
 | 
| 
sl@0
 | 
    27  | 
inline TStreamMark::TStreamMark(TStreamPos aPos)
  | 
| 
sl@0
 | 
    28  | 
	: iPos(aPos)
  | 
| 
sl@0
 | 
    29  | 
/** Constructs the shared stream mark object, setting the mark to the specified 
  | 
| 
sl@0
 | 
    30  | 
stream position.
  | 
| 
sl@0
 | 
    31  | 
  | 
| 
sl@0
 | 
    32  | 
An initialised mark means that a call to IsEmpty() returns false.
  | 
| 
sl@0
 | 
    33  | 
  | 
| 
sl@0
 | 
    34  | 
@param aPos The stream position
  | 
| 
sl@0
 | 
    35  | 
@see IsEmpty() */
  | 
| 
sl@0
 | 
    36  | 
	{
 | 
| 
sl@0
 | 
    37  | 
#if defined (_DEBUG)
  | 
| 
sl@0
 | 
    38  | 
	__DbgChkPos(aPos);
  | 
| 
sl@0
 | 
    39  | 
#endif
  | 
| 
sl@0
 | 
    40  | 
	}
  | 
| 
sl@0
 | 
    41  | 
inline TStreamMark& TStreamMark::operator=(TStreamPos aPos)
  | 
| 
sl@0
 | 
    42  | 
/** Assigns the specified stream position value to this shared stream mark object.
  | 
| 
sl@0
 | 
    43  | 
  | 
| 
sl@0
 | 
    44  | 
@param aPos The stream position value to be assigned.
  | 
| 
sl@0
 | 
    45  | 
@return A reference to this shared stream mark object. */
  | 
| 
sl@0
 | 
    46  | 
	{
 | 
| 
sl@0
 | 
    47  | 
#if defined (_DEBUG)
  | 
| 
sl@0
 | 
    48  | 
	__DbgChkPos(aPos);
  | 
| 
sl@0
 | 
    49  | 
#endif
  | 
| 
sl@0
 | 
    50  | 
	iPos=aPos;
  | 
| 
sl@0
 | 
    51  | 
	return *this;
  | 
| 
sl@0
 | 
    52  | 
	}
  | 
| 
sl@0
 | 
    53  | 
inline TStreamMark::operator TStreamMark*()
  | 
| 
sl@0
 | 
    54  | 
	{return this;}
 | 
| 
sl@0
 | 
    55  | 
inline TStreamMark::operator const TStreamMark*() const
  | 
| 
sl@0
 | 
    56  | 
	{return this;}
 | 
| 
sl@0
 | 
    57  | 
inline TBool TStreamMark::operator==(const TStreamMark& aMark) const
  | 
| 
sl@0
 | 
    58  | 
/** Tests whether this object and the specified referenced shared stream mark object 
  | 
| 
sl@0
 | 
    59  | 
are the same object.
  | 
| 
sl@0
 | 
    60  | 
  | 
| 
sl@0
 | 
    61  | 
@param aMark A reference to a shared stream mark object.
  | 
| 
sl@0
 | 
    62  | 
@return True, if the two objects are the same object; false, otherwise. */
  | 
| 
sl@0
 | 
    63  | 
	{return this==&aMark;}
 | 
| 
sl@0
 | 
    64  | 
inline TBool TStreamMark::operator==(const TStreamMark* aPtr) const
  | 
| 
sl@0
 | 
    65  | 
	{return this==aPtr;}
 | 
| 
sl@0
 | 
    66  | 
inline TBool TStreamMark::operator!=(const TStreamMark& aMark) const
  | 
| 
sl@0
 | 
    67  | 
/** Tests whether this object and the specified shared stream mark object are different 
  | 
| 
sl@0
 | 
    68  | 
objects.
  | 
| 
sl@0
 | 
    69  | 
  | 
| 
sl@0
 | 
    70  | 
@param aMark A pointer to a shared stream mark object.
  | 
| 
sl@0
 | 
    71  | 
@return True, if the two objects are different objects; false, otherwise. */
  | 
| 
sl@0
 | 
    72  | 
	{return this!=&aMark;}
 | 
| 
sl@0
 | 
    73  | 
inline TBool TStreamMark::operator!=(const TStreamMark* aPtr) const
  | 
| 
sl@0
 | 
    74  | 
	{return this!=aPtr;}
 | 
| 
sl@0
 | 
    75  | 
inline TBool TStreamMark::IsEmpty() const
  | 
| 
sl@0
 | 
    76  | 
/** Tests whether this mark object is uninitialised.
  | 
| 
sl@0
 | 
    77  | 
  | 
| 
sl@0
 | 
    78  | 
@return True, if this mark object is uninitialised; false, otherwise. */
  | 
| 
sl@0
 | 
    79  | 
	{return iPos<KStreamBeginning;}
 | 
| 
sl@0
 | 
    80  | 
inline void TStreamMark::Clear()
  | 
| 
sl@0
 | 
    81  | 
/** Resets the mark object to its default state.
  | 
| 
sl@0
 | 
    82  | 
  | 
| 
sl@0
 | 
    83  | 
On return from this function, the mark is uninitialised and a call to IsEmpty() 
  | 
| 
sl@0
 | 
    84  | 
returns true.
  | 
| 
sl@0
 | 
    85  | 
  | 
| 
sl@0
 | 
    86  | 
Empties the object/makes it empty so that IsEmpty() returns false */
  | 
| 
sl@0
 | 
    87  | 
	{iPos=KStreamBeginning-1;}
 | 
| 
sl@0
 | 
    88  | 
inline TStreamPos TStreamMark::Position() const
  | 
| 
sl@0
 | 
    89  | 
/** Gets the position of the mark.
  | 
| 
sl@0
 | 
    90  | 
  | 
| 
sl@0
 | 
    91  | 
@return The stream position. */
  | 
| 
sl@0
 | 
    92  | 
	{
 | 
| 
sl@0
 | 
    93  | 
#if defined (_DEBUG)
  | 
| 
sl@0
 | 
    94  | 
	__DbgChkPos(iPos);
  | 
| 
sl@0
 | 
    95  | 
#endif
  | 
| 
sl@0
 | 
    96  | 
	return iPos;
  | 
| 
sl@0
 | 
    97  | 
	}
  | 
| 
sl@0
 | 
    98  | 
inline TBool TStreamMark::IsWith(TStreamExchange& aHost) const
  | 
| 
sl@0
 | 
    99  | 
/** Tests whether the specified shared streaming manager currently refers to this 
  | 
| 
sl@0
 | 
   100  | 
mark object.
  | 
| 
sl@0
 | 
   101  | 
  | 
| 
sl@0
 | 
   102  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   103  | 
@return True, if the shared stream manager refers to this mark; false, otherwise. */
  | 
| 
sl@0
 | 
   104  | 
	{return aHost.RefersTo(*this);}
 | 
| 
sl@0
 | 
   105  | 
inline TBool TStreamMark::RelatesTo(TStreamExchange& aHost) const
  | 
| 
sl@0
 | 
   106  | 
/** Tests whether the specified shared streaming manager currently refers to this 
  | 
| 
sl@0
 | 
   107  | 
mark object OR whether this mark object is initialised.
  | 
| 
sl@0
 | 
   108  | 
  | 
| 
sl@0
 | 
   109  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   110  | 
@return True, if the shared stream manager refers to this mark OR if this mark 
  | 
| 
sl@0
 | 
   111  | 
object is initialised; false, otherwise.
  | 
| 
sl@0
 | 
   112  | 
@see IsWith()
  | 
| 
sl@0
 | 
   113  | 
@see TStreamExchange::IsActive() */
  | 
| 
sl@0
 | 
   114  | 
	{return iPos>=KStreamBeginning||aHost.RefersTo(*this);}
 | 
| 
sl@0
 | 
   115  | 
inline void TStreamMark::Withdraw(TStreamExchange& aHost)
  | 
| 
sl@0
 | 
   116  | 
/** Instructs the shared streaming manager to remove any reference it has to this 
  | 
| 
sl@0
 | 
   117  | 
mark object.
  | 
| 
sl@0
 | 
   118  | 
  | 
| 
sl@0
 | 
   119  | 
@param aHost The object that manages shared streaming. */
  | 
| 
sl@0
 | 
   120  | 
	{aHost.Drop(*this);}
 | 
| 
sl@0
 | 
   121  | 
inline void TStreamMark::ExtractL(TStreamExchange& aHost)
  | 
| 
sl@0
 | 
   122  | 
/** Refreshes this mark from the mark in the host stream buffer and tells the shared 
  | 
| 
sl@0
 | 
   123  | 
streaming manager to drop any reference it has to to this mark object.
  | 
| 
sl@0
 | 
   124  | 
  | 
| 
sl@0
 | 
   125  | 
@param aHost The object that manages shared streaming. */
  | 
| 
sl@0
 | 
   126  | 
	{aHost.GetL(*this);}
 | 
| 
sl@0
 | 
   127  | 
inline TInt TStreamMark::ReadL(TStreamExchange& aHost,TAny* aPtr,TInt aMaxLength)
  | 
| 
sl@0
 | 
   128  | 
/** Reads data from the shared stream into the specified memory location.
  | 
| 
sl@0
 | 
   129  | 
  | 
| 
sl@0
 | 
   130  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   131  | 
@param aPtr A pointer to the target memory location for the data read from 
  | 
| 
sl@0
 | 
   132  | 
the shared stream.
  | 
| 
sl@0
 | 
   133  | 
@param aMaxLength The maximum number of bytes to be read.
  | 
| 
sl@0
 | 
   134  | 
@return The number of bytes read. */
  | 
| 
sl@0
 | 
   135  | 
	{return aHost.DoReadL(aPtr,aMaxLength,*this);}
 | 
| 
sl@0
 | 
   136  | 
inline TInt TStreamMark::ReadL(TStreamExchange& aHost,TDes8& aDes,TInt aMaxLength,TRequestStatus& aStatus)
  | 
| 
sl@0
 | 
   137  | 
/** Reads data, asynchronously, from the shared stream into the specified descriptor.
  | 
| 
sl@0
 | 
   138  | 
  | 
| 
sl@0
 | 
   139  | 
If the function leaves, then no read request will have been initiated.
  | 
| 
sl@0
 | 
   140  | 
  | 
| 
sl@0
 | 
   141  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   142  | 
@param aDes The target descriptor for the data read from the shared stream.
  | 
| 
sl@0
 | 
   143  | 
@param aMaxLength The maximum number of bytes to be read.
  | 
| 
sl@0
 | 
   144  | 
@param aStatus The request status that indicates the completion status of this 
  | 
| 
sl@0
 | 
   145  | 
asynchronous request.
  | 
| 
sl@0
 | 
   146  | 
@return The maximum number of bytes to be read, as used in this request. This 
  | 
| 
sl@0
 | 
   147  | 
can be different to the value supplied in aMaxLength; this is dependent on 
  | 
| 
sl@0
 | 
   148  | 
the implementation of the underlying stream. */
  | 
| 
sl@0
 | 
   149  | 
	{return aHost.DoReadL(aDes,aMaxLength,aStatus,*this);}
 | 
| 
sl@0
 | 
   150  | 
inline TStreamTransfer TStreamMark::ReadL(TStreamExchange& aHost,MStreamInput& anInput,TStreamTransfer aTransfer)
  | 
| 
sl@0
 | 
   151  | 
/** Reads data from the shared stream into the specified data sink.
  | 
| 
sl@0
 | 
   152  | 
  | 
| 
sl@0
 | 
   153  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   154  | 
@param anInput The sink which is the target for the read operation.
  | 
| 
sl@0
 | 
   155  | 
@param aTransfer Defines the amount of data available to be read from the shared 
  | 
| 
sl@0
 | 
   156  | 
stream.
  | 
| 
sl@0
 | 
   157  | 
@return The amount of data that was not consumed. */
  | 
| 
sl@0
 | 
   158  | 
	{return aHost.DoReadL(anInput,aTransfer,*this);}
 | 
| 
sl@0
 | 
   159  | 
inline TInt TStreamMark::ReadL(TStreamExchange& aHost,MStreamInput& anInput,TInt aMaxLength)
  | 
| 
sl@0
 | 
   160  | 
/** Reads data from the shared stream into the specified data sink.
  | 
| 
sl@0
 | 
   161  | 
  | 
| 
sl@0
 | 
   162  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   163  | 
@param anInput The sink which is the target for the read operation.
  | 
| 
sl@0
 | 
   164  | 
@param aMaxLength The maximum amount of data available to be read from the 
  | 
| 
sl@0
 | 
   165  | 
shared stream.
  | 
| 
sl@0
 | 
   166  | 
@return The amount of data that was not consumed. */
  | 
| 
sl@0
 | 
   167  | 
	{return aMaxLength-aHost.DoReadL(anInput,TStreamTransfer(aMaxLength),*this).Left();}
 | 
| 
sl@0
 | 
   168  | 
inline void TStreamMark::ReadL(TStreamExchange& aHost,MStreamInput& anInput)
  | 
| 
sl@0
 | 
   169  | 
/** Reads data from the shared stream into the specified data sink.
  | 
| 
sl@0
 | 
   170  | 
  | 
| 
sl@0
 | 
   171  | 
No explicit limit is placed on the amount of data that can be read.
  | 
| 
sl@0
 | 
   172  | 
  | 
| 
sl@0
 | 
   173  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   174  | 
@param anInput The sink which is the target for the read operation. */
  | 
| 
sl@0
 | 
   175  | 
	{aHost.DoReadL(anInput,KStreamUnlimited,*this);}
 | 
| 
sl@0
 | 
   176  | 
inline void TStreamMark::WriteL(TStreamExchange& aHost,const TAny* aPtr,TInt aLength)
  | 
| 
sl@0
 | 
   177  | 
/** Writes data from the specified memory location into the shared stream.
  | 
| 
sl@0
 | 
   178  | 
  | 
| 
sl@0
 | 
   179  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   180  | 
@param aPtr A pointer to the memory location from which data is to be written 
  | 
| 
sl@0
 | 
   181  | 
to the shared stream.
  | 
| 
sl@0
 | 
   182  | 
@param aLength The number of bytes to be written. */
  | 
| 
sl@0
 | 
   183  | 
	{aHost.DoWriteL(aPtr,aLength,*this);}
 | 
| 
sl@0
 | 
   184  | 
inline TInt TStreamMark::WriteL(TStreamExchange& aHost,const TDesC8& aDes,TInt aMaxLength,TRequestStatus& aStatus)
  | 
| 
sl@0
 | 
   185  | 
/** Writes data, asynchronously, from the specified descriptor into the shared 
  | 
| 
sl@0
 | 
   186  | 
stream.
  | 
| 
sl@0
 | 
   187  | 
  | 
| 
sl@0
 | 
   188  | 
If the function leaves, then no write request will have been initiated.
  | 
| 
sl@0
 | 
   189  | 
  | 
| 
sl@0
 | 
   190  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   191  | 
@param aDes The source descriptor for the data to be written into the shared 
  | 
| 
sl@0
 | 
   192  | 
stream.
  | 
| 
sl@0
 | 
   193  | 
@param aMaxLength The maximum number of bytes to be written.
  | 
| 
sl@0
 | 
   194  | 
@param aStatus The request status that indicates the completion status of this 
  | 
| 
sl@0
 | 
   195  | 
asynchronous request.
  | 
| 
sl@0
 | 
   196  | 
@return The maximum number of bytes to be written, as used in this request. 
  | 
| 
sl@0
 | 
   197  | 
This can be different to the value supplied in aMaxLength; this is dependent 
  | 
| 
sl@0
 | 
   198  | 
on the implementation. */
  | 
| 
sl@0
 | 
   199  | 
	{return aHost.DoWriteL(aDes,aMaxLength,aStatus,*this);}
 | 
| 
sl@0
 | 
   200  | 
inline TStreamTransfer TStreamMark::WriteL(TStreamExchange& aHost,MStreamOutput& anOutput,TStreamTransfer aTransfer)
  | 
| 
sl@0
 | 
   201  | 
/** Writes data into the shared stream from the specified data source.
  | 
| 
sl@0
 | 
   202  | 
  | 
| 
sl@0
 | 
   203  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   204  | 
@param anOutput The data source for the write operation.
  | 
| 
sl@0
 | 
   205  | 
@param aTransfer Defines the amount of data to be pulled from the output stream 
  | 
| 
sl@0
 | 
   206  | 
object.
  | 
| 
sl@0
 | 
   207  | 
@return A stream transfer object defining the amount of data that was not consumed. */
  | 
| 
sl@0
 | 
   208  | 
	{return aHost.DoWriteL(anOutput,aTransfer,*this);}
 | 
| 
sl@0
 | 
   209  | 
inline TInt TStreamMark::WriteL(TStreamExchange& aHost,MStreamOutput& anOutput,TInt aMaxLength)
  | 
| 
sl@0
 | 
   210  | 
/** Writes data into the shared stream from the specified data source
  | 
| 
sl@0
 | 
   211  | 
  | 
| 
sl@0
 | 
   212  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   213  | 
@param anOutput The data source for the write operation.
  | 
| 
sl@0
 | 
   214  | 
@param aMaxLength The maximum amount of data available to be written.
  | 
| 
sl@0
 | 
   215  | 
@return The amount of data that was not consumed. */
  | 
| 
sl@0
 | 
   216  | 
	{return aMaxLength-aHost.DoWriteL(anOutput,TStreamTransfer(aMaxLength),*this).Left();}
 | 
| 
sl@0
 | 
   217  | 
inline void TStreamMark::WriteL(TStreamExchange& aHost,MStreamOutput& anOutput)
  | 
| 
sl@0
 | 
   218  | 
/** Writes data into the shared stream from the specified data source.
  | 
| 
sl@0
 | 
   219  | 
  | 
| 
sl@0
 | 
   220  | 
No explicit limit is placed on the amount of data that can be written.
  | 
| 
sl@0
 | 
   221  | 
  | 
| 
sl@0
 | 
   222  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   223  | 
@param anOutput The data source for the write operation. */
  | 
| 
sl@0
 | 
   224  | 
	{aHost.DoWriteL(anOutput,KStreamUnlimited,*this);}
 | 
| 
sl@0
 | 
   225  | 
inline void TStreamMark::SeekL(TStreamExchange& aHost,TStreamPos aPos)
  | 
| 
sl@0
 | 
   226  | 
	{aHost.DoSeekL(*this,EStreamBeginning,aPos.Offset());}
 | 
| 
sl@0
 | 
   227  | 
inline TStreamPos TStreamMark::SeekL(TStreamExchange& aHost,TStreamLocation aLocation,TInt anOffset)
  | 
| 
sl@0
 | 
   228  | 
/** Moves the position of the mark in the host stream.
  | 
| 
sl@0
 | 
   229  | 
  | 
| 
sl@0
 | 
   230  | 
The new position is calculated by adding the specified offset to one of:
  | 
| 
sl@0
 | 
   231  | 
  | 
| 
sl@0
 | 
   232  | 
the position of the beginning of the host stream
  | 
| 
sl@0
 | 
   233  | 
  | 
| 
sl@0
 | 
   234  | 
the position of the end of the host stream
  | 
| 
sl@0
 | 
   235  | 
  | 
| 
sl@0
 | 
   236  | 
the position of the current mark.
  | 
| 
sl@0
 | 
   237  | 
  | 
| 
sl@0
 | 
   238  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   239  | 
@param aLocation The location in the host stream on which the calculation of 
  | 
| 
sl@0
 | 
   240  | 
the new position is based.
  | 
| 
sl@0
 | 
   241  | 
@param anOffset The offset value.
  | 
| 
sl@0
 | 
   242  | 
@return The new position of the mark. */
  | 
| 
sl@0
 | 
   243  | 
	{return aHost.DoSeekL(*this,aLocation,anOffset);}
 | 
| 
sl@0
 | 
   244  | 
inline TStreamPos TStreamMark::SeekL(TStreamExchange& aHost,TInt anOffset)
  | 
| 
sl@0
 | 
   245  | 
/** Moves the position of the mark in the host stream.
  | 
| 
sl@0
 | 
   246  | 
  | 
| 
sl@0
 | 
   247  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   248  | 
@param anOffset The amount by which the position of the mark is to be moved 
  | 
| 
sl@0
 | 
   249  | 
relative to the existing position of the mark.
  | 
| 
sl@0
 | 
   250  | 
@return The new position of the mark. */
  | 
| 
sl@0
 | 
   251  | 
	{return aHost.DoSeekL(*this,EStreamMark,anOffset);}
 | 
| 
sl@0
 | 
   252  | 
inline TStreamPos TStreamMark::TellL(TStreamExchange& aHost) const
  | 
| 
sl@0
 | 
   253  | 
/** Gets the position of the mark within the host stream.
  | 
| 
sl@0
 | 
   254  | 
  | 
| 
sl@0
 | 
   255  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   256  | 
@return The stream position. */
  | 
| 
sl@0
 | 
   257  | 
	{return aHost.DoSeekL(CONST_CAST(TStreamMark&,*this),EStreamMark,0);}
 | 
| 
sl@0
 | 
   258  | 
  | 
| 
sl@0
 | 
   259  | 
// Class TStreamExchange
  | 
| 
sl@0
 | 
   260  | 
inline TStreamExchange::TStreamExchange()
  | 
| 
sl@0
 | 
   261  | 
	: iHost(NULL),iRMrk(NULL),iWMrk(NULL)
  | 
| 
sl@0
 | 
   262  | 
/** Constructs an empty object.
  | 
| 
sl@0
 | 
   263  | 
  | 
| 
sl@0
 | 
   264  | 
Call Share() to prepare for access to a shared stream buffer. */
  | 
| 
sl@0
 | 
   265  | 
	{}
 | 
| 
sl@0
 | 
   266  | 
inline TStreamExchange::TStreamExchange(MStreamBuf* aHost)
  | 
| 
sl@0
 | 
   267  | 
	: iHost(aHost),iRMrk(NULL),iWMrk(NULL)
  | 
| 
sl@0
 | 
   268  | 
/** Constructs the object, specifying the stream buffer that will act as the shared 
  | 
| 
sl@0
 | 
   269  | 
host.
  | 
| 
sl@0
 | 
   270  | 
  | 
| 
sl@0
 | 
   271  | 
@param aHost A pointer to a stream buffer that will act as the shared host. */
  | 
| 
sl@0
 | 
   272  | 
	{}
 | 
| 
sl@0
 | 
   273  | 
inline void TStreamExchange::Share(MStreamBuf* aHost)
  | 
| 
sl@0
 | 
   274  | 
/** Tells the object to use the specified stream buffer that will act as the shared 
  | 
| 
sl@0
 | 
   275  | 
host.
  | 
| 
sl@0
 | 
   276  | 
  | 
| 
sl@0
 | 
   277  | 
@param aHost A pointer to a stream buffer that will act as the shared host. */
  | 
| 
sl@0
 | 
   278  | 
	{iHost=aHost;}
 | 
| 
sl@0
 | 
   279  | 
inline TBool TStreamExchange::IsActive() const
  | 
| 
sl@0
 | 
   280  | 
/** Tests whether this object is using a stream buffer that is acting as shared 
  | 
| 
sl@0
 | 
   281  | 
host.
  | 
| 
sl@0
 | 
   282  | 
  | 
| 
sl@0
 | 
   283  | 
@return True, if this object is using a shared host ; false, otherwise. */
  | 
| 
sl@0
 | 
   284  | 
	{return iHost!=NULL;}
 | 
| 
sl@0
 | 
   285  | 
	
  | 
| 
sl@0
 | 
   286  | 
// Class RShareBuf
  | 
| 
sl@0
 | 
   287  | 
inline void RShareBuf::Open(TStreamExchange& aHost,TInt aMode)
  | 
| 
sl@0
 | 
   288  | 
/** Prepares the shared stream buffer for streaming.
  | 
| 
sl@0
 | 
   289  | 
  | 
| 
sl@0
 | 
   290  | 
The function sets the read mark and/or the write mark to the beginning of 
  | 
| 
sl@0
 | 
   291  | 
the host stream.
  | 
| 
sl@0
 | 
   292  | 
  | 
| 
sl@0
 | 
   293  | 
@param aHost The object that manages shared streaming.
  | 
| 
sl@0
 | 
   294  | 
@param aMode The streaming mode. This can be read and/or write, as indicated 
  | 
| 
sl@0
 | 
   295  | 
by the ERead and EWrite bits.
  | 
| 
sl@0
 | 
   296  | 
@see MStreamBuf::TRead
  | 
| 
sl@0
 | 
   297  | 
@see MStreamBuf::TWrite
  | 
| 
sl@0
 | 
   298  | 
@see KStreamBeginning */
  | 
| 
sl@0
 | 
   299  | 
	{Open(aHost,KStreamBeginning,aMode);}
 | 
| 
sl@0
 | 
   300  | 
  | 
| 
sl@0
 | 
   301  | 
// Class RShareWriteStream
  | 
| 
sl@0
 | 
   302  | 
inline RShareWriteStream::RShareWriteStream(const MExternalizer<TStreamRef>& anExter)
  | 
| 
sl@0
 | 
   303  | 
	: RWriteStream(anExter)
  | 
| 
sl@0
 | 
   304  | 
	{}
 | 
| 
sl@0
 | 
   305  | 
  |