gui::QSStream Class Reference

QObject wrapper around CStream. More...

#include <qsstream.h>

Inheritance diagram for gui::QSStream:
gui::QSIProperty gui::QSCObject

List of all members.

Public Slots

void setBuffer (const QByteArray &a)
void setBuffer (const QString &s)
void setRawBuffer (const QByteArray &a)
void setRawBuffer (const QString &s)
bool loadBuffer (const QString &fileName)
bool loadRawBuffer (const QString &fileName)
QString getBufferString ()
QByteArray getBuffer ()
bool saveBuffer (const QString &fileName)
QString getDecoded ()
QByteArray getRawDecoded ()
void add (const QString &name, QSIProperty *ip)
void add (const QString &name, QObject *ip)
void add (const QString &name, const QString &ip)
void add (const QString &name, int ip)
int count ()
void delProperty (const QString &name)
bool exist (const QString &name)
QSCObjectproperty (const QString &name)
QStringList propertyNames ()

Public Member Functions

 QSStream (boost::shared_ptr< CStream > _cs, BaseCore *_base)
virtual ~QSStream ()

Static Public Member Functions

static bool loadFile (const QString &fileName, QByteArray &qb)
static QByteArray arrayFromBuffer (const CStream::Buffer &b)
static const CStream::Buffer arrayToBuffer (const QByteArray &a)
static const CStream::Buffer stringToBuffer (const QString &s)
static QString stringFromBuffer (const CStream::Buffer &b)

Detailed Description

QObject wrapper around CStream.


Constructor & Destructor Documentation

gui::QSStream::QSStream ( boost::shared_ptr< CStream _cs,
BaseCore _base 
)

Construct wrapper with given CStream

Parameters:
_cs CStream shared pointer
_base scripting base
gui::QSStream::~QSStream (  )  [virtual]

destructor


Member Function Documentation

void gui::QSStream::add ( const QString &  name,
int  ip 
) [slot]

Add integer to stream dictionary as property

Parameters:
name Property name
ip integer to add

References util::convertFromUnicode(), OP_BEGIN, OP_END, util::PDF, pdfobjects::pName, and property().

void gui::QSStream::add ( const QString &  name,
const QString &  ip 
) [slot]

Add string to stream dictionary as property

Parameters:
name Property name
ip string to add

References util::convertFromUnicode(), OP_BEGIN, OP_END, util::PDF, pdfobjects::pName, and property().

void gui::QSStream::add ( const QString &  name,
QObject *  ip 
) [slot]

Add property to stream dictionary

Parameters:
name Property name
ip Property to add

References add().

void gui::QSStream::add ( const QString &  name,
QSIProperty ip 
) [slot]

Add property to stream dictionary

Parameters:
name Property name
ip Property to add

References util::convertFromUnicode(), gui::QSIProperty::get(), OP_BEGIN, OP_END, util::PDF, and pdfobjects::pName.

Referenced by add().

QByteArray gui::QSStream::arrayFromBuffer ( const CStream::Buffer b  )  [static]

Convert CStream::Buffer (basically vector of chars) to QByteArray

Parameters:
b Buffer used as input
Returns:
Array with characters from buffer

Referenced by getBuffer(), and saveBuffer().

const CStream::Buffer gui::QSStream::arrayToBuffer ( const QByteArray &  a  )  [static]

Convert QByteArray to CStream::Buffer (basically vector of chars)

Parameters:
a QByteArray used as input
Returns:
Buffer with characters from array

Referenced by loadBuffer(), loadRawBuffer(), setBuffer(), and setRawBuffer().

int gui::QSStream::count (  )  [slot]
void gui::QSStream::delProperty ( const QString &  name  )  [slot]

Delete property from stream dictionary

Parameters:
name Property name

References util::convertFromUnicode(), OP_BEGIN, OP_END, util::PDF, and pdfobjects::pName.

bool gui::QSStream::exist ( const QString &  name  )  [slot]

Check if given property exists in stream dictionary

Parameters:
name Name of property
Returns:
True, if property exists in stream dictionary, false if not

References pdfobjects::CStream::containsProperty(), util::convertFromUnicode(), gui::QSIProperty::obj, and util::PDF.

QByteArray gui::QSStream::getBuffer (  )  [slot]

Return data from buffer

Returns:
buffer as QByteArray

