# class KSycocaFactory

### abstract

Module | kdecore
Namespace |
Class | KSycocaFactory
Inherits |

Internal Base class for sycoca factories

### methods

- KSycocaFactory (factory_id)

  returns ctor
  KDE 4.1.0 and later only

  Argument | Type | Default
  --- | --- | ---
  factory_id | KSycocaFactoryId |

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

- KSycocaFactory (a0)

  returns ctor
  before KDE 4.1.0 only

  Argument | Type | Default
  --- | --- | ---
  a0 | KSycocaFactoryId |

- addEntry (newEntry)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  newEntry | KSycocaEntry.Ptr |

  Add an entry

- allEntries ( )

  returns KSycocaEntry.List

  Get a list of all entries from the database.

- createEntry (file, resource)

  returns KSycocaEntry
  pure virtual

  Argument | Type | Default
  --- | --- | ---
  file | QString |
  resource | char |

  Construct an entry from a config file. To be implemented in the real factories.

- createEntry (offset)

  returns KSycocaEntry
  pure virtual

  Argument | Type | Default
  --- | --- | ---
  offset | int |

  Read an entry from the database

- entryDict ( )

  returns KSycocaEntryDict
  Not implemented

  Returns the dict, for special use by KBuildSycoca

- factoryId ( )

  returns KSycocaFactoryId
  pure virtual

- isEmpty ( )

  returns bool

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

- offset ( )

  returns int

  Returns the position of the factory in the sycoca file

- removeEntry (entryName)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  entryName | QString |

  Remove all entries with the given name. Not very fast (O(N)), use with care.

- resourceList ( )

  returns KSycocaResourceList
  Not implemented

  Returns the resources for which this factory is responsible. Internal to kbuildsycoca

- save (str)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | QDataStream |

  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.

- saveHeader (str)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  str | QDataStream |

  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.

- sycocaDict ( )

  returns KSycocaDict
  Not implemented

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

- virtual_hook (id, data)

  returns Nothing
  Not implemented

  Argument | Type | Default
  --- | --- | ---
  id | int |
  data | void |

  Virtual hook, used to add new "virtual" functions while maintaining binary compatibility. Unused in this class.