Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT > Class Template Reference

#include <nsStdStringWrapper.h>

Collaboration diagram for basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 basic_nsStdStringWrapper ()
 basic_nsStdStringWrapper (const basic_nsAString< CharT > &str)
 basic_nsStdStringWrapper (const CharT *s, size_type n, const AllocatorT &a=AllocatorT())
 basic_nsStdStringWrapper (const CharT *s, const AllocatorT &a=AllocatorT())
virtual PRUint32 Length () const
virtual void SetCapacity (PRUint32 aNewCapacity)
virtual void SetLength (PRUint32 aNewLength)

Protected Types

typedef std::basic_string
< CharT, TraitsT, AllocatorT > 
basic_string_t

Protected Member Functions

virtual const voidImplementation () const
virtual const CharTGetReadableFragment (nsReadableFragment< CharT > &, nsFragmentRequest, PRUint32) const
virtual CharTGetWritableFragment (nsWritableFragment< CharT > &, nsFragmentRequest, PRUint32)
virtual void do_AssignFromReadable (const basic_nsAString< CharT > &)

Protected Attributes

std::basic_string< CharT,
TraitsT, AllocatorT > 
mRawString

Static Protected Attributes

static const size_type npos = size_type(-1)

Detailed Description

template<class CharT, class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
class basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >

Definition at line 58 of file nsStdStringWrapper.h.


Member Typedef Documentation

template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
typedef std::basic_string<CharT, TraitsT, AllocatorT> basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::basic_string_t [protected]

Definition at line 67 of file nsStdStringWrapper.h.


Constructor & Destructor Documentation

template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::basic_nsStdStringWrapper ( ) [inline]

Definition at line 92 of file nsStdStringWrapper.h.

{ }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::basic_nsStdStringWrapper ( const basic_nsAString< CharT > &  str) [inline, explicit]

Definition at line 103 of file nsStdStringWrapper.h.

        {
          Assign(str);
        }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::basic_nsStdStringWrapper ( const CharT s,
size_type  n,
const AllocatorT &  a = AllocatorT() 
) [inline]

Definition at line 121 of file nsStdStringWrapper.h.

           : mRawString(s, n, a)
         {
         }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::basic_nsStdStringWrapper ( const CharT s,
const AllocatorT &  a = AllocatorT() 
) [inline, explicit]

Definition at line 127 of file nsStdStringWrapper.h.

           : mRawString(s, a)
         {
         }

Member Function Documentation

template<class CharT , class TraitsT , class AllocatorT >
void basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::do_AssignFromReadable ( const basic_nsAString< CharT > &  rhs) [protected, virtual]

Definition at line 219 of file nsStdStringWrapper.h.

  {
    typedef basic_nsStdStringWrapper<CharT, TraitsT, AllocatorT> this_t;

    if ( SameImplementation(*this, rhs) )
      mRawString = NS_STATIC_CAST(this_t, rhs).mRawString;
    else
      basic_nsAString<CharT>::do_AssignFromReadable(rhs);
  }
template<class CharT , class TraitsT , class AllocatorT >
const CharT * basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::GetReadableFragment ( nsReadableFragment< CharT > &  aFragment,
nsFragmentRequest  aRequest,
PRUint32  aOffset 
) const [protected, virtual]

Definition at line 181 of file nsStdStringWrapper.h.

  {
    switch ( aRequest )
      {
        case kFirstFragment:
        case kLastFragment:
        case kFragmentAt:
          aFragment.mEnd = (aFragment.mStart = mRawString.data()) + mRawString.length();
          return aFragment.mStart + aOffset;
        
        case kPrevFragment:
        case kNextFragment:
        default:
          return 0;
      }
  }
template<class CharT , class TraitsT , class AllocatorT >
CharT * basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::GetWritableFragment ( nsWritableFragment< CharT > &  aFragment,
nsFragmentRequest  aRequest,
PRUint32  aOffset 
) [protected, virtual]

Definition at line 200 of file nsStdStringWrapper.h.

  {
    switch ( aRequest )
      {
        case kFirstFragment:
        case kLastFragment:
        case kFragmentAt:
          aFragment.mEnd = (aFragment.mStart = NS_CONST_CAST(CharT*, mRawString.data())) + mRawString.length();
          return aFragment.mStart + aOffset;
        
        case kPrevFragment:
        case kNextFragment:
        default:
          return 0;
      }
  }
template<class CharT , class TraitsT , class AllocatorT >
const void * basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::Implementation ( ) const [protected, virtual]

Definition at line 172 of file nsStdStringWrapper.h.

  {
    static const char* implementation = "nsStdStringWrapper";
    return implementation;
  }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
virtual PRUint32 basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::Length ( ) const [inline, virtual]

Definition at line 141 of file nsStdStringWrapper.h.

        {
          return mRawString.length();
        }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
virtual void basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::SetCapacity ( PRUint32  aNewCapacity) [inline, virtual]

Definition at line 148 of file nsStdStringWrapper.h.

        {
          mRawString.reserve(aNewCapacity);
        }
template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
virtual void basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::SetLength ( PRUint32  aNewLength) [inline, virtual]

Definition at line 155 of file nsStdStringWrapper.h.

        {
          mRawString.resize(aNewLength);
        }

Member Data Documentation

template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
std::basic_string<CharT, TraitsT, AllocatorT> basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::mRawString [protected]

Definition at line 65 of file nsStdStringWrapper.h.

template<class CharT , class TraitsT = nsCharTraits<CharT>, class AllocatorT = nsStringAllocator<CharT>>
const size_type basic_nsStdStringWrapper< CharT, TraitsT, AllocatorT >::npos = size_type(-1) [static, protected]

Definition at line 83 of file nsStdStringWrapper.h.


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