References arrayFromBuffer(), pdfobjects::CStream::getBuffer(), and gui::QSIProperty::obj.

QString gui::QSStream::getBufferString (  )  [slot]

Return data from buffer

Returns:
buffer as QString

References pdfobjects::CStream::getBuffer(), gui::QSIProperty::obj, and stringFromBuffer().

QString gui::QSStream::getDecoded (  )  [slot]

Call CStream::getDecodedStringRepresentation(ret); return ret (as unicode)

References util::convertToUnicode(), OP_BEGIN, OP_END, and util::PDF.

QByteArray gui::QSStream::getRawDecoded (  )  [slot]

Call CStream::getDecodedStringRepresentation(ret); return ret (as raw bytes)

References OP_BEGIN, and OP_END.

bool gui::QSStream::loadBuffer ( const QString &  fileName  )  [slot]

Load buffer from contents of given file

Parameters:
fileName name of the file
Returns:
true on success, false on failure while reading from file

References arrayToBuffer(), loadFile(), OP_BEGIN, and OP_END.

bool gui::QSStream::loadFile ( const QString &  fileName,
QByteArray &  qb 
) [static]

Load contents of given file into specified QByteArray

Parameters:
fileName name of the file
qb [out] QByteArray into which the file will be loaded
Returns:
true on success, false on failure while reading from file

Referenced by loadBuffer(), and loadRawBuffer().

bool gui::QSStream::loadRawBuffer ( const QString &  fileName  )  [slot]

Load raw buffer from contents of given file

Parameters:
fileName name of the file
Returns:
true on success, false on failure while reading from file

References arrayToBuffer(), loadFile(), OP_BEGIN, and OP_END.

QSCObject * gui::QSStream::property ( const QString &  name  )  [slot]

Get property by its name

Parameters:
name Name of property
Returns:
the property, or NULL if not found

References gui::QSCObject::base, util::convertFromUnicode(), gui::QSImporter::createQSObject(), pdfobjects::CStream::getProperty(), gui::QSIProperty::obj, and util::PDF.

Referenced by add().

QStringList gui::QSStream::propertyNames (  )  [slot]

Return list of all property names in stream dictionary

Returns:
List of all property names

References util::convertToUnicode(), pdfobjects::CStream::getAllPropertyNames(), gui::QSIProperty::obj, and util::PDF.

bool gui::QSStream::saveBuffer ( const QString &  fileName  )  [slot]

Save contents of buffer to given file

Parameters:
fileName name of the file
Returns:
true on success, false on failure while writing to file

References arrayFromBuffer(), pdfobjects::CStream::getBuffer(), and gui::QSIProperty::obj.

void gui::QSStream::setBuffer ( const QString &  s  )  [slot]

Set buffer from given string

Parameters:
s Data to set into buffer

References OP_BEGIN, OP_END, and stringToBuffer().

void gui::QSStream::setBuffer ( const QByteArray &  a  )  [slot]

Set buffer from given byte array

Parameters:
a Data to set into buffer

References arrayToBuffer(), OP_BEGIN, and OP_END.

void gui::QSStream::setRawBuffer ( const QString &  s  )  [slot]

Set raw buffer from given string

Parameters:
s Data to set into buffer

References OP_BEGIN, OP_END, and stringToBuffer().

void gui::QSStream::setRawBuffer ( const QByteArray &  a  )  [slot]

Set raw buffer from given byte array

Parameters:
a Data to set into buffer

References arrayToBuffer(), OP_BEGIN, and OP_END.

QString gui::QSStream::stringFromBuffer ( const CStream::Buffer b  )  [static]

Convert CStream::Buffer (basically vector of chars) to QString (unicode string) characters 0-255 are mapped to unicode characters with code 0-255

See also:
stringToBuffer
Parameters:
b Buffer used as input
Returns:
QString with characters from buffer

Referenced by getBufferString().

const CStream::Buffer gui::QSStream::stringToBuffer ( const QString &  s  )  [static]

Convert QString (unicode string) to CStream::Buffer (basically vector of chars) unicode characters 0-255 are mapped to characters with code 0-255 Mapping of characters outside of range 0-255 is undefined

See also:
stringFromBuffer
Parameters:
s QString used as input
Returns:
Buffer with characters from string

Referenced by setBuffer(), and setRawBuffer().


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