1.1 --- a/epoc32/include/s32buf.inl Tue Nov 24 13:55:44 2009 +0000
1.2 +++ b/epoc32/include/s32buf.inl Tue Mar 16 16:12:26 2010 +0000
1.3 @@ -1,1 +1,600 @@
1.4 -s32buf.inl
1.5 +// Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +// All rights reserved.
1.7 +// This component and the accompanying materials are made available
1.8 +// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +// which accompanies this distribution, and is available
1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +//
1.12 +// Initial Contributors:
1.13 +// Nokia Corporation - initial contribution.
1.14 +//
1.15 +// Contributors:
1.16 +//
1.17 +// Description:
1.18 +//
1.19 +
1.20 +// Class TStreamPos
1.21 +inline TStreamPos::TStreamPos(TInt anOffset)
1.22 + : iOff(anOffset)
1.23 +/** Constructs the stream position object from the specified value.
1.24 +
1.25 +@param anOffset The position value. */
1.26 + {}
1.27 +inline TBool TStreamPos::operator==(TStreamPos aPos) const
1.28 +/** Tests whether the stream position is equal to the specified stream position.
1.29 +
1.30 +@param aPos The stream position to be compared.
1.31 +@return True, if this object's stream position value is equal to the specified
1.32 +stream position's value; false, otherwise. */
1.33 + {return iOff==aPos.iOff;}
1.34 +inline TBool TStreamPos::operator!=(TStreamPos aPos) const
1.35 +/** Tests whether the stream position is not equal to the specified stream position.
1.36 +
1.37 +@param aPos The stream position to be compared.
1.38 +@return True, if this object's stream position value is not equal to the specified
1.39 +stream position's value; false, otherwise. */
1.40 + {return iOff!=aPos.iOff;}
1.41 +inline TBool TStreamPos::operator<(TStreamPos aPos) const
1.42 +/** Tests whether the stream position is less than the specified stream position.
1.43 +
1.44 +@param aPos The stream position to be compared.
1.45 +@return True, if this object's stream position value is less than the specified
1.46 +stream position's value; false, otherwise. */
1.47 + {return iOff<aPos.iOff;}
1.48 +inline TBool TStreamPos::operator<=(TStreamPos aPos) const
1.49 +/** Tests whether the stream position is less than or equal to the specified stream
1.50 +position.
1.51 +
1.52 +@param aPos The stream position to be compared.
1.53 +@return True, if this object's stream position value is less than or equal
1.54 +to the specified stream position's value; false, otherwise. */
1.55 + {return iOff<=aPos.iOff;}
1.56 +inline TBool TStreamPos::operator>(TStreamPos aPos) const
1.57 +/** Tests whether the stream position is greater than the specified stream position.
1.58 +
1.59 +@param aPos The stream position to be compared.
1.60 +@return True, if this object's stream position value is greater than the specified
1.61 +stream position's value; false, otherwise. */
1.62 + {return iOff>aPos.iOff;}
1.63 +inline TBool TStreamPos::operator>=(TStreamPos aPos) const
1.64 +/** Tests whether the stream position is greater than or equal to the specified
1.65 +stream position.
1.66 +
1.67 +@param aPos The stream position to be compared.
1.68 +@return True, if this object's stream position value is greater than or equal
1.69 +to the specified stream position's value; false, otherwise. */
1.70 + {return iOff>=aPos.iOff;}
1.71 +inline TInt TStreamPos::operator-(TStreamPos aPos) const
1.72 +/** Gets the result of subtracting the specified stream position value from this
1.73 +object's stream position value.
1.74 +
1.75 +@param aPos The stream position whose value is to be subtracted.
1.76 +@return The result of the calculation. */
1.77 + {return iOff-aPos.iOff;}
1.78 +inline TStreamPos TStreamPos::operator+(TInt anOffset) const
1.79 +/** Gets a stream position object that holds the result of adding the specified
1.80 +value to this object's stream position value.
1.81 +
1.82 +@param anOffset The value to be added.
1.83 +@return The stream position object holding the result of the calculation. */
1.84 + {return TStreamPos(iOff+anOffset);}
1.85 +inline TStreamPos TStreamPos::operator-(TInt anOffset) const
1.86 +/** Gets a stream position object that holds the result of subtracting the specified
1.87 +value from this object's stream position value.
1.88 +
1.89 +@param anOffset The value to be subtracted.
1.90 +@return The stream position object holding the result of the calculation. */
1.91 + {return TStreamPos(iOff-anOffset);}
1.92 +inline TStreamPos& TStreamPos::operator+=(TInt anOffset)
1.93 +/** Adds the specified value to this stream position object.
1.94 +
1.95 +@param anOffset The value to be added.
1.96 +@return A reference to this stream position object. */
1.97 + {iOff+=anOffset;return *this;}
1.98 +inline TStreamPos& TStreamPos::operator-=(TInt anOffset)
1.99 +/** Subtracts the specified value from this stream position object.
1.100 +
1.101 +@param anOffset The value to be subtracted.
1.102 +@return A reference to this stream position object. */
1.103 + {iOff-=anOffset;return *this;}
1.104 +inline TInt TStreamPos::Offset() const
1.105 +/** Gets the stream position value.
1.106 +
1.107 +@return The stream position value. */
1.108 + {return iOff;}
1.109 +inline TStreamPos operator+(TInt anOffset,TStreamPos aPos)
1.110 + {return aPos+anOffset;}
1.111 +
1.112 +// Class TStreamTransfer
1.113 +inline TStreamTransfer::TStreamTransfer(TInt aMaxLength)
1.114 + : iVal(aMaxLength)
1.115 +/** Constructs a stream transfer object specifying a length value.
1.116 +
1.117 +This value represents the maximum amount of data that can be transferred between
1.118 +streams.
1.119 +
1.120 +@param aMaxLength The maximum length of data that can be transferred. In debug
1.121 +mode, the function raises a STORE-Stream 13 panic, if this value is negative. */
1.122 + {
1.123 +#if defined (_DEBUG)
1.124 + __DbgChkNonNegative(aMaxLength);
1.125 +#endif
1.126 + }
1.127 +inline TStreamTransfer::TStreamTransfer(TUnlimited)
1.128 + : iVal(-1)
1.129 +/** Constructs a stream transfer object specifying that there is no explicit limit
1.130 +to the amount of data that can be transferred between streams.
1.131 +
1.132 +The amount of data to be transferred is only limited by the streams themselves.
1.133 +
1.134 +The arithmetical operators do not change the state of an unlimited stream
1.135 +transfer object.
1.136 +
1.137 +@param (The enumerator value is not used). */
1.138 + {}
1.139 +inline TBool TStreamTransfer::operator==(TInt aLength) const
1.140 +/** Tests whether the stream transfer value is equal to the specified value.
1.141 +
1.142 +@param aLength The length to compared. In debug mode, the function raises
1.143 +a STORE-Stream 13 panic, if this value is negative.
1.144 +@return True, if the stream transfer value is equal to the specified value;
1.145 +false, otherwise. */
1.146 + {
1.147 +#if defined (_DEBUG)
1.148 + __DbgChkNonNegative(aLength);
1.149 +#endif
1.150 + return iVal==aLength;
1.151 + }
1.152 +inline TBool TStreamTransfer::operator>(TInt aLength) const
1.153 +/** Tests whether the stream transfer value is greater than the specified value.
1.154 +
1.155 +@param aLength The length to compared. In debug mode, the function raises
1.156 +a STORE-Stream 13 panic, if this value is negative.
1.157 +@return True, if the stream transfer value is greater than the specified value;
1.158 +false, otherwise. */
1.159 + {
1.160 +#if defined (_DEBUG)
1.161 + __DbgChkNonNegative(aLength);
1.162 +#endif
1.163 + return TUint(iVal)>TUint(aLength);
1.164 + }
1.165 +inline TStreamTransfer TStreamTransfer::operator-(TInt aLength) const
1.166 +/** Subtracts the specified value from the stream transfer value.
1.167 +
1.168 +If this stream transfer object was originally constructed as an unlimited
1.169 +type, i.e. using the TStreamTransfer(TUnlimited) constructor, then this operator
1.170 +does not change the state of the object, and it remains an unlimited type.
1.171 +
1.172 +@param aLength The length to be subtracted. In debug mode, the function raises
1.173 +a STORE-Stream 13 panic, if this value is negative.
1.174 +@return A stream transfer object containing the result of the subtraction. */
1.175 + {
1.176 +#if defined (_DEBUG)
1.177 + __DbgChkNonNegative(aLength);
1.178 +#endif
1.179 + return iVal<0?*this:TStreamTransfer(iVal-aLength);
1.180 + }
1.181 +inline TInt TStreamTransfer::operator[](TInt aMaxLength) const
1.182 + {return *this>aMaxLength?aMaxLength:iVal;}
1.183 +inline TStreamTransfer& TStreamTransfer::operator-=(TInt aLength)
1.184 +/** Subtracts the specified value from the stream transfer value, updating this
1.185 +stream transfer object.
1.186 +
1.187 +If this stream transfer object was originally constructed as an unlimited
1.188 +type, i.e. using the TStreamTransfer(TUnlimited) constructor, then this operator
1.189 +does not change the state of the object, and it remains an unlimited type.
1.190 +
1.191 +If this stream transfer object was not an unlimited type, then, in debug mode,
1.192 +the function raises a STORE-Stream 13 panic, if the result of the calculation
1.193 +is negative.
1.194 +
1.195 +@param aLength The length to be subtracted. In debug mode, the function raises
1.196 +a STORE-Stream 13 panic, if this value is negative.
1.197 +@return A reference to this stream transfer object. */
1.198 + {
1.199 +#if defined (_DEBUG)
1.200 + __DbgChkNonNegative(aLength);
1.201 +#endif
1.202 + if (iVal>=0)
1.203 + {
1.204 + iVal-=aLength;
1.205 +#if defined (_DEBUG)
1.206 + __DbgChkNonNegative(iVal);
1.207 +#endif
1.208 + }
1.209 + return *this;
1.210 + }
1.211 +inline TInt TStreamTransfer::Left() const
1.212 +/** Gets the stream transfer value.
1.213 +
1.214 +@return The current stream transfer value. */
1.215 + {
1.216 +#if defined (_DEBUG)
1.217 + __DbgChkNonNegative(iVal);
1.218 +#endif
1.219 + return iVal;
1.220 + }
1.221 +inline TBool operator==(TInt aLength,TStreamTransfer aTransfer)
1.222 + {return aTransfer==aLength;}
1.223 +inline TBool operator<(TInt aLength,TStreamTransfer aTransfer)
1.224 + {return aTransfer>aLength;}
1.225 +
1.226 +// Class MStreamBuf
1.227 +inline void MStreamBuf::Release()
1.228 +/** Frees resources before abandoning the stream buffer.
1.229 +
1.230 +The function calls the virtual function DoRelease() to implement this behaviour.
1.231 +
1.232 +Release() is called by both RReadStream::Release() and RWriteStream::Release().
1.233 +
1.234 +@see MStreamBuf::DoRelease()
1.235 +@see RReadStream::Release()
1.236 +@see RWriteStream::Release() */
1.237 + {DoRelease();}
1.238 +inline void MStreamBuf::SynchL()
1.239 +/** Synchronises the stream buffer with the stream, leaving if any error occurs.
1.240 +
1.241 +In effect, this ensures that buffered data is delivered to the stream.
1.242 +
1.243 +The function calls the virtual function DoSynchL() to implement this behaviour.
1.244 +
1.245 +@see MStreamBuf::DoSynchL() */
1.246 + {DoSynchL();}
1.247 +inline TInt MStreamBuf::ReadL(TAny* aPtr,TInt aMaxLength)
1.248 +/** Reads data from the stream buffer into the specified memory location.
1.249 +
1.250 +The function calls the virtual function DoReadL(TAny*,TInt) to implement this
1.251 +behaviour.
1.252 +
1.253 +@param aPtr A pointer to the target memory location for the data read from
1.254 +the stream buffer.
1.255 +@param aMaxLength The maximum number of bytes to be read.
1.256 +@return The number of bytes read.
1.257 +@see MStreamBuf::DoReadL() */
1.258 + {return DoReadL(aPtr,aMaxLength);}
1.259 +inline TInt MStreamBuf::ReadL(TDes8& aDes,TInt aMaxLength,TRequestStatus& aStatus)
1.260 +/** Reads data, asynchronously, from the stream buffer into the specified descriptor.
1.261 +
1.262 +The function calls the virtual function DoReadL(TDes8&,TInt,TRequestStatus&)
1.263 +to implement this behaviour.
1.264 +
1.265 +If the function leaves, then no read request will have been initiated.
1.266 +
1.267 +@param aDes The target descriptor for the data read from the stream buffer.
1.268 +@param aMaxLength The maximum number of bytes to be read.
1.269 +@param aStatus The request status that indicates the completion status of this
1.270 +asynchronous request.
1.271 +@return The maximum number of bytes to be read, as used in this request. This
1.272 +can be different to the value supplied in aMaxLength; this is dependent on
1.273 +the implementation.
1.274 +@see MStreamBuf::DoReadL() */
1.275 + {return DoReadL(aDes,aMaxLength,aStatus);}
1.276 +inline TStreamTransfer MStreamBuf::ReadL(MStreamInput& anInput,TStreamTransfer aTransfer)
1.277 +/** Reads data from the stream buffer into the specified data sink.
1.278 +
1.279 +The function calls the virtual function DoReadL(MStreamInput&,TStreamTransfer)
1.280 +to implement this behaviour.
1.281 +
1.282 +@param anInput The data sink that is the target for the read operation.
1.283 +@param aTransfer Defines the amount of data available to be read.
1.284 +@return The amount of data that was not consumed. */
1.285 + {return DoReadL(anInput,aTransfer);}
1.286 +inline void MStreamBuf::ReadL(MStreamInput& anInput)
1.287 +/** Reads data from the stream buffer into the specified data sink.
1.288 +
1.289 +The function uses the virtual function DoReadL(MStreamInput&,TStreamTransfer)
1.290 +to implement this behaviour.
1.291 +
1.292 +No explicit limit is placed on the amount of data that can be read.
1.293 +
1.294 +@param anInput The data sink that is the target for the read operation. */
1.295 + {DoReadL(anInput,KStreamUnlimited);}
1.296 +inline void MStreamBuf::WriteL(const TAny* aPtr,TInt aLength)
1.297 +/** Writes data from the specified memory location into the stream buffer.
1.298 +
1.299 +The function calls the virtual function DoWriteL(TAny*,TInt) to implement
1.300 +this behaviour.
1.301 +
1.302 +@param aPtr A pointer to the memory location from which data is to be written
1.303 +to the stream buffer.
1.304 +@param aLength The number of bytes to be written.
1.305 +@see MStreamBuf::DoWriteL() */
1.306 + {DoWriteL(aPtr,aLength);}
1.307 +inline TInt MStreamBuf::WriteL(const TDesC8& aDes,TInt aMaxLength,TRequestStatus& aStatus)
1.308 +/** Writes data, asynchronously, from the specified descriptor into the stream buffer.
1.309 +
1.310 +The function calls the virtual function DoWriteL(const TDesC8&,TInt,TRequestStatus&)
1.311 +to implement this behaviour.
1.312 +
1.313 +If the function leaves, then no write request will have been initiated.
1.314 +
1.315 +@param aDes The source descriptor for the data to be written into the stream
1.316 +buffer.
1.317 +@param aMaxLength The maximum number of bytes to be written.
1.318 +@param aStatus The request status that indicates the completion status of this
1.319 +asynchronous request.
1.320 +@return The maximum number of bytes to be written, as used in this request.
1.321 +This can be different to the value supplied in aMaxLength; this is dependent
1.322 +on the implementation.
1.323 +@see MStreamBuf::DoWriteL() */
1.324 + {return DoWriteL(aDes,aMaxLength,aStatus);}
1.325 +inline TStreamTransfer MStreamBuf::WriteL(MStreamOutput& anOutput,TStreamTransfer aTransfer)
1.326 +/** Writes data into the stream buffer from the specified data source.
1.327 +
1.328 +The function calls the virtual function DoWriteL(MStreamOutput&,TStreamTransfer)
1.329 +to implement this behaviour.
1.330 +
1.331 +@param anOutput The data source for the write operation.
1.332 +@param aTransfer Defines the amount of data to be pulled from the output stream
1.333 +object.
1.334 +@return A stream transfer object defining the amount of data that was not consumed. */
1.335 + {return DoWriteL(anOutput,aTransfer);}
1.336 +inline void MStreamBuf::WriteL(MStreamOutput& anOutput)
1.337 +/**Writes data into the stream buffer from the specified data source.
1.338 +
1.339 +The function calls the virtual function DoWriteL(MStreamOutput&,TStreamTransfer) to implement this behaviour.
1.340 +
1.341 +No explicit limit is placed on the amount of data that can be written.
1.342 +
1.343 +@param anOutput The data source for the write operation.
1.344 +@param aMaxLength The maximum amount of data available to be written.
1.345 +*/
1.346 + {DoWriteL(anOutput,KStreamUnlimited);}
1.347 +inline void MStreamBuf::SeekL(TMark aMark,TStreamPos aPos)
1.348 +/**Moves the position of the read or write mark in the stream.
1.349 +
1.350 +The new position is calculated by adding the specified value to the position of the beginning of the stream.
1.351 +
1.352 +The function calls virtual function DoSeekL(TMark,TStreamLocation,TInt) to implement this behaviour.
1.353 +Notes:
1.354 +As there are two current positions, one for the read mark and one for the write mark, it is not valid, in general, to use a single call to SeekL() to move both the read and write marks.
1.355 +Not all streams are seekable.
1.356 +
1.357 +@param aMark The type of mark, i.e. read or write.
1.358 +@param aLocation A stream position value on which the calculation of the new position is based.
1.359 +*/
1.360 + {DoSeekL(aMark,EStreamBeginning,aPos.Offset());}
1.361 +inline TStreamPos MStreamBuf::SeekL(TMark aMark,TStreamLocation aLocation,TInt anOffset)
1.362 +/** Moves the position of the read mark or the write mark in the stream.
1.363 +
1.364 +The new position is calculated by adding the specified offset to one of:
1.365 +
1.366 +the position of the beginning of the stream
1.367 +
1.368 +the position of the end of the stream
1.369 +
1.370 +the position of the current read mark or write mark.
1.371 +
1.372 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.373 +to implement this behaviour.
1.374 +
1.375 +As there are two current positions, one for the read mark and one for the
1.376 +write mark, it is not valid, in general, to use a single call to SeekL() to
1.377 +move both the read and write marks.
1.378 +
1.379 +Not all streams are seekable.
1.380 +
1.381 +@param aMark The type of mark, i.e read or write.
1.382 +@param aLocation The location in the stream on which the calculation of the
1.383 +new position is based.
1.384 +@param anOffset The offset value.
1.385 +@return The new stream position of the read or write mark. */
1.386 + {return DoSeekL(aMark,aLocation,anOffset);}
1.387 +inline TStreamPos MStreamBuf::SeekL(TRead,TStreamLocation aLocation,TInt anOffset)
1.388 +/** Moves the position of the read mark in the stream.
1.389 +
1.390 +The new position is calculated by adding the specified offset to one of:
1.391 +
1.392 +the position of the beginning of the stream
1.393 +
1.394 +the position of the end of the stream
1.395 +
1.396 +the position of the current read mark.
1.397 +
1.398 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.399 +to implement this behaviour.
1.400 +
1.401 +Not all streams are seekable.
1.402 +
1.403 +@param (The enumerator value is not used)
1.404 +@param aLocation The location in the stream on which the calculation of the
1.405 +new position is based.
1.406 +@param anOffset The offset value.
1.407 +@return The new stream position of the read mark. */
1.408 + {return DoSeekL(ERead,aLocation,anOffset);}
1.409 +inline TStreamPos MStreamBuf::SeekL(TWrite,TStreamLocation aLocation,TInt anOffset)
1.410 +/** Moves the position of the write mark in the stream.
1.411 +
1.412 +The new position is calculated by adding the specified offset to one of:
1.413 +
1.414 +the position of the beginning of the stream
1.415 +
1.416 +the position of the end of the stream
1.417 +
1.418 +the position of the current write mark.
1.419 +
1.420 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.421 +to implement this behaviour.
1.422 +
1.423 +Not all streams are seekable.
1.424 +
1.425 +@param (The enumerator value is not used)
1.426 +@param aLocation The location in the stream on which the calculation of the
1.427 +new position is based.
1.428 +@param anOffset The offset value.
1.429 +@return The new stream position of the write mark. */
1.430 + {return DoSeekL(EWrite,aLocation,anOffset);}
1.431 +inline TStreamPos MStreamBuf::SeekL(TRead,TInt anOffset)
1.432 +/** Moves the position of the read mark in the stream by the specified offset.
1.433 +
1.434 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.435 +to implement this behaviour.
1.436 +
1.437 +Not all streams are seekable.
1.438 +
1.439 +@param (The enumerator value is not used)
1.440 +@param anOffset The amount by which the position of the read mark is to be
1.441 +moved relative to the existing position of the read mark.
1.442 +@return The new stream position of the read mark. */
1.443 + {return DoSeekL(ERead,EStreamMark,anOffset);}
1.444 +inline TStreamPos MStreamBuf::SeekL(TWrite,TInt anOffset)
1.445 +/** Moves the position of the write mark in the stream by the specified offset.
1.446 +
1.447 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.448 +to implement this behaviour.
1.449 +
1.450 +Not all streams are seekable.
1.451 +
1.452 +@param (The enumerator value is not used)
1.453 +@param anOffset The amount by which the position of the write mark is to be
1.454 +moved relative to the existing position of the write mark.
1.455 +@return The new stream position of the write mark. */
1.456 + {return DoSeekL(EWrite,EStreamMark,anOffset);}
1.457 +inline TStreamPos MStreamBuf::TellL(TRead) const
1.458 +/** Gets the position of the read mark within the stream.
1.459 +
1.460 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.461 +to implement this behaviour.
1.462 +
1.463 +@param (The enumerator value is not used).
1.464 +@return The stream position. */
1.465 + {return CONST_CAST(MStreamBuf*,this)->DoSeekL(ERead,EStreamMark,0);}
1.466 +inline TStreamPos MStreamBuf::TellL(TWrite) const
1.467 +/** Gets the position of the write mark within the stream.
1.468 +
1.469 +The function calls the virtual function DoSeekL(TMark,TStreamLocation,TInt)
1.470 +to implement this behaviour.
1.471 +
1.472 +@param (The enumerator value is not used).
1.473 +@return The stream position. */
1.474 + {return CONST_CAST(MStreamBuf*,this)->DoSeekL(EWrite,EStreamMark,0);}
1.475 +inline TInt MStreamBuf::SizeL() const
1.476 +/** Gets the size of the stream.
1.477 +
1.478 +@return The size of the stream, in bytes. */
1.479 + {return CONST_CAST(MStreamBuf*,this)->DoSeekL(0,EStreamEnd,0).Offset();}
1.480 +
1.481 +// Class TStreamBuf
1.482 +inline void TStreamBuf::SetBuf(TRead,TUint8* aPtr,TUint8* anEnd)
1.483 +/** Sets the start and end points of the read area within the intermediate buffer.
1.484 +
1.485 +A start point is always within an area; an end point is always the first byte
1.486 +beyond the end of an area.
1.487 +
1.488 +@param (The enumerator is not used).
1.489 +@param aPtr The start point.
1.490 +@param anEnd The end point.
1.491 +@see MStreamBuf::TRead */
1.492 + {iRPtr=aPtr;iREnd=anEnd;}
1.493 +inline void TStreamBuf::SetBuf(TWrite,TUint8* aPtr,TUint8* anEnd)
1.494 +/** Sets the start and end points of the write area within the intermediate buffer.
1.495 +
1.496 +A start point is always within an area; an end point is always the first byte
1.497 +beyond the end of an area.
1.498 +
1.499 +@param (The enumerator is not used).
1.500 +@param aPtr The start point.
1.501 +@param anEnd The end point.
1.502 +@see MStreamBuf::TWrite */
1.503 + {iWPtr=aPtr;iWEnd=anEnd;}
1.504 +inline void TStreamBuf::SetPtr(TRead,TUint8* aPtr)
1.505 +/** Sets the start point of the write area within the intermediate buffer.
1.506 +
1.507 +A start point is always within an area.
1.508 +
1.509 +@param (The enumerator is not used).
1.510 +@param aPtr The start point.
1.511 +@see MStreamBuf::TWrite */
1.512 + {iRPtr=aPtr;}
1.513 +inline void TStreamBuf::SetPtr(TWrite,TUint8* aPtr)
1.514 +/** Sets the start point of the write area within the intermediate buffer.
1.515 +
1.516 +A start point is always within an area.
1.517 +
1.518 +@param (The enumerator is not used).
1.519 +@param aPtr The start point.
1.520 +@see MStreamBuf::TWrite */
1.521 + {iWPtr=aPtr;}
1.522 +inline void TStreamBuf::SetEnd(TRead,TUint8* anEnd)
1.523 + {iREnd=anEnd;}
1.524 +inline void TStreamBuf::SetEnd(TWrite,TUint8* anEnd)
1.525 + {iWEnd=anEnd;}
1.526 +inline TUint8* TStreamBuf::Ptr(TRead) const
1.527 +/** Gets the current start point of the read area within the intermediate buffer.
1.528 +
1.529 +@param (The enumerator is not used).
1.530 +@return The start point.
1.531 +@see MStreamBuf::TRead */
1.532 + {return iRPtr;}
1.533 +inline TUint8* TStreamBuf::Ptr(TWrite) const
1.534 +/** Gets the current start point of the write area within the intermediate buffer.
1.535 +
1.536 +@param (The enumerator is not used).
1.537 +@return The start point.
1.538 +@see MStreamBuf::TWrite */
1.539 + {return iWPtr;}
1.540 +inline TUint8* TStreamBuf::End(TRead) const
1.541 +/** Gets the current end point of the read area within the intermediate buffer.
1.542 +
1.543 +An end point is always the first byte beyond the end of an area.
1.544 +
1.545 +@param (The enumerator is not used).
1.546 +@return The end point.
1.547 +@see MStreamBuf::TRead */
1.548 + {return iREnd;}
1.549 +inline TUint8* TStreamBuf::End(TWrite) const
1.550 +/** Gets the current end point of the write area within the intermediate buffer.
1.551 +
1.552 +An end point is always the first byte beyond the end of an area.
1.553 +
1.554 +@param (The enumerator is not used).
1.555 +@return The end point.
1.556 +@see MStreamBuf::TWrite */
1.557 + {return iWEnd;}
1.558 +inline TInt TStreamBuf::Avail(TRead) const
1.559 +/** Gets the number of bytes available in the read area within the intermediate
1.560 +buffer.
1.561 +
1.562 +@param (The enumerator is not used).
1.563 +@return The number of bytes available.
1.564 +@see MStreamBuf::TRead */
1.565 + {return iREnd-iRPtr;}
1.566 +inline TInt TStreamBuf::Avail(TWrite) const
1.567 +/** Gets the number of bytes available in the write area within the intermediate
1.568 +buffer.
1.569 +
1.570 +@param (The enumerator is not used).
1.571 +@return The number of bytes available.
1.572 +@see MStreamBuf::TWrite */
1.573 + {return iWEnd-iWPtr;}
1.574 +
1.575 +// Class TStreamFilter
1.576 +inline void TStreamFilter::Set(MStreamBuf* aHost,TInt aMode)
1.577 +/** Sets up the filter to use the specified host for streamed data.
1.578 +
1.579 +Taking ownership of the host stream buffer means that calls to SynchL() propagate
1.580 +to the host buffer after the filter has flushed its data, and that when the
1.581 +filter is released it also releases the host buffer.
1.582 +
1.583 +@param aHost The host for the streamed data - a stream buffer.
1.584 +@param aMode The mode in which the stream buffer is to be used. It can be used
1.585 +in either read or write modes, represented by ERead and EWrite, but not both
1.586 +at the same time. In debug mode, setting both raises a STORE-Stream 18 panic.
1.587 +In addition, specify EAttached to indicate that the filter should take ownership
1.588 +of the host stream buffer.
1.589 +@see MStreamBuf::TRead
1.590 +@see MStreamBuf::TWrite */
1.591 + {
1.592 +#if defined (_DEBUG)
1.593 + __DbgChkMode(aMode);
1.594 +#endif
1.595 + iHost=aHost;iMode=aMode;
1.596 + }
1.597 +inline void TStreamFilter::Committed()
1.598 +/** Flags the streamed data as committed. */
1.599 + {iMode&=~EWrite;}
1.600 +inline TBool TStreamFilter::IsCommitted() const
1.601 +/** Tests whether the streamed data is committed.
1.602 +
1.603 +@return True, if streamed data is committed; false, otherwise. */
1.604 + {return iHost==NULL||!(iMode&EWrite);}