DynamicCString Class Reference

#include <awStringShared.h>

List of all members.

Public Member Functions

  DynamicCString ()
  DynamicCString (const char *str)
  DynamicCString (const awString::CString &str)
  DynamicCString (const DynamicCString &rhs)
  ~DynamicCString ()
void  operator= (const DynamicCString &rhs)
bool  isValid () const
int  refs () const
const awString::CString *  operator-> () const
const awString::CString &  operator* () const
bool  operator== (const DynamicCString &rhs) const
bool  operator!= (const DynamicCString &rhs) const
bool  operator< (const DynamicCString &rhs) const
bool  operator== (const ConstantCString &rhs) const
bool  operator!= (const ConstantCString &rhs) const

Friends

class  ConstantCString
AWSTRING_DECL DynamicCString  intern_dynamic (const awString::CString &)

Constructor & Destructor Documentation

DynamicCString ( ) [inline]
            : m_value (0)
        {
        }
DynamicCString ( const char *  str ) [inline]
            : m_value (0)
        {
            *this = intern_dynamic (str);
        }
DynamicCString ( const awString::CString &  str ) [inline]
            : m_value (0)
        {
            *this = intern_dynamic (str);
        }
DynamicCString ( const DynamicCString rhs ) [inline]
            : m_value (rhs.m_value)
        {
            if (m_value)
                increaseStringRef (m_value);
        }
~DynamicCString ( ) [inline]
        {
            if (m_value)
                decreaseStringRef (m_value);
        }

Member Function Documentation

void operator= ( const DynamicCString rhs ) [inline]
        {
            // This order allows self assignment
            if (rhs.m_value)
                increaseStringRef (rhs.m_value);
            if (m_value)
                decreaseStringRef (m_value);
            m_value = rhs.m_value;
        }
bool isValid ( ) const [inline]
        {
            return m_value != 0;
        }
int refs ( ) const [inline]
        {
            return m_value ? m_value->m_refs : 0;
        }
const awString::CString* operator-> ( ) const [inline]
        {
            assert (m_value);
            return &(m_value->m_string);
        }
const awString::CString& operator* ( ) const [inline]
        {
            assert (m_value);
            return m_value->m_string;
        }
bool operator== ( const DynamicCString rhs ) const [inline]
        {
            // A pointer comparison
            return m_value == rhs.m_value;
        }
bool operator!= ( const DynamicCString rhs ) const [inline]
        {
            // A pointer comparison
            return m_value != rhs.m_value;
        }
bool operator< ( const DynamicCString rhs ) const [inline]
        {
            // A pointer comparison
            return m_value < rhs.m_value;
        }
bool operator== ( const ConstantCString rhs ) const [inline]
    {
        // A pointer comparison
        return m_value == rhs.m_value;
    }
bool operator!= ( const ConstantCString rhs ) const [inline]
    {
        // A pointer comparison
        return m_value != rhs.m_value;
    }

Friends And Related Function Documentation

AWSTRING_DECL DynamicCString intern_dynamic ( const awString::CString &  ) [friend]

DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString
DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString DynamicCString