FX::QByteArray Class Reference
[Qt Template Library]

#include <qcstring.h>

Inheritance diagram for FX::QByteArray:

Inheritance graph
[legend]

List of all members.


Detailed Description

A thunk of Qt's QByteArray to the STL.

To aid porting of Qt programs to FOX.

Note:
Qt's QByteArray is QMemArray<char> whereas ours is QMemArray<unsigned char>. Why? Because byte data should be unsigned!
See also:
QMemArray

Public Types

typedef unsigned char * Iterator
typedef const unsigned char * ConstIterator
typedef unsigned char ValueType

Public Member Functions

 QByteArray ()
 QByteArray (FXuval size)
 QByteArray (unsigned char *a, uint n, bool noDeleteExtArray=true)
unsigned char * data () const
 operator const unsigned char * () const
uint size () const
uint count () const
bool isEmpty () const
bool isNull () const
bool resize (uint size)
bool resize (uint size, QGArray::Optimization optim)
bool truncate (uint pos)
void swap (QMemArray< unsigned char > &o)
bool fill (const unsigned char &val, int newsize=-1)
FXDEPRECATEDEXT void detach ()
FXDEPRECATEDEXT QMemArray
< unsigned char > 
copy () const
FXDEPRECATEDEXT QMemArray
< unsigned char > & 
assign (const QMemArray< unsigned char > &o)
FXDEPRECATEDEXT QMemArray
< unsigned char > & 
assign (const unsigned char *a, uint n)
FXDEPRECATEDEXT QMemArray
< unsigned char > & 
duplicate (const QMemArray< unsigned char > &o)
FXDEPRECATEDEXT QMemArray
< unsigned char > & 
duplicate (const unsigned char *a, uint n)
QMemArray< unsigned char > & setRawData (const unsigned char *a, uint n, bool _noDeleteExtArray=false)
void resetRawData (const unsigned char *a, uint n)
int find (const unsigned char &val, uint i=0) const
int contains (const unsigned char &val) const
void sort ()
int bsearch (const unsigned char &val) const
unsigned char & at (uint i) const
unsigned char & operator[] (uint i) const
unsigned char & operator[] (int i) const
bool operator== (const QMemArray< unsigned char > &o) const
bool operator!= (const QMemArray< unsigned char > &o) const
Iterator begin ()
ConstIterator begin () const
Iterator end ()
ConstIterator end () const
void push_back (const unsigned char &v)
void append (const unsigned char &v)

Constructor & Destructor Documentation

FX::QByteArray::QByteArray (  )  [inline]

Constructs an empty array of type.

FX::QByteArray::QByteArray ( FXuval  size  )  [inline]

Constructs an array of type size long.

FX::QByteArray::QByteArray ( unsigned char *  a,
uint  n,
bool  noDeleteExtArray = true 
) [inline]

Constructs an array using an external array.


Member Function Documentation

unsigned char * FX::QMemArray< unsigned char >::data (  )  const [inline, inherited]

Returns a pointer to the array.

uint FX::QMemArray< unsigned char >::size (  )  const [inline, inherited]

Returns the number of elements in the array.

bool FX::QMemArray< unsigned char >::isEmpty (  )  const [inline, inherited]

Returns true if the array is empty.

bool FX::QMemArray< unsigned char >::isNull (  )  const [inline, inherited]

Returns true if the array is empty.

bool FX::QMemArray< unsigned char >::resize ( uint  size  )  [inline, inherited]

Resizes the array.

void FX::QMemArray< unsigned char >::swap ( QMemArray< unsigned char > &  o  )  [inline, inherited]

Swaps the contents of two arrays.

bool FX::QMemArray< unsigned char >::fill ( const unsigned char &  val,
int  newsize = -1 
) [inline, inherited]

Fills the array with value val.

FXDEPRECATEDEXT void FX::QMemArray< unsigned char >::detach (  )  [inline, inherited]

Deprecated:
For Qt compatibility only

FXDEPRECATEDEXT QMemArray<unsigned char > FX::QMemArray< unsigned char >::copy (  )  const [inline, inherited]

Deprecated:
For Qt compatibility only

FXDEPRECATEDEXT QMemArray<unsigned char >& FX::QMemArray< unsigned char >::assign ( const QMemArray< unsigned char > &  o  )  [inline, inherited]

Deprecated:
For Qt compatibility only

FXDEPRECATEDEXT QMemArray<unsigned char >& FX::QMemArray< unsigned char >::duplicate ( const QMemArray< unsigned char > &  o  )  [inline, inherited]

Deprecated:
For Qt compatibility only

QMemArray<unsigned char >& FX::QMemArray< unsigned char >::setRawData ( const unsigned char *  a,
uint  n,
bool  _noDeleteExtArray = false 
) [inline, inherited]

Sets QMemArray<> to use an external array. Note that not all methods are implemented for this (see the header file). Note also that like Qt's version, you must not resize or reassign the array when in this state. Failure to call resetRawData() before destruction causes delete on the data unless you set _noDeleteExtArray.

void FX::QMemArray< unsigned char >::resetRawData ( const unsigned char *  a,
uint  n 
) [inline, inherited]

Resets QMemArray<> to use its internally managed data.

int FX::QMemArray< unsigned char >::find ( const unsigned char &  val,
uint  i = 0 
) const [inline, inherited]

Returns the index of val starting the search from i, returning -1 if not found.

int FX::QMemArray< unsigned char >::contains ( const unsigned char &  val  )  const [inline, inherited]

Returns the number of times val is in the array.

void FX::QMemArray< unsigned char >::sort (  )  [inline, inherited]

Sorts the array into numerical order.

int FX::QMemArray< unsigned char >::bsearch ( const unsigned char &  val  )  const [inline, inherited]

Performs a binary search to find an item (needs a numerically sorted array), returning -1 if not found.

unsigned char & FX::QMemArray< unsigned char >::at ( uint  i  )  const [inline, inherited]

Returns a reference to the element at index i in the array.

Iterator FX::QMemArray< unsigned char >::begin (  )  [inline, inherited]

Returns an iterator pointing to the first element.

ConstIterator FX::QMemArray< unsigned char >::begin (  )  const [inline, inherited]

Returns a const iterator pointint to the first element.

Iterator FX::QMemArray< unsigned char >::end (  )  [inline, inherited]

Returns an iterator pointing one past the last element.

ConstIterator FX::QMemArray< unsigned char >::end (  )  const [inline, inherited]

Returns a const iterator pointing one past the last element.

void FX::QMemArray< unsigned char >::push_back ( const unsigned char &  v  )  [inline, inherited]

Appends an item onto the end.


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

(C) 2002-2008 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Jun 13 22:27:28 2008 for TnFOX by doxygen v1.5.6