Qt 4.8
Public Functions | Properties | List of all members
QtopiaPrintBuffer Class Reference

#include <qprintengine_qws_p.h>

Public Functions

void append (char value)
 
void append (short value)
 
void append (int value)
 
void append (const QByteArray &array)
 
void clear ()
 
const QByteArraydata () const
 
void pad ()
 
void patch (int posn, int value)
 
 QtopiaPrintBuffer (bool bigEndian=FALSE)
 
int size () const
 
 ~QtopiaPrintBuffer ()
 

Properties

bool _bigEndian
 
QByteArray _data
 

Detailed Description

Definition at line 109 of file qprintengine_qws_p.h.

Constructors and Destructors

◆ QtopiaPrintBuffer()

QtopiaPrintBuffer::QtopiaPrintBuffer ( bool  bigEndian = FALSE)
inline

Definition at line 112 of file qprintengine_qws_p.h.

112 { _bigEndian = bigEndian; }

◆ ~QtopiaPrintBuffer()

QtopiaPrintBuffer::~QtopiaPrintBuffer ( )
inline

Definition at line 113 of file qprintengine_qws_p.h.

113 {}

Functions

◆ append() [1/4]

void QtopiaPrintBuffer::append ( char  value)
inline

Definition at line 121 of file qprintengine_qws_p.h.

121 { _data.append( value ); }
QByteArray & append(char c)
Appends the character ch to this byte array.

◆ append() [2/4]

void QtopiaPrintBuffer::append ( short  value)

Definition at line 837 of file qprintengine_qws.cpp.

838 {
839  if ( _bigEndian ) {
840  _data.append( (char)(value >> 8) );
841  _data.append( (char)value );
842  } else {
843  _data.append( (char)value );
844  _data.append( (char)(value >> 8) );
845  }
846 }
QByteArray & append(char c)
Appends the character ch to this byte array.

◆ append() [3/4]

void QtopiaPrintBuffer::append ( int  value)

Definition at line 848 of file qprintengine_qws.cpp.

849 {
850  if ( _bigEndian ) {
851  _data.append( (char)(value >> 24) );
852  _data.append( (char)(value >> 16) );
853  _data.append( (char)(value >> 8) );
854  _data.append( (char)value );
855  } else {
856  _data.append( (char)value );
857  _data.append( (char)(value >> 8) );
858  _data.append( (char)(value >> 16) );
859  _data.append( (char)(value >> 24) );
860  }
861 }
QByteArray & append(char c)
Appends the character ch to this byte array.

◆ append() [4/4]

void QtopiaPrintBuffer::append ( const QByteArray array)
inline

Definition at line 124 of file qprintengine_qws_p.h.

124 { _data.append( array ); }
QByteArray & append(char c)
Appends the character ch to this byte array.

◆ clear()

void QtopiaPrintBuffer::clear ( )
inline

Definition at line 119 of file qprintengine_qws_p.h.

119 { _data.clear(); }
void clear()
Clears the contents of the byte array and makes it empty.

◆ data()

const QByteArray& QtopiaPrintBuffer::data ( ) const
inline

Definition at line 115 of file qprintengine_qws_p.h.

115 { return _data; }

◆ pad()

void QtopiaPrintBuffer::pad ( )

Definition at line 878 of file qprintengine_qws.cpp.

879 {
880  while ( ( _data.size() % 4 ) != 0 )
881  _data.append( (char)0 );
882 }
QByteArray & append(char c)
Appends the character ch to this byte array.
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

◆ patch()

void QtopiaPrintBuffer::patch ( int  posn,
int  value 
)

Definition at line 863 of file qprintengine_qws.cpp.

864 {
865  if ( _bigEndian ) {
866  _data[posn] = (char)(value >> 24);
867  _data[posn + 1] = (char)(value >> 16);
868  _data[posn + 2] = (char)(value >> 8);
869  _data[posn + 3] = (char)value;
870  } else {
871  _data[posn] = (char)value;
872  _data[posn + 1] = (char)(value >> 8);
873  _data[posn + 2] = (char)(value >> 16);
874  _data[posn + 3] = (char)(value >> 24);
875  }
876 }

◆ size()

int QtopiaPrintBuffer::size ( ) const
inline

Definition at line 117 of file qprintengine_qws_p.h.

117 { return _data.size(); }
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

Properties

◆ _bigEndian

bool QtopiaPrintBuffer::_bigEndian
private

Definition at line 132 of file qprintengine_qws_p.h.

◆ _data

QByteArray QtopiaPrintBuffer::_data
private

Definition at line 131 of file qprintengine_qws_p.h.


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