Exemplo n.º 1
0
void ArraySet::From( 
	I_IStream_Ptr inStream,
	bool		  inBlock )
{
	argused1( inBlock );

	// Destroy existing content first.
	InitSelf( 0 );

	// 1) Allocated len.
	vuint32 allocLen;
	inStream->get( allocLen );

	if( allocLen > 0 )
	{
		InitSelf( allocLen / sizeof(REC_ID) );

		// 2) Actual len.
		vuint32 actualLen;
		inStream->get(actualLen);
		if( actualLen > 0)
		{
			// 3) BitSet's data.
			inStream->get((vuint8*)mpStart, actualLen);
			mpFinish = mpStart + (actualLen / sizeof(REC_ID));

			// 4) 'Sorted' flag.
			inStream->get( mIsSorted );
		}
	}
}
Exemplo n.º 2
0
void Value_Raw::From( I_IStream_Ptr inStream, bool inBlock )
{
	argused1(inBlock);

	Clear();

	bool IsNull;
	inStream->get(IsNull);
	if( !IsNull )
	{
		put_IsNull(false);

		vuint32 Len;
		inStream->get(Len);
		Alloc(Len);

		if( Len > 0 )
		{
			vuint32 Available = get_Allocated();
			Available = Len > Available ? Available : Len;

			inStream->get(reinterpret_cast<void*>(m_pStart), Available);
			m_pEnd = m_pStart + Len;
		}
	}
	else
	{
		put_IsNull(true);
	}
}