Qt 4.8
Public Functions | Public Variables | List of all members
QStringSplitter Class Reference

Public Functions

bool hasNext ()
 
QStringRef next ()
 
 QStringSplitter (const QString &s)
 

Public Variables

const QCharm_data
 
int m_len
 
int m_pos
 
QChar m_splitChar
 
QString m_string
 

Detailed Description

Definition at line 77 of file qresource.cpp.

Constructors and Destructors

◆ QStringSplitter()

QStringSplitter::QStringSplitter ( const QString s)
inline

Definition at line 80 of file qresource.cpp.

82  {
83  m_splitChar = QLatin1Char('/');
84  }
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
const QChar * m_data
Definition: qresource.cpp:100
QString m_string
Definition: qresource.cpp:99
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
const QChar * constData() const
Returns a pointer to the data stored in the QString.
Definition: qstring.h:712

Functions

◆ hasNext()

bool QStringSplitter::hasNext ( )
inline

Definition at line 86 of file qresource.cpp.

Referenced by QResourceRoot::findNode().

86  {
87  while (m_pos < m_len && m_data[m_pos] == m_splitChar)
88  ++m_pos;
89  return m_pos < m_len;
90  }
const QChar * m_data
Definition: qresource.cpp:100

◆ next()

QStringRef QStringSplitter::next ( )
inline

Definition at line 92 of file qresource.cpp.

Referenced by QResourceRoot::findNode().

92  {
93  int start = m_pos;
94  while (m_pos < m_len && m_data[m_pos] != m_splitChar)
95  ++m_pos;
96  return QStringRef(&m_string, start, m_pos - start);
97  }
The QStringRef class provides a thin wrapper around QString substrings.
Definition: qstring.h:1099
const QChar * m_data
Definition: qresource.cpp:100
QString m_string
Definition: qresource.cpp:99

Properties

◆ m_data

const QChar* QStringSplitter::m_data

Definition at line 100 of file qresource.cpp.

Referenced by hasNext(), and next().

◆ m_len

int QStringSplitter::m_len

Definition at line 102 of file qresource.cpp.

Referenced by hasNext(), and next().

◆ m_pos

int QStringSplitter::m_pos

Definition at line 103 of file qresource.cpp.

Referenced by hasNext(), and next().

◆ m_splitChar

QChar QStringSplitter::m_splitChar

Definition at line 101 of file qresource.cpp.

Referenced by hasNext(), next(), and QStringSplitter().

◆ m_string

QString QStringSplitter::m_string

Definition at line 99 of file qresource.cpp.

Referenced by next().


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