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

KDECore

Public Member Functions | Protected Member Functions | Protected Attributes | Related Functions | List of all members
KSycocaFactory Class Referenceabstract

#include <ksycocafactory.h>

Inheritance diagram for KSycocaFactory:
Inheritance graph
[legend]

Public Member Functions

virtual ~KSycocaFactory ()
 
virtual void addEntry (const KSycocaEntry::Ptr &newEntry)
 
virtual KSycocaEntry::List allEntries () const
 
virtual KSycocaEntry * createEntry (const QString &file, const char *resource) const =0
 
virtual KSycocaEntry * createEntry (int offset) 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
 

Protected Member Functions

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

Protected Attributes

KSycocaEntryDict * m_entryDict
 
KSycocaResourceList * m_resourceList
 

Related Functions

(Note that these are not member functions.)

enum  KSycocaFactoryId
 

Detailed Description

Base class for sycoca factories

Definition at line 36 of file ksycocafactory.h.

Constructor & Destructor Documentation

KSycocaFactory::KSycocaFactory ( KSycocaFactoryId  factory_id)
explicitprotected

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

Definition at line 50 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 183 of file ksycocafactory.cpp.

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 KProtocolInfoFactory, KServiceTypeFactory, KServiceFactory, KMimeTypeFactory, and KServiceGroupFactory.

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

Read an entry from the database.

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

KSycocaEntryDict* KSycocaFactory::entryDict ( )
inline
Returns
the dict, for special use by KBuildSycoca

Definition at line 59 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 236 of file ksycocafactory.cpp.

int KSycocaFactory::offset ( ) const
Returns
the position of the factory in the sycoca file

Definition at line 221 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 172 of file ksycocafactory.cpp.

const KSycocaResourceList * KSycocaFactory::resourceList ( ) const
Returns
the resources for which this factory is responsible.

to kbuildsycoca

Definition at line 226 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.

QDataStream * KSycocaFactory::stream ( ) const
protected

Definition at line 241 of file ksycocafactory.cpp.

const KSycocaDict * KSycocaFactory::sycocaDict ( ) const
Returns
the sycoca dict, for factories to find entries by name.

Definition at line 231 of file ksycocafactory.cpp.

void KSycocaFactory::virtual_hook ( int  id,
void *  data 
)
protectedvirtual

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

Unused in this class.

Reimplemented in KServiceFactory, KProtocolInfoFactory, KServiceTypeFactory, and KServiceGroupFactory.

Definition at line 246 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 130 of file ksycocafactory.h.

KSycocaResourceList* KSycocaFactory::m_resourceList
protected

Definition at line 129 of file ksycocafactory.h.


The documentation for this class was generated from the following files:
  • ksycocafactory.h
  • ksycocafactory.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:47:11 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal