KSycocaFactory Class Reference
Inheritance diagram for KSycocaFactory:

Detailed Description
Definition at line 39 of file ksycocafactory.h.
Public Member Functions | |
virtual KSycocaFactoryId | factoryId () const =0 |
virtual | ~KSycocaFactory () |
int | offset () |
KSycocaEntryDict * | entryDict () |
virtual KSycocaEntry * | createEntry (const QString &file, const char *resource)=0 |
virtual void | addEntry (KSycocaEntry *newEntry, const char *resource) |
void | removeEntry (KSycocaEntry *newEntry) |
virtual KSycocaEntry * | createEntry (int offset)=0 |
KSycocaEntry::List | allEntries () |
virtual void | save (QDataStream &str) |
virtual void | saveHeader (QDataStream &str) |
virtual const KSycocaResourceList * | resourceList () const |
Protected Member Functions | |
KSycocaFactory (KSycocaFactoryId factory_id) | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
int | m_sycocaDictOffset |
int | m_beginEntryOffset |
int | m_endEntryOffset |
QDataStream * | m_str |
KSycocaResourceList * | m_resourceList |
KSycocaEntryDict * | m_entryDict |
KSycocaDict * | m_sycocaDict |
Related Functions | |
(Note that these are not member functions.) | |
enum | KSycocaFactoryId { KST_KServiceFactory = 1, KST_KServiceTypeFactory = 2, KST_KServiceGroupFactory = 3, KST_KImageIO = 4, KST_KProtocolInfoFactory = 5, KST_CTimeInfo = 100 } |
KST_KServiceFactory = 1 | |
KST_KServiceTypeFactory = 2 | |
KST_KServiceGroupFactory = 3 | |
KST_KImageIO = 4 | |
KST_KProtocolInfoFactory = 5 | |
KST_CTimeInfo = 100 |
Constructor & Destructor Documentation
KSycocaFactory::KSycocaFactory | ( | KSycocaFactoryId | factory_id | ) | [protected] |
Create a factory which can be used to lookup from/create a database (depending on KSycoca::isBuilding()).
Definition at line 31 of file ksycocafactory.cpp.
Member Function Documentation
void KSycocaFactory::addEntry | ( | KSycocaEntry * | newEntry, | |
const char * | resource | |||
) | [virtual] |
KSycocaEntry::List KSycocaFactory::allEntries | ( | ) |
virtual KSycocaEntry* KSycocaFactory::createEntry | ( | int | offset | ) | [pure virtual] |
virtual KSycocaEntry* KSycocaFactory::createEntry | ( | const QString & | file, | |
const char * | resource | |||
) | [pure virtual] |
Construct an entry from a config file.
To be implemented in the real factories.
Implemented in KProtocolInfoFactory.
KSycocaEntryDict* KSycocaFactory::entryDict | ( | ) | [inline] |
int KSycocaFactory::offset | ( | ) | [inline] |
- Returns:
- the position of the factory in the sycoca file
Definition at line 57 of file ksycocafactory.h.
void KSycocaFactory::removeEntry | ( | KSycocaEntry * | newEntry | ) |
Remove an entry Not very fast, use with care.
O(N)
Definition at line 153 of file ksycocafactory.cpp.
virtual const KSycocaResourceList* KSycocaFactory::resourceList | ( | ) | const [inline, virtual] |
- Returns:
- the resources for which this factory is responsible.
Definition at line 116 of file ksycocafactory.h.
void KSycocaFactory::save | ( | QDataStream & | str | ) | [virtual] |
Saves all entries it maintains as well as index files for these entries to the stream 'str'.
Also sets mOffset to the starting position.
The stream is positioned at the end of the last index.
Don't forget to call the parent first when you override this function.
Definition at line 88 of file ksycocafactory.cpp.
void KSycocaFactory::saveHeader | ( | QDataStream & | str | ) | [virtual] |
Writes out a header to the stream 'str'.
The baseclass positions the stream correctly.
Don't forget to call the parent first when you override this function.
Definition at line 78 of file ksycocafactory.cpp.
Friends And Related Function Documentation
enum KSycocaFactoryId [related] |
A KSycocaFactoryId is a code (out of the KSycocaFactoryId enum) assigned to each class type derived from KSycocaFactory. To use it, call the macro K_SYCOCAFACTORY( your_factory_id ) at the top of your class definition.
Definition at line 50 of file ksycocatype.h.
The documentation for this class was generated from the following files: