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

KDECore

Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
KMemFile Class Reference

#include <kmemfile.h>

Inheritance diagram for KMemFile:
Inheritance graph
[legend]

Public Member Functions

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

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

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 39 of file kmemfile.h.

Constructor & Destructor Documentation

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

ctor

Parameters
filenamethe file to load into memory
parentour parent

Definition at line 118 of file kmemfile.cpp.

KMemFile::~KMemFile ( )
virtual

dtor

Definition at line 124 of file kmemfile.cpp.

Member Function Documentation

void KMemFile::close ( )
virtual

closes the KMemFile

Reimplemented from superclass.

Definition at line 130 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 238 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 138 of file kmemfile.cpp.

bool KMemFile::open ( OpenMode  mode)
virtual
Reimplemented from superclass.
Parameters
modeonly QIODevice::ReadOnly is accepted

Definition at line 143 of file kmemfile.cpp.

qint64 KMemFile::readData ( char *  data,
qint64  maxSize 
)
protectedvirtual
Reimplemented from superclass.

Definition at line 220 of file kmemfile.cpp.

bool KMemFile::seek ( qint64  pos)
virtual

Sets the current read/write position to pos.

Reimplemented from superclass.
Parameters
posthe new read/write position

Definition at line 204 of file kmemfile.cpp.

qint64 KMemFile::size ( ) const
virtual

Returns the size of the file.

Reimplemented from superclass.

Definition at line 215 of file kmemfile.cpp.

qint64 KMemFile::writeData ( const char *  data,
qint64  maxSize 
)
protectedvirtual
Reimplemented from superclass.

Definition at line 233 of file kmemfile.cpp.


The documentation for this class was generated from the following files:
  • kmemfile.h
  • kmemfile.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