Qt 4.8
Public Functions | Private Functions | Properties | Friends | List of all members
QByteRef Class Reference

#include <qbytearray.h>

Public Functions

 operator char () const
 
bool operator!= (char c) const
 
bool operator< (char c) const
 
bool operator<= (char c) const
 
QByteRefoperator= (char c)
 
QByteRefoperator= (const QByteRef &c)
 
bool operator== (char c) const
 
bool operator> (char c) const
 
bool operator>= (char c) const
 

Private Functions

 QByteRef (QByteArray &array, int idx)
 

Properties

QByteArraya
 
int i
 

Friends

class QByteArray
 

Detailed Description

Definition at line 455 of file qbytearray.h.

Constructors and Destructors

◆ QByteRef()

QByteRef::QByteRef ( QByteArray array,
int  idx 
)
inlineprivate

Definition at line 458 of file qbytearray.h.

459  : a(array),i(idx) {}
QByteArray & a
Definition: qbytearray.h:456

Functions

◆ operator char()

QByteRef::operator char ( ) const
inline

Definition at line 466 of file qbytearray.h.

467  { return i < a.d->size ? a.d->data[i] : char(0); }
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator!=()

bool QByteRef::operator!= ( char  c) const
inline

Definition at line 477 of file qbytearray.h.

478  { return a.d->data[i] != c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator<()

bool QByteRef::operator< ( char  c) const
inline

Definition at line 483 of file qbytearray.h.

484  { return a.d->data[i] < c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator<=()

bool QByteRef::operator<= ( char  c) const
inline

Definition at line 485 of file qbytearray.h.

486  { return a.d->data[i] <= c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator=() [1/2]

QByteRef& QByteRef::operator= ( char  c)
inline

Definition at line 469 of file qbytearray.h.

470  { if (i >= a.d->size) a.expand(i); else a.detach();
471  a.d->data[i] = c; return *this; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456
void expand(int i)
void detach()
Definition: qbytearray.h:435

◆ operator=() [2/2]

QByteRef& QByteRef::operator= ( const QByteRef c)
inline

Definition at line 472 of file qbytearray.h.

473  { if (i >= a.d->size) a.expand(i); else a.detach();
474  a.d->data[i] = c.a.d->data[c.i]; return *this; }
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456
void expand(int i)
void detach()
Definition: qbytearray.h:435

◆ operator==()

bool QByteRef::operator== ( char  c) const
inline

Definition at line 475 of file qbytearray.h.

476  { return a.d->data[i] == c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator>()

bool QByteRef::operator> ( char  c) const
inline

Definition at line 479 of file qbytearray.h.

480  { return a.d->data[i] > c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

◆ operator>=()

bool QByteRef::operator>= ( char  c) const
inline

Definition at line 481 of file qbytearray.h.

482  { return a.d->data[i] >= c; }
unsigned char c[8]
Definition: qnumeric_p.h:62
Data * d
Definition: qbytearray.h:386
QByteArray & a
Definition: qbytearray.h:456

Friends and Related Functions

◆ QByteArray

friend class QByteArray
friend

Definition at line 460 of file qbytearray.h.

Properties

◆ a

QByteArray& QByteRef::a
private

Definition at line 456 of file qbytearray.h.

Referenced by operator=().

◆ i

int QByteRef::i
private

Definition at line 457 of file qbytearray.h.

Referenced by operator=().


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