Public Member Functions | Static Public Member Functions

QStringRef Class Reference

Search for all occurrences

Detailed Description

Definition at line 1102 of file qstring.h.

#include <qstring.h>

List of all members.

Public Member Functions

  QStringRef ()
  QStringRef (const QString *string, int position, int size)
  QStringRef (const QString *string)
  QStringRef (const QStringRef &other)
  ~QStringRef ()
const QString string () const
int  position () const
int  size () const
int  count () const
int  length () const
QStringRef operator= (const QStringRef &other)
QStringRef operator= (const QString *string)
const QChar unicode () const
const QChar data () const
const QChar constData () const
void  clear ()
QString  toString () const
bool  isEmpty () const
bool  isNull () const
QStringRef  appendTo (QString *string) const
const QChar  at (int i) const
int  compare (const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int  compare (const QStringRef &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int  compare (QLatin1String s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
int  localeAwareCompare (const QString &s) const
int  localeAwareCompare (const QStringRef &s) const

Static Public Member Functions

static int  compare (const QStringRef &s1, const QString &s2, Qt::CaseSensitivity=Qt::CaseSensitive)
static int  compare (const QStringRef &s1, const QStringRef &s2, Qt::CaseSensitivity=Qt::CaseSensitive)
static int  compare (const QStringRef &s1, QLatin1String s2, Qt::CaseSensitivity cs=Qt::CaseSensitive)
static int  localeAwareCompare (const QStringRef &s1, const QString &s2)
static int  localeAwareCompare (const QStringRef &s1, const QStringRef &s2)

Constructor & Destructor Documentation

QStringRef ( ) [inline]

Definition at line 1107 of file qstring.h.

:m_string(0), m_position(0), m_size(0){}
QStringRef ( const QString string,
int  position,
int  size 
) [inline]

Definition at line 1165 of file qstring.h.

        :m_string(aString), m_position(aPosition), m_size(aSize){}
QStringRef ( const QString string ) [inline]

Definition at line 1168 of file qstring.h.

    :m_string(aString), m_position(0), m_size(aString?aString->size() : 0){}
QStringRef ( const QStringRef other ) [inline]

Definition at line 1110 of file qstring.h.

        :m_string(other.m_string), m_position(other.m_position), m_size(other.m_size)
        {}
~QStringRef ( ) [inline]

Definition at line 1114 of file qstring.h.

{}

Member Function Documentation

const QString* string ( ) const [inline]

Definition at line 1115 of file qstring.h.

{ return m_string; }
int position ( ) const [inline]

Definition at line 1116 of file qstring.h.

{ return m_position; }
int size ( ) const [inline]

Definition at line 1117 of file qstring.h.

{ return m_size; }
int count ( ) const [inline]

Definition at line 1118 of file qstring.h.

{ return m_size; }
int length ( ) const [inline]

Definition at line 1119 of file qstring.h.

{ return m_size; }
QStringRef& operator= ( const QStringRef other ) [inline]

Definition at line 1121 of file qstring.h.

                                                          {
        m_string = other.m_string; m_position = other.m_position;
        m_size = other.m_size; return *this;
    }
QStringRef & operator= ( const QString string ) [inline]

Definition at line 1162 of file qstring.h.

{ m_string = aString; m_position = 0; m_size = aString?aString->size():0; return *this; }
const QChar* unicode ( ) const [inline]

Definition at line 1128 of file qstring.h.

                                        {
        if (!m_string)
            return reinterpret_cast<const QChar *>(QString::shared_null.data);
        return m_string->unicode() + m_position;
    }
const QChar* data ( ) const [inline]

Definition at line 1133 of file qstring.h.

{ return unicode(); }
const QChar* constData ( ) const [inline]

Definition at line 1134 of file qstring.h.

{  return unicode(); }
void clear ( ) [inline]

Definition at line 1136 of file qstring.h.

{ m_string = 0; m_position = m_size = 0; }
QString toString ( ) const
bool isEmpty ( ) const [inline]

Definition at line 1138 of file qstring.h.

{ return m_size == 0; }
bool isNull ( ) const [inline]

Definition at line 1139 of file qstring.h.

{ return m_string == 0 || m_string->isNull(); }
QStringRef appendTo ( QString string ) const
const QChar at ( int  i ) const [inline]

Definition at line 1143 of file qstring.h.

        { Q_ASSERT(i >= 0 && i < size()); return m_string->at(i + m_position); }
int compare ( const QString s,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const [inline]

Definition at line 1218 of file qstring.h.

{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
int compare ( const QStringRef s,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const [inline]

Definition at line 1220 of file qstring.h.

{ return QString::compare_helper(constData(), length(), s.constData(), s.length(), cs); }
int compare ( QLatin1String  s,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) const [inline]

Definition at line 1222 of file qstring.h.

{ return QString::compare_helper(constData(), length(), s, cs); }
int compare ( const QStringRef s1,
const QString s2,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) [inline, static]

Definition at line 1224 of file qstring.h.

{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
int compare ( const QStringRef s1,
const QStringRef s2,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) [inline, static]

Definition at line 1226 of file qstring.h.

{ return QString::compare_helper(s1.constData(), s1.length(), s2.constData(), s2.length(), cs); }
int compare ( const QStringRef s1,
QLatin1String  s2,
Qt::CaseSensitivity  cs = Qt::CaseSensitive 
) [inline, static]

Definition at line 1228 of file qstring.h.

{ return QString::compare_helper(s1.constData(), s1.length(), s2, cs); }
int localeAwareCompare ( const QString s ) const [inline]

Definition at line 1235 of file qstring.h.

{ return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
int localeAwareCompare ( const QStringRef s ) const [inline]

Definition at line 1237 of file qstring.h.

{ return QString::localeAwareCompare_helper(constData(), length(), s.constData(), s.length()); }
int localeAwareCompare ( const QStringRef s1,
const QString s2 
) [inline, static]

Definition at line 1239 of file qstring.h.

{ return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }
int localeAwareCompare ( const QStringRef s1,
const QStringRef s2 
) [inline, static]

Definition at line 1241 of file qstring.h.

{ return QString::localeAwareCompare_helper(s1.constData(), s1.length(), s2.constData(), s2.length()); }

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

QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef
QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef QStringRef