Ejemplo n.º 1
0
/// @copydoc Serializer::SerializeCharString()
void BinarySerializer::SerializeCharString( CharString& rValue )
{
    if( ShouldSerializeCurrentProperty() )
    {
        HELIUM_ASSERT( rValue.GetSize() <= UINT32_MAX );
        uint32_t stringLength = static_cast< uint32_t >( rValue.GetSize() );
        m_pPropertyStream->Write( &stringLength, sizeof( stringLength ), 1 );

        m_pPropertyStream->Write( rValue.GetData(), sizeof( char ), stringLength );
    }
}
Ejemplo n.º 2
0
/// Default CharString hash.
///
/// @param[in] rKey  Key for which to compute a hash value.
///
/// @return  Hash value.
size_t Hash< CharString >::operator()( const CharString& rKey ) const
{
    return StringHash( rKey.GetData() );
}
Ejemplo n.º 3
0
/// Copy constructor.
///
/// When copying, only the memory needed to hold onto the used contents of the source string will be allocated (i.e.
/// if the source string has 10 elements but a capacity of 20, only memory for the 10 used elements will be
/// allocated for this copy).
///
/// @param[in] rSource  String from which to copy.
CharString::CharString( const CharString& rSource )
    : StringBase( rSource.GetData(), rSource.GetSize() )
{
}