Esempio n. 1
0
void Value_Raw::To( I_OStream_Ptr inStream, bool inBlock ) const
{
	argused1(inBlock);

	bool IsNull = bool( m_pStart == nullptr );
	inStream->put(IsNull);
	
	if( !IsNull )
	{
		vuint32 Len = vuint32(m_pEnd - m_pStart);
		inStream->put(Len);
		if( Len )
		{
			inStream->put(reinterpret_cast<void*>(m_pStart), Len);
		}
	}
}
Esempio n. 2
0
void ArraySet::To( 
	I_OStream_Ptr inStream,
	bool		  inBlock ) const
{
	argused1(inBlock);
	
	// Type of set.
	inStream->put(vuint8(1));

	if( mpStart )
	{
		vuint32 allocLen  = static_cast<vuint32>((mpStorageEnd - mpStart) * sizeof(vuint32));
		vuint32 actualLen = static_cast<vuint32>((mpFinish - mpStart)     * sizeof(vuint32));

		// 1) Allocated len (in bytes).
		inStream->put(allocLen);

		if( actualLen > 0 )
		{
			// 2) Actual len (in bytes).
			inStream->put(actualLen);
			
			// 3) Data of actual len.
			inStream->put((vuint8*)mpStart, actualLen);

			// 4) 'Sorted' flag.
			inStream->put(mIsSorted);
		}
		else
		{
			inStream->put( vuint32(0) );
		}
	}
	else
	{
		inStream->put( vuint32(0) );
	}
}