The Fib multimedia system
Fib is a system for storing multimedia data (like images or films).
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
fib::cOptionalPart Class Reference

#include <cOptionalPart.h>

Collaboration diagram for fib::cOptionalPart:

List of all members.

Public Member Functions

unsignedLongFib getNumberOfEntries () const
pair< string, string > getEntry (unsignedLongFib ulEntryNumber) const
list< pair< string, string > > getEntries (string szKey, bool bFullBegin=true) const
list< pair< string, string > > findKeyPart (string szKeyPart) const
unsignedLongFib addEntry (string szKey, string szValue, unsignedLongFib ulPosition=0)
bool deleteEntry (unsignedLongFib ulEntryNumber)
unsignedLongFib deleteEntries (string szKey, bool bFullBegin=true)
virtual bool storeXml (ostream &ostream) const
virtual intFib restoreXml (const TiXmlElement *pXmlElement)
virtual unsignedLongFib getCompressedSize () const
virtual bool store (ostream &stream) const
virtual intFib restore (cReadBits &iBitStream, const unsigned long ulBytsToRead=0)
virtual bool setCompressionType (unsignedIntFib uiInCompressionType=1)
virtual bool equal (const cOptionalPart &optionalPart) const
virtual bool operator== (const cOptionalPart &optionalPart) const

Protected Member Functions

 cOptionalPart ()
virtual ~cOptionalPart ()
virtual cOptionalPartclone () const
virtual bool actualizeCompressData () const

Protected Attributes

list< pair< string, string > > optionalInformation
unsigned long ulVersion
unsignedIntFib uiCompressionType
char * pCompressedData
size_t uiCompressedDataSize
unsigned long ulCompressedDataVersion

Friends

class cRoot

Detailed Description

Definition at line 65 of file cOptionalPart.h.


Constructor & Destructor Documentation

fib::cOptionalPart::cOptionalPart ( )
protected

The constructor for the optionalpart.

virtual fib::cOptionalPart::~cOptionalPart ( )
protectedvirtual

The destructor for the optionalpart.


Member Function Documentation

virtual bool fib::cOptionalPart::actualizeCompressData ( ) const
protectedvirtual

This method actualize the compressed data of this optional part. After it was performed successful

See also:
ulCompressedDataVersion and
ulVersion will be equal and pCompressedData will contain the data of this optional part.
store()
restore()
getCompressedSize()
uiCompressionType
setCompressionType()
Returns:
true if pCompressedData contains the actual data of this optional part, else false
unsignedLongFib fib::cOptionalPart::addEntry ( string  szKey,
string  szValue,
unsignedLongFib  ulPosition = 0 
)

This method ads the given key szKey and value szValue pair to the optionalpart list.

Parameters:
szKeythe key of the entry to add
szValuethe value of the entry to add
ulPositionthe position on which in the optional part list the new entry should be added (counting begins with 1); the standardvalue is 0 to add the entry on the end of the list
Returns:
the position wher the new entry was added to the optional part list (counting begins with 1)
virtual cOptionalPart* fib::cOptionalPart::clone ( ) const
protectedvirtual

This Method clones this object.

Returns:
a clone of this object
unsignedLongFib fib::cOptionalPart::deleteEntries ( string  szKey,
bool  bFullBegin = true 
)

This method deletes all entries which have the given key szKey as ther full key (if bFullBegin=true) or as the begining of ther key (if bFullBegin=false) .

Parameters:
szKeythe key for which the entries are to delete
bFullBeginif true (the standardvalue) the given key szKey is the complete key to be found, else the key szKey is just the beginning of the key to be found
Returns:
the number of deleted entries
bool fib::cOptionalPart::deleteEntry ( unsignedLongFib  ulEntryNumber)

This method deletes the ulEntryNumber'th entry of the optional part list.

Parameters:
ulEntryNumberthe number of the entry in the optional list of the entry to delete (counting begins with 1)
Returns:
true if the entry was deleted, else false
virtual bool fib::cOptionalPart::equal ( const cOptionalPart optionalPart) const
virtual

This Method checks if the given optionalpart is equal to this optionalpart. Two optionalpart are equal, if they have the same entries in the same order.

Parameters:
optionalPartthe optionalpart to compare with this
Returns:
true if the given optionalpart is equal to this optionalpart, else false
list< pair<string,string> > fib::cOptionalPart::findKeyPart ( string  szKeyPart) const

This method returns all entries which have the given szKeyPart as an part of ther key.

Parameters:
szKeyPartthe part of the keys for which the entries are to be return
Returns:
a list with the key -value -pairs with szKeyPart as part of ther key; the returned pairs are an (key, value) -pairs
virtual unsignedLongFib fib::cOptionalPart::getCompressedSize ( ) const
virtual

This method evaluades the size of the optionalpart in bits in the compressed file form.

See also:
store()
restore()
setCompressionType()
uiCompressionType
actualizeCompressData()
cFibElement::getCompressedSize()
Returns:
the size of the optionalpart in bits in the compressed form
list< pair<string,string> > fib::cOptionalPart::getEntries ( string  szKey,
bool  bFullBegin = true 
) const

This method returns all entries which have the given key szKey as ther full key (if bFullBegin=true) or as the begining of ther key (if bFullBegin=false) .

Parameters:
szKeythe key for which the entries are to return
bFullBeginif true (the standardvalue) the given key szKey is the complete key to be found, else the key szKey is just the beginning of the key to be found
Returns:
a list with the key -value -pairs for the given key szKey; the returned pairs are an (key, value) -pairs
pair< string, string > fib::cOptionalPart::getEntry ( unsignedLongFib  ulEntryNumber) const

This method returns the ulEntryNumber'th entry of the optional part list. If ther is no ulEntryNumber'th entry a pair with two empty strings is returend;

Parameters:
ulEntryNumberthe number of the entry in the optional list of the entry to return (counting begins with 1)
Returns:
the ulEntryNumber'th entry of the optional part list or a pair with to empty strings if an ulEntryNumber'th entry dosn't exists; the returned pair is an (key, value) -pair
unsignedLongFib fib::cOptionalPart::getNumberOfEntries ( ) const
Returns:
returns the number of entries in the optional part
virtual bool fib::cOptionalPart::operator== ( const cOptionalPart optionalPart) const
virtual

This Method checks if the given optionalpart is equal to this optionalpart. Two optionalpart are equal, if they have the same entries in the same order.

Parameters:
optionalPartthe optionalpart to compare with this
Returns:
true if the given optionalpart is equal to this optionalpart, else false
virtual intFib fib::cOptionalPart::restore ( cReadBits iBitStream,
const unsigned long  ulBytsToRead = 0 
)
virtual

This method restores the optionalpart from a bitstream, wher it is stored in the compressed fib-format with the set compression type.

See also:
store()
setCompressionType()
uiCompressionType
actualizeCompressData()
cFibElement::store()
Parameters:
iBitStreamthe stream where this optionalpart is stored to in, because this stream is an cReadBits, any number of bits can be readed from it
ulBytsToReadthe nuber of byts the optional part is long, if 0 (defaultvalue) it will be read till the end of the stream is reached
Returns:
the errorvalue possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid stream
  • -2 loading error, invalid data in stream
  • 1 loading warning, invalid data in stream, error could be corrected
  • 2 loading warning, invalid data in stream, maybe the loaded object is wrong
virtual intFib fib::cOptionalPart::restoreXml ( const TiXmlElement *  pXmlElement)
virtual

This method restores this optionalpart in the XML-format from an an TinyXml element.

Parameters:
pXmlNodea pointer to the TinyXml node wher the optionalpart is stored in
Returns:
an integervalue with the errorvalue possible errorvalues are:
  • 0 loading successful
  • -1 loading error, invalid pXmlElement
  • -2 loading error, invalid data in pXmlElement
  • 1 loading warning, invalid data in pXmlElement, error could be corrected
  • 2 loading warning, invalid data in pXmlElement, maybe the loaded object is wrong
virtual bool fib::cOptionalPart::setCompressionType ( unsignedIntFib  uiInCompressionType = 1)
virtual

This method sets the compression type of the optional part for compressed storing. Possible typs are: 0: no compression 1: The data is compressed in the zlib format. This is a Warper (documented in RFC 1950) for a deflate stream (lossless data compression, documented in RFC 1951).

See also:
uiCompressionType
store()
restore()
getCompressedSize()
actualizeCompressData()
Parameters:
uiInCompressionTypethe compression type to set, standard value is 1 fo zlib compression
Returns:
true if the compression type could be set
virtual bool fib::cOptionalPart::store ( ostream &  stream) const
virtual

This method stores this optionalpart in the compressed fib-format (with the deflate -algorithmus) into the given stream.

See also:
restore()
setCompressionType()
uiCompressionType
actualizeCompressData()
cFibElement::store()
Parameters:
streamthe stream where this optionalpart should be stored to
Returns:
true if the optionalpart are stored, else false
virtual bool fib::cOptionalPart::storeXml ( ostream &  ostream) const
virtual

This method stores this optionalpart in the XML -format into the given stream. example: <optionalpart> <pair key="copyright" value="GNU GPL 3"> <pair key="type" value="die Berliner Mauer"> </optionalpart>

Parameters:
ostreamthe stream where this optionalpart should be stored to
Returns:
true if this optionalpart is stored, else false

Friends And Related Function Documentation

friend class cRoot
friend

Definition at line 67 of file cOptionalPart.h.


Member Data Documentation

list< pair<string,string> > fib::cOptionalPart::optionalInformation
protected

the list with the key -value -pairs of optional information

Definition at line 75 of file cOptionalPart.h.

char* fib::cOptionalPart::pCompressedData
mutableprotected

The compressed data of this optional part version

See also:
ulCompressedDataVersion. If ulCompressedDataVersion and
ulVersion are equal the compressed data is actual and can be used.

Definition at line 101 of file cOptionalPart.h.

size_t fib::cOptionalPart::uiCompressedDataSize
mutableprotected

The size in byts of the compressed data

See also:
pCompressedData of this optional part.

Definition at line 107 of file cOptionalPart.h.

unsignedIntFib fib::cOptionalPart::uiCompressionType
protected

The type of the compression. Possible typs are: 0: no compression 1: The data is compressed in the zlib format. This is a Warper (documented in RFC 1950) for a deflate stream (lossless data compression, documented in RFC 1951).

Definition at line 92 of file cOptionalPart.h.

unsigned long fib::cOptionalPart::ulCompressedDataVersion
mutableprotected

The version number of the compressed data

See also:
pCompressedData of this optional part. If ulCompressedDataVersion and
ulVersion are equal the compressed data is actual and can be used.

Definition at line 115 of file cOptionalPart.h.

unsigned long fib::cOptionalPart::ulVersion
protected

This number will be increased with each update. With it, it can be checked if this optional part is changed.

Definition at line 82 of file cOptionalPart.h.


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