KDECore
KSycocaFactory Class Reference
#include <ksycocafactory.h>
Public Member Functions | |
virtual void | addEntry (KSycocaEntry *newEntry, const char *resource) |
KSycocaEntry::List | allEntries () |
virtual KSycocaEntry * | createEntry (int offset)=0 |
virtual KSycocaEntry * | createEntry (const QString &file, const char *resource)=0 |
KSycocaEntryDict * | entryDict () |
virtual KSycocaFactoryId | factoryId () const =0 |
int | offset () |
void | removeEntry (KSycocaEntry *newEntry) |
virtual const KSycocaResourceList * | resourceList () const |
virtual void | save (QDataStream &str) |
virtual void | saveHeader (QDataStream &str) |
virtual | ~KSycocaFactory () |
Protected Member Functions | |
KSycocaFactory (KSycocaFactoryId factory_id) | |
virtual void | virtual_hook (int id, void *data) |
Protected Attributes | |
int | m_beginEntryOffset |
int | m_endEntryOffset |
KSycocaEntryDict * | m_entryDict |
KSycocaResourceList * | m_resourceList |
QDataStream * | m_str |
KSycocaDict * | m_sycocaDict |
int | m_sycocaDictOffset |
Related Functions | |
(Note that these are not member functions.) | |
enum | KSycocaFactoryId |
Detailed Description
For internal use only.
Base class for sycoca factories
Definition at line 39 of file ksycocafactory.h.
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.
KSycocaFactory::~KSycocaFactory | ( | ) | [virtual] |
Definition at line 71 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] |
virtual KSycocaFactoryId KSycocaFactory::factoryId | ( | ) | const [pure virtual] |
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.
void KSycocaFactory::virtual_hook | ( | int | id, | |
void * | data | |||
) | [protected, virtual] |
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.
Member Data Documentation
int KSycocaFactory::m_beginEntryOffset [protected] |
Definition at line 123 of file ksycocafactory.h.
int KSycocaFactory::m_endEntryOffset [protected] |
Definition at line 124 of file ksycocafactory.h.
KSycocaEntryDict* KSycocaFactory::m_entryDict [protected] |
Definition at line 128 of file ksycocafactory.h.
KSycocaResourceList* KSycocaFactory::m_resourceList [protected] |
Definition at line 127 of file ksycocafactory.h.
QDataStream* KSycocaFactory::m_str [protected] |
Definition at line 125 of file ksycocafactory.h.
KSycocaDict* KSycocaFactory::m_sycocaDict [protected] |
Definition at line 129 of file ksycocafactory.h.
int KSycocaFactory::m_sycocaDictOffset [protected] |
Definition at line 122 of file ksycocafactory.h.
The documentation for this class was generated from the following files: