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

KDECore

KMemFile Class Reference

#include <kmemfile.h>

Inheritance diagram for KMemFile:

Inheritance graph
[legend]

List of all members.


Public Member Functions

virtual void close ()
virtual bool isSequential () const
 KMemFile (const QString &filename, QObject *parent=0)
virtual bool open (OpenMode mode)
virtual bool seek (qint64 pos)
virtual qint64 size () const
virtual ~KMemFile ()

Static Public Member Functions

static void fileContentsChanged (const QString &filename)

Protected Member Functions

virtual qint64 readData (char *data, qint64 maxSize)
virtual qint64 writeData (const char *data, qint64 maxSize)

Detailed Description

For internal use only.

Simple QIODevice for QSharedMemory to keep ksycoca cache in memory only once The first call to open() loads the file into a shm segment. Every subsequent call only attaches to this segment. When the file content changed, you have to execute KMemFile::fileContentsChanged() to update the internal structures. The next call to open() creates a new shm segment. The old one is automatically destroyed when the last process closed KMemFile.

Definition at line 37 of file kmemfile.h.


Constructor & Destructor Documentation

KMemFile::KMemFile ( const QString &  filename,
QObject *  parent = 0 
) [explicit]

ctor

Parameters:
filename the file to load into memory
parent our parent

Definition at line 116 of file kmemfile.cpp.

KMemFile::~KMemFile (  )  [virtual]

dtor

Definition at line 122 of file kmemfile.cpp.


Member Function Documentation

void KMemFile::close (  )  [virtual]

closes the KMemFile

Reimplemented from superclass.

Reimplemented from QIODevice.

Definition at line 128 of file kmemfile.cpp.

void KMemFile::fileContentsChanged ( const QString &  filename  )  [static]

This static function updates the internal information about the file loaded into shared memory.

The next time the file is opened, the file is reread from the file system.

Definition at line 236 of file kmemfile.cpp.

bool KMemFile::isSequential (  )  const [virtual]

As KMemFile is a random access device, it returns false.

Reimplemented from superclass.

Definition at line 136 of file kmemfile.cpp.

bool KMemFile::open ( OpenMode  mode  )  [virtual]

Reimplemented from superclass.
Parameters:
mode only QIODevice::ReadOnly is accepted

Reimplemented from QIODevice.

Definition at line 141 of file kmemfile.cpp.

qint64 KMemFile::readData ( char *  data,
qint64  maxSize 
) [protected, virtual]

Reimplemented from superclass.

Reimplemented from QIODevice.

Definition at line 218 of file kmemfile.cpp.

bool KMemFile::seek ( qint64  pos  )  [virtual]

Sets the current read/write position to pos.

Reimplemented from superclass.
Parameters:
pos the new read/write position

Reimplemented from QIODevice.

Definition at line 202 of file kmemfile.cpp.

qint64 KMemFile::size (  )  const [virtual]

Returns the size of the file.

Reimplemented from superclass.

Definition at line 213 of file kmemfile.cpp.

qint64 KMemFile::writeData ( const char *  data,
qint64  maxSize 
) [protected, virtual]

Reimplemented from superclass.

Reimplemented from QIODevice.

Definition at line 231 of file kmemfile.cpp.


The documentation for this class was generated from the following files:
  • kmemfile.h
  • kmemfile.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
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
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