#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) |
| QDict< QString > | getTable (int) |
| QDict< QString > | getCurrentTable (void) |
| QDict< QString > * | getTablePointer (int) |
| QDict< QString > * | getCurrentTablePointer (void) |
| void | merge (QList< QDict< QString > >) |
| int | getCount (bool=false) |
| void | addGroup (const QString &, const QString &, const QString &) |
| QDict< QDict< QString > > | getTablePointerCDB (void) |
| QList< QDict< QString > > | getTablePointerCDB_DATA (const QString &) |
| QList< QDict< QString > > | getTablePointerDATA (void) |
| QDict< QString > | operator[] (int id) |
| QString | operator[] (const QString &key) |
| SaXStorage (void) | |
Protected Attributes | |
| QList< QDict< QString > > | mData |
| QDict< QDict< 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 27 of file storage.cpp.
References mCurrentID, and mData.
| 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 40 of file storage.cpp.
References mCurrentID, and mData.
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 52 of file storage.cpp.
References mCurrentID, mData, and 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 72 of file storage.cpp.
References mCurrentID, mData, and 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 98 of file storage.cpp.
References mCurrentID, and mData.
| 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 123 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 138 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 154 of file storage.cpp.
References mCurrentID, mData, 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 178 of file storage.cpp.
References mCurrentID, mData, and 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 109 of file storage.cpp.
References mCurrentID, mData, and operator[]().
Referenced by SaX::SaXManipulateDesktop::disable3D(), SaX::SaXManipulateDesktop::enable3D(), SaX::SaXManipulateCard::getCardModel(), SaX::SaXManipulateCard::getCardName(), SaX::SaXManipulateCard::getCards(), SaX::SaXManipulateCard::getCardVendor(), SaX::SaXManipulateDesktop::getDualHeadProfile(), SaX::SaXManipulateDesktop::getFBKernelMode(), SaX::SaXManipulateCard::getHeads(), SaX::SaXManipulateDesktop::is3DCard(), SaX::SaXManipulateDesktop::isDualHeadCard(), operator[](), 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 351 of file storage.cpp.
References SaX::SaXException::errorString(), SaX::SaXException::excSetStorageIDFailed(), mCurrentID, and mData.
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 244 of file storage.cpp.
References mCurrentID, and mData.
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 264 of file storage.cpp.
References mData.
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 369 of file storage.cpp.
References mCurrentID.
Referenced by SaX::SaXManipulateDevices::removeInputDevice().
| QDict< 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 379 of file storage.cpp.
References mData.
Referenced by operator[]().
| QDict< QString > SaX::SaXStorage::getCurrentTable | ( | void | ) | [virtual] |
return a copy of the data dictionary for the current ID
Implements SaX::SaXStorageIF.
Definition at line 393 of file storage.cpp.
References mCurrentID, and mData.
| QDict< QString > * SaX::SaXStorage::getTablePointer | ( | int | id | ) | [virtual] |
return a pointer to the data dictionary at ID (id)
Implements SaX::SaXStorageIF.
Definition at line 403 of file storage.cpp.
References mData.
Referenced by SaX::SaXManipulateDevices::addInputDevice(), SaX::SaXExport::doExport(), and SaX::SaXManipulateDevices::removeInputDevice().
| QDict< QString > * SaX::SaXStorage::getCurrentTablePointer | ( | void | ) | [virtual] |
return a pointer to the data dictionary at the current ID
Implements SaX::SaXStorageIF.
Definition at line 413 of file storage.cpp.
References mCurrentID, and mData.
| void SaX::SaXStorage::merge | ( | QList< QDict< 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 221 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 423 of file storage.cpp.
References mData.
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 447 of file storage.cpp.
References mCDB.
| QDict< QDict< 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 465 of file storage.cpp.
References mCDB.
Referenced by SaX::SaXManipulateCard::getCardDrivers(), and SaX::SaXManipulateTablets::getTabletDrivers().
| QList< QDict< 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 476 of file storage.cpp.
References mCDB.
| QList< QDict< 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 495 of file storage.cpp.
References mData.
1.5.3