Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Private Attributes
LossyConvertEncoding< FromCharT, ToCharT > Class Template Reference

A character sink that performs a |reinterpret_cast| style conversion between character types. More...

#include <nsUTF8Utils.h>

List of all members.

Public Types

typedef FromCharT value_type
typedef FromCharT input_type
typedef ToCharT output_type
typedef nsCharTraits
< FromCharT >
::unsigned_char_type 
unsigned_input_type

Public Member Functions

 LossyConvertEncoding (output_type *aDestination)
PRUint32 write (const input_type *aSource, PRUint32 aSourceLength)
void write_terminator ()

Private Attributes

output_typemDestination

Detailed Description

template<class FromCharT, class ToCharT>
class LossyConvertEncoding< FromCharT, ToCharT >

A character sink that performs a |reinterpret_cast| style conversion between character types.

Definition at line 433 of file nsUTF8Utils.h.


Member Typedef Documentation

template<class FromCharT, class ToCharT>
typedef FromCharT LossyConvertEncoding< FromCharT, ToCharT >::input_type

Definition at line 438 of file nsUTF8Utils.h.

template<class FromCharT, class ToCharT>
typedef ToCharT LossyConvertEncoding< FromCharT, ToCharT >::output_type

Definition at line 439 of file nsUTF8Utils.h.

template<class FromCharT, class ToCharT>
typedef nsCharTraits<FromCharT>::unsigned_char_type LossyConvertEncoding< FromCharT, ToCharT >::unsigned_input_type

Definition at line 441 of file nsUTF8Utils.h.

template<class FromCharT, class ToCharT>
typedef FromCharT LossyConvertEncoding< FromCharT, ToCharT >::value_type

Definition at line 436 of file nsUTF8Utils.h.


Constructor & Destructor Documentation

template<class FromCharT, class ToCharT>
LossyConvertEncoding< FromCharT, ToCharT >::LossyConvertEncoding ( output_type aDestination) [inline]

Definition at line 444 of file nsUTF8Utils.h.

: mDestination(aDestination) { }

Member Function Documentation

template<class FromCharT, class ToCharT>
PRUint32 LossyConvertEncoding< FromCharT, ToCharT >::write ( const input_type aSource,
PRUint32  aSourceLength 
) [inline]

Definition at line 447 of file nsUTF8Utils.h.

        {
          const input_type* done_writing = aSource + aSourceLength;
          while ( aSource < done_writing )
            *mDestination++ = (output_type)(unsigned_input_type)(*aSource++);  // use old-style cast to mimic old |ns[C]String| behavior
          return aSourceLength;
        }

Here is the caller graph for this function:

template<class FromCharT, class ToCharT>
void LossyConvertEncoding< FromCharT, ToCharT >::write_terminator ( ) [inline]

Definition at line 456 of file nsUTF8Utils.h.


Member Data Documentation

template<class FromCharT, class ToCharT>
output_type* LossyConvertEncoding< FromCharT, ToCharT >::mDestination [private]

Definition at line 462 of file nsUTF8Utils.h.


The documentation for this class was generated from the following file: