#include <storage.h>
Public Member Functions | |
| void | setItem (const QString &, const QString &) |
| void | addItem (const QString &, const QString &) |
| void | removeItem (const QString &, const QString &) |
| void | removeEntry (const QString &) |
| void | setDenomination (const QString &, const QString &, const QString &) |
| void | setRawItem (const QString &, const QString &, const QString &) |
| void | addRawItem (const QString &, const QString &, const QString &) |
| void | removeRawItem (const QString &, const QString &) |
| QString | getItem (const QString &) |
| bool | setID (int) |
| bool | addID (int) |
| bool | delID (int) |
| int | getCurrentID (void) |
| Q3Dict< QString > | getTable (int) |
| Q3Dict< QString > | getCurrentTable (void) |
| Q3Dict< QString > * | getTablePointer (int) |
| Q3Dict< QString > * | getCurrentTablePointer (void) |
| void | merge (Q3PtrList< Q3Dict< QString > >) |
| int | getCount (bool=false) |
| void | addGroup (const QString &, const QString &, const QString &) |
| Q3Dict< Q3Dict< QString > > | getTablePointerCDB (void) |
| Q3PtrList< Q3Dict< QString > > | getTablePointerCDB_DATA (const QString &) |
| Q3PtrList< Q3Dict< QString > > | getTablePointerDATA (void) |
| Q3Dict< QString > | operator[] (int id) |
| QString | operator[] (const QString &key) |
| SaXStorage (void) | |
Protected Attributes | |
| Q3PtrList< Q3Dict< QString > > | mData |
| Q3Dict< Q3Dict< QString > > | mCDB |
| int | mCurrentID |
The SaXStorage class provides all the structures and member functions to store, delete/retrieve and change configuration related information. The internal data structure is based on a list of hashes or a an hash of hashes. The standard data is stored in a dictionary list whereas the special CDB data is stored in a dictionary of dictionaries
#include <sax/sax.h> SaXStorage container; container.setItem ("Identifier","Monitor[0]"); container.setDenomination ("01","Belinea","102030"); container.setRawItem ("RawOption","opt1","val1"); container.addRawItem ("RawOption","opt2","val2"); container.removeRawItem ("RawOption","opt1"); //QDict<QString> section = container.getCurrentTable(); QDict<QString> section = container[0]; QString* data = section.take ("RawOption"); printf ("%s\n",data->ascii()); printf ("%s\n",container["RawOption"].ascii());
Definition at line 129 of file storage.h.
| SaX::SaXStorage::SaXStorage | ( | void | ) |
An object of this type is used to create a storage object saving all the data provided by the interfaces ISAX,SYSP,CDB,PROFILE
Definition at line 29 of file storage.cpp.
| void SaX::SaXStorage::setItem | ( | const QString & | key, | |
| const QString & | val | |||
| ) | [virtual] |
set key value pairs to the current data dictionary reached via mCurrentID
Implements SaX::SaXStorageIF.
Definition at line 43 of file storage.cpp.
Referenced by addItem(), addRawItem(), merge(), removeItem(), removeRawItem(), SaX::SaXManipulateCard::setCardOption(), setDenomination(), SaX::SaXManipulatePointers::setOption(), and setRawItem().
| void SaX::SaXStorage::addItem | ( | const QString & | key, | |
| const QString & | val | |||
| ) | [virtual] |
add a value to the current value of (key) seperated by the comma sign. If there is no data behind (key) nothing will happen
Implements SaX::SaXStorageIF.
Definition at line 55 of file storage.cpp.
References setItem().
Referenced by SaX::SaXManipulateCard::addCardOption(), and SaX::SaXManipulatePointers::addOption().
| void SaX::SaXStorage::removeItem | ( | const QString & | key, | |
| const QString & | val | |||
| ) | [virtual] |
remove the value (val) from the current value list stored behind the key (key). If the value is not found the list won't be changed
Implements SaX::SaXStorageIF.
Definition at line 75 of file storage.cpp.
References setItem().
Referenced by SaX::SaXManipulateCard::removeCardOption(), and SaX::SaXManipulatePointers::removeOption().
| void SaX::SaXStorage::removeEntry | ( | const QString & | key | ) | [virtual] |
remove a complete entry from the data dictionary The entry is searched as key named (key)
Implements SaX::SaXStorageIF.
Definition at line 101 of file storage.cpp.
| void SaX::SaXStorage::setDenomination | ( | const QString & | key, | |
| const QString & | vendor, | |||
| const QString & | name | |||
| ) | [virtual] |
set special item value normaly used for Vendor and Name specifications. The vendor and name string is concatenated using the ";" sign
Implements SaX::SaXStorageIF.
Definition at line 127 of file storage.cpp.
References setItem().
| void SaX::SaXStorage::setRawItem | ( | const QString & | key, | |
| const QString & | optname, | |||
| const QString & | optval | |||
| ) | [virtual] |
set special item value used for options including a value if the key is some sort of Raw* the value behind this key is a comma separated list of key value pairs separated by a space each. This method will set such a value pair
Implements SaX::SaXStorageIF.
Definition at line 142 of file storage.cpp.
References setItem().
Referenced by addRawItem(), SaX::SaXManipulateCard::setCardOption(), and SaX::SaXManipulatePointers::setOption().
| void SaX::SaXStorage::addRawItem | ( | const QString & | key, | |
| const QString & | optname, | |||
| const QString & | optval | |||
| ) | [virtual] |
set special item value used for options including a value if the key is some sort of Raw* the value behind this key is a comma separated list of key value pairs separated by a space each. This method will add such a value pair
Implements SaX::SaXStorageIF.
Definition at line 158 of file storage.cpp.
References setItem(), and setRawItem().
Referenced by SaX::SaXManipulateCard::addCardExternal(), SaX::SaXManipulateCard::addCardExternalOption(), SaX::SaXManipulateCard::addCardOption(), and SaX::SaXManipulatePointers::addOption().
| void SaX::SaXStorage::removeRawItem | ( | const QString & | key, | |
| const QString & | opt | |||
| ) | [virtual] |
set special item value used for options including a value if the key is some sort of Raw* the value behind this key is a comma separated list of key value pairs separated by a space each. This method will remove such a value pair
Implements SaX::SaXStorageIF.
Definition at line 182 of file storage.cpp.
References setItem().
Referenced by SaX::SaXManipulateCard::addCardExternal(), SaX::SaXManipulateCard::addCardExternalOption(), SaX::SaXManipulateCard::removeCardOption(), and SaX::SaXManipulatePointers::removeOption().
| QString SaX::SaXStorage::getItem | ( | const QString & | key | ) | [virtual] |
returns a copy of the value of key refering to the current data record
Implements SaX::SaXStorageIF.
Definition at line 112 of file storage.cpp.
Referenced by SaX::SaXManipulateDesktop::disable3D(), SaX::SaXManipulateDesktop::enable3D(), SaX::SaXManipulateCard::getCardModel(), SaX::SaXManipulateCard::getCardName(), SaX::SaXManipulateCard::getCards(), SaX::SaXManipulateCard::getCardVendor(), SaX::SaXManipulateDesktop::getDualHeadProfile(), SaX::SaXManipulateCard::getHeads(), SaX::SaXManipulateDesktop::is3DCard(), SaX::SaXManipulateDesktop::isDualHeadCard(), SaX::SaXManipulateCard::removeCardOption(), SaX::SaXManipulatePointers::removeOption(), SaX::SaXManipulateTablets::removePad(), and SaX::SaXManipulateTablets::removePen().
| bool SaX::SaXStorage::setID | ( | int | id | ) | [virtual] |
change the current data record ID to the new ID (id) If there is no data for ID (id) an exception is throwed and the current ID won't become changed
Implements SaX::SaXStorageIF.
Definition at line 355 of file storage.cpp.
References SaX::SaXException::errorString(), and SaX::SaXException::excSetStorageIDFailed().
Referenced by merge(), SaX::SaXManipulateDevices::removeInputDevice(), and SaX::SaXManipulateDesktop::selectDesktop().
| bool SaX::SaXStorage::addID | ( | int | id | ) | [virtual] |
add a new data record without gaps. If the record already exists the function will return false otherwise true
Implements SaX::SaXStorageIF.
Definition at line 248 of file storage.cpp.
Referenced by SaX::SaXManipulateDevices::addDesktopDevice(), and merge().
| bool SaX::SaXStorage::delID | ( | int | id | ) | [virtual] |
remove a data record and adapt the Identifier strings to provide consistency
Implements SaX::SaXStorageIF.
Definition at line 268 of file storage.cpp.
Referenced by SaX::SaXManipulateDevices::removeDesktopDevice(), and SaX::SaXManipulateDevices::removeInputDevice().
| int SaX::SaXStorage::getCurrentID | ( | void | ) | [virtual] |
return the current section ID value
Implements SaX::SaXStorageIF.
Definition at line 373 of file storage.cpp.
Referenced by SaX::SaXManipulateDevices::removeInputDevice().
| Q3Dict< QString > SaX::SaXStorage::getTable | ( | int | id | ) | [virtual] |
return a copy of the data dictionary for the given ID (id)
Implements SaX::SaXStorageIF.
Definition at line 383 of file storage.cpp.
| Q3Dict< QString > SaX::SaXStorage::getCurrentTable | ( | void | ) | [virtual] |
return a copy of the data dictionary for the current ID
Implements SaX::SaXStorageIF.
Definition at line 398 of file storage.cpp.
| Q3Dict< QString > * SaX::SaXStorage::getTablePointer | ( | int | id | ) | [virtual] |
return a pointer to the data dictionary at ID (id)
Implements SaX::SaXStorageIF.
Definition at line 408 of file storage.cpp.
Referenced by SaX::SaXManipulateDevices::addInputDevice(), SaX::SaXExport::doExport(), and SaX::SaXManipulateDevices::removeInputDevice().
| Q3Dict< QString > * SaX::SaXStorage::getCurrentTablePointer | ( | void | ) | [virtual] |
return a pointer to the data dictionary at the current ID
Implements SaX::SaXStorageIF.
Definition at line 418 of file storage.cpp.
| void SaX::SaXStorage::merge | ( | Q3PtrList< Q3Dict< QString > > | data | ) | [virtual] |
merge the data records from the list (data) into the corresponding data records of the object. If a record does not exist it will be created
Implements SaX::SaXStorageIF.
Definition at line 225 of file storage.cpp.
References addID(), setID(), and setItem().
| int SaX::SaXStorage::getCount | ( | bool | noEmptyItem = false |
) | [virtual] |
if noEmptyItem is set to true this method will calculate the number of non empty data records. If noEmptyItem is set to false which is the default the method will return the number of elements stored in the mData data record list
Implements SaX::SaXStorageIF.
Definition at line 428 of file storage.cpp.
Referenced by SaX::SaXManipulateDevices::addDesktopDevice(), SaX::SaXManipulateDevices::addInputDevice(), SaX::SaXExport::doExport(), SaX::SaXManipulateCard::getDevices(), SaX::SaXManipulateLayout::getMultiheadMode(), SaX::SaXManipulateDevices::removeDesktopDevice(), and SaX::SaXManipulateDevices::removeInputDevice().
| void SaX::SaXStorage::addGroup | ( | const QString & | group, | |
| const QString & | key, | |||
| const QString & | value | |||
| ) | [virtual] |
A method for the CDB interface only. This function will use (group) as first key and (key) as second key to store the value (value) in a two dimensional data dictionary
Implements SaX::SaXStorageIF.
Definition at line 452 of file storage.cpp.
| Q3Dict< Q3Dict< QString > > SaX::SaXStorage::getTablePointerCDB | ( | void | ) | [virtual] |
A method for the CDB interface only. Return a copy of the two dimensional CDB data dictionary
Implements SaX::SaXStorageIF.
Definition at line 470 of file storage.cpp.
Referenced by SaX::SaXManipulateCard::getCardDrivers(), and SaX::SaXManipulateTablets::getTabletDrivers().
| Q3PtrList< Q3Dict< QString > > SaX::SaXStorage::getTablePointerCDB_DATA | ( | const QString & | group | ) | [virtual] |
A method for the CDB interface only. Returns a pointer to the dictionary found under the key (group). The pointer is appended to a list because in most cases the return value is used as parmeter to the merge() method
Implements SaX::SaXStorageIF.
Definition at line 481 of file storage.cpp.
| Q3PtrList< Q3Dict< QString > > SaX::SaXStorage::getTablePointerDATA | ( | void | ) | [virtual] |
return a pointer list of the complete data dictionary including all ISAX data records
Implements SaX::SaXStorageIF.
Definition at line 500 of file storage.cpp.
1.5.5