• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

KDECore

KSycocaFactory Class Reference

#include <ksycocafactory.h>

Inheritance diagram for KSycocaFactory:

Inheritance graph
[legend]

List of all members.


Detailed Description

Definition at line 37 of file ksycocafactory.h.


Public Member Functions

virtual void addEntry (const KSycocaEntry::Ptr &newEntry)
virtual KSycocaEntry::List allEntries () const
virtual KSycocaEntry * createEntry (int offset) const =0
virtual KSycocaEntry * createEntry (const QString &file, const char *resource) const =0
KSycocaEntryDict * entryDict ()
virtual KSycocaFactoryId factoryId () const =0
bool isEmpty () const
int offset () const
void removeEntry (const QString &entryName)
const KSycocaResourceList * resourceList () const
virtual void save (QDataStream &str)
virtual void saveHeader (QDataStream &str)
const KSycocaDict * sycocaDict () const
virtual ~KSycocaFactory ()

Protected Member Functions

 KSycocaFactory (KSycocaFactoryId factory_id)
virtual void virtual_hook (int id, void *data)

Protected Attributes

KSycocaEntryDict * m_entryDict
KSycocaResourceList * m_resourceList
QDataStream * m_str

Related Functions

(Note that these are not member functions.)

enum  KSycocaFactoryId

Constructor & Destructor Documentation

KSycocaFactory::KSycocaFactory ( KSycocaFactoryId  factory_id  )  [explicit, protected]

Create a factory which can be used to lookup from/create a database (depending on KSycoca::isBuilding()).

Definition at line 47 of file ksycocafactory.cpp.

KSycocaFactory::~KSycocaFactory (  )  [virtual]

Definition at line 80 of file ksycocafactory.cpp.


Member Function Documentation

void KSycocaFactory::addEntry ( const KSycocaEntry::Ptr &  newEntry  )  [virtual]

Add an entry.

Definition at line 146 of file ksycocafactory.cpp.

KSycocaEntry::List KSycocaFactory::allEntries (  )  const [virtual]

Get a list of all entries from the database.

Definition at line 174 of file ksycocafactory.cpp.

virtual KSycocaEntry* KSycocaFactory::createEntry ( int  offset  )  const [pure virtual]

Read an entry from the database.

Implemented in KMimeTypeFactory, KServiceFactory, KServiceGroupFactory, KServiceTypeFactory, and KProtocolInfoFactory.

virtual KSycocaEntry* KSycocaFactory::createEntry ( const QString &  file,
const char *  resource 
) const [pure virtual]

Construct an entry from a config file.

To be implemented in the real factories.

Implemented in KMimeTypeFactory, KServiceFactory, KServiceGroupFactory, KServiceTypeFactory, and KProtocolInfoFactory.

KSycocaEntryDict* KSycocaFactory::entryDict (  )  [inline]

Returns:
the dict, for special use by KBuildSycoca

Definition at line 60 of file ksycocafactory.h.

virtual KSycocaFactoryId KSycocaFactory::factoryId (  )  const [pure virtual]

bool KSycocaFactory::isEmpty (  )  const

Returns:
true if the factory is completely empty - no entries defined

Definition at line 225 of file ksycocafactory.cpp.

int KSycocaFactory::offset (  )  const

Returns:
the position of the factory in the sycoca file

Definition at line 210 of file ksycocafactory.cpp.

void KSycocaFactory::removeEntry ( const QString &  entryName  ) 

Remove all entries with the given name.

Not very fast (O(N)), use with care.

Definition at line 163 of file ksycocafactory.cpp.

const KSycocaResourceList * KSycocaFactory::resourceList (  )  const

Returns:
the resources for which this factory is responsible.

Definition at line 215 of file ksycocafactory.cpp.

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 97 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 87 of file ksycocafactory.cpp.

const KSycocaDict * KSycocaFactory::sycocaDict (  )  const

Returns:
the sycoca dict, for factories to find entries by name.

Definition at line 220 of file ksycocafactory.cpp.

void KSycocaFactory::virtual_hook ( int  id,
void *  data 
) [protected, virtual]

Virtual hook, used to add new "virtual" functions while maintaining binary compatibility.

Unused in this class.

Reimplemented in KMimeTypeFactory, KServiceFactory, KServiceGroupFactory, KServiceTypeFactory, and KProtocolInfoFactory.

Definition at line 230 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 44 of file ksycocatype.h.


Member Data Documentation

KSycocaEntryDict* KSycocaFactory::m_entryDict [protected]

Definition at line 131 of file ksycocafactory.h.

KSycocaResourceList* KSycocaFactory::m_resourceList [protected]

Definition at line 130 of file ksycocafactory.h.

QDataStream* KSycocaFactory::m_str [protected]

Definition at line 128 of file ksycocafactory.h.


The documentation for this class was generated from the following files:
  • ksycocafactory.h
  • ksycocatype.h
  • ksycocafactory.cpp

KDECore

Skip menu "KDECore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal