persistentstorage/store/USTRM/US_STD.INL
changeset 0 08ec8eefde2f
equal deleted inserted replaced
-1:000000000000 0:08ec8eefde2f
       
     1 // Copyright (c) 1998-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".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 inline TSourceOutput::TSourceOutput(MStreamBuf* aSource)
       
    17 	: iSrc(aSource)
       
    18 	{
       
    19 	__ASSERT_DEBUG(aSource!=NULL,Panic(EStreamNotOpen));
       
    20 	}
       
    21 
       
    22 inline TFilterInput::TFilterInput(TStreamFilter& aFilter,TAny* aPtr,TInt aMaxLength)
       
    23 	: iFltr(&aFilter),iPtr((TUint8*)aPtr),iLeft(aMaxLength)
       
    24 	{}
       
    25 inline TBool TFilterInput::Done() const
       
    26 	{return iLeft==0;}
       
    27 inline TBool TFilterInput::Eof() const
       
    28 	{return iPtr==NULL;}
       
    29 inline TInt TFilterInput::Left() const
       
    30 	{return iLeft;}
       
    31 
       
    32 inline TFilterOutput::TFilterOutput(TStreamFilter& aFilter,const TAny* aPtr,TInt aLength)
       
    33 	: iFltr(&aFilter),iFrom((TUint8*)aPtr),iEnd((TUint8*)aPtr+aLength)
       
    34 	{}
       
    35 inline TBool TFilterOutput::Done() const
       
    36 	{return iFrom==iEnd;}
       
    37 
       
    38 inline TUint8* TDelimitedInput8::Ptr() const
       
    39 	{return iPtr;}
       
    40 inline TInt TDelimitedInput8::Done() const
       
    41 	{return iLeft==0;}
       
    42 
       
    43 inline TUint16* TDelimitedInput16::Ptr() const
       
    44 	{return iPtr;}
       
    45 inline TInt TDelimitedInput16::Done() const
       
    46 	{return iLeft==0;}
       
    47 
       
    48 inline TBool TStreamMark::IsTracking(TStreamMark*const& __DEBUG(aRef)) const
       
    49 	{
       
    50 #if defined (_DEBUG)
       
    51 	return iPos==KStreamBeginning-1-(TUint(&aRef)>>2);
       
    52 #else
       
    53 	return IsEmpty();
       
    54 #endif
       
    55 	}
       
    56 inline void TStreamMark::Track(TStreamMark*const& __DEBUG(aRef))
       
    57 	{
       
    58 #if defined (_DEBUG)
       
    59 	iPos=KStreamBeginning-1-(TUint(&aRef)>>2);
       
    60 	__ASSERT_DEBUG(iPos<KStreamBeginning-1,User::Invariant());
       
    61 #else
       
    62 	Clear();
       
    63 #endif
       
    64 	}
       
    65 
       
    66 inline MStreamBuf& TStreamExchange::BufL() const
       
    67 	{
       
    68 	if (iHost==NULL)
       
    69 		User::Leave(KErrNotReady);
       
    70 	return *iHost;
       
    71 	}
       
    72 inline MStreamBuf& TStreamExchange::Buf() const
       
    73 	{
       
    74 	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
       
    75 	return *iHost;
       
    76 	}
       
    77 
       
    78 inline TStreamExchange& RShareBuf::Host() const
       
    79 	{
       
    80 	__ASSERT_DEBUG(iHost!=NULL,User::Invariant());
       
    81 	return *iHost;
       
    82 	}
       
    83