ByteArrayUtils Class Reference

Utility class to give easy functoins to add / read data with QByteArray (in such way that they are usable on Network). More...

#include <Utils/ByteArrayUtils.h>

List of all members.

Static Public Member Functions

static QString readString (const QByteArray &data, int index=0, int *pNbRead=NULL)
 Reads a string (finished by 0) from data
static QDate readDate (const QByteArray &data, int index=0, int *pNbRead=NULL)
 Reads a date from data
static QDateTime readDateTime (const QByteArray &data, int index=0, int *pNbRead=NULL)
 Reads a date time from data
static QByteArray readData (const QByteArray &data, int index=0, int *pNbRead=NULL)
 Reads data (the size is first read, then the data itself) from data
static int readNumber (const QByteArray &data, int index=0, int *pNbRead=NULL)
 Reads a number from data
static void writeString (QByteArray &data, const QString &stringData)
 Write a string in data
static void writeDate (QByteArray &data, const QDate &dateData)
 Write a data in data
static void writeDateTime (QByteArray &data, const QDateTime &dateTimeData)
 Write a date time in data
static void writeData (QByteArray &data, const QByteArray &dataData)
 Write some data in data
template<typename T >
static void writeNumber (QByteArray &data, const T numberData)
 Write a number in data

Detailed Description

Utility class to give easy functoins to add / read data with QByteArray (in such way that they are usable on Network).


Member Function Documentation

static QByteArray ByteArrayUtils::readData ( const QByteArray &  data,
int  index = 0,
int *  pNbRead = NULL 
) [static]

Reads data (the size is first read, then the data itself) from data

Parameters:
data the source of the data
index the index where to read
pNbRead if not NULL, will containt the number of the byte read
Returns:
the QByteArray read
static QDate ByteArrayUtils::readDate ( const QByteArray &  data,
int  index = 0,
int *  pNbRead = NULL 
) [static]

Reads a date from data

Parameters:
data the source of the data
index the index where to read
pNbRead if not NULL, will containt the number of the byte read
Returns:
the QDate read
static QDateTime ByteArrayUtils::readDateTime ( const QByteArray &  data,
int  index = 0,
int *  pNbRead = NULL 
) [static]

Reads a date time from data

Parameters:
data the source of the data
index the index where to read
pNbRead if not NULL, will containt the number of the byte read
Returns:
the QDateTime read
static int ByteArrayUtils::readNumber ( const QByteArray &  data,
int  index = 0,
int *  pNbRead = NULL 
) [static]

Reads a number from data

Parameters:
data the source of the data
index the index where to read
pNbRead if not NULL, will containt the number of the byte read
Returns:
the number read
static QString ByteArrayUtils::readString ( const QByteArray &  data,
int  index = 0,
int *  pNbRead = NULL 
) [static]

Reads a string (finished by 0) from data

Parameters:
data the source of the data
index the index where to read
pNbRead if not NULL, will containt the number of the byte read
Returns:
the QString read
static void ByteArrayUtils::writeData ( QByteArray &  data,
const QByteArray &  dataData 
) [static]

Write some data in data

Parameters:
data the array where to write
dataData the data to write
static void ByteArrayUtils::writeDate ( QByteArray &  data,
const QDate &  dateData 
) [static]

Write a data in data

Parameters:
data the array where to write
dateData the date to write
static void ByteArrayUtils::writeDateTime ( QByteArray &  data,
const QDateTime &  dateTimeData 
) [static]

Write a date time in data

Parameters:
data the array where to write
dateTimeData the date time to write
template<typename T >
static void ByteArrayUtils::writeNumber ( QByteArray &  data,
const T  numberData 
) [inline, static]

Write a number in data

Parameters:
data the array where to write
numberData the number to write
static void ByteArrayUtils::writeString ( QByteArray &  data,
const QString &  stringData 
) [static]

Write a string in data

Parameters:
data the array where to write
stringData the string to write

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations Properties
Generated on Tue Sep 13 01:45:57 2011 for MedCenter by  doxygen 1.6.3