Exemplo n.º 1
0
/// @copydoc Serializer::SerializeWideString()
void BinarySerializer::SerializeWideString( WideString& 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( wchar_t ), stringLength );
    }
}
Exemplo n.º 2
0
/// Default WideString hash.
///
/// @param[in] rKey  Key for which to compute a hash value.
///
/// @return  Hash value.
size_t Hash< WideString >::operator()( const WideString& rKey ) const
{
    return StringHash( rKey.GetData() );
}
Exemplo 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.
WideString::WideString( const WideString& rSource )
    : StringBase( rSource.GetData(), rSource.GetSize() )
{
}