persistentstorage/sql/SRC/Common/SqlBufIterator.cpp
changeset 29 cce6680bbf1c
parent 0 08ec8eefde2f
child 31 ba1c4f4a893f
equal deleted inserted replaced
28:7a522c0700d3 29:cce6680bbf1c
     1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   212 };
   212 };
   213 
   213 
   214 /**
   214 /**
   215 @return Represents the content of a text or a binary field as a stream of bytes.
   215 @return Represents the content of a text or a binary field as a stream of bytes.
   216 
   216 
   217 @leave KErrNoMemory, out of memory condition has occured;
   217 @leave KErrNoMemory, out of memory condition has occured,
       
   218 	   KErrArgument, the column type is not text, blob or null;
   218 */	
   219 */	
   219 MStreamBuf* TSqlBufRIterator::StreamL() const
   220 MStreamBuf* TSqlBufRIterator::StreamL() const
   220 	{
   221 	{
   221 	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
   222 	__SQLASSERT(iCurrent >= iBegin && iCurrent < iEnd, ESqlPanicInternalError);
   222 	__SQLASSERT(::IsSequenceSqlType(Type()), ESqlPanicInternalError);
   223 	if(!::IsSequenceSqlType(Type()))
       
   224 		{
       
   225 		__SQLLEAVE(KErrArgument);
       
   226 		}
   223 	return HReadOnlyBuf::NewL(reinterpret_cast <const TUint8*> (iBegin) + iCurrent->iPos, iCurrent->Size());
   227 	return HReadOnlyBuf::NewL(reinterpret_cast <const TUint8*> (iBegin) + iCurrent->iPos, iCurrent->Size());
   224 	}
   228 	}