KSharedFile Class Reference
The point of KSharedFile is to make it possible for more than one program to work with a file. KSharedFile to lock a file. More...
#include <ksharedfile.h>
Inheritance diagram for KSharedFile:

Signals | |
void | fileWriteUnlocked (const QString &filename) |
void | fileWriteLocked (const QString &filename) |
void | fileChanged (const QString &filename) |
DCOP Member Functions | |
ASYNC | slotFileChanged (QString) |
Public Member Functions | |
KSharedFile (const QString &resource) | |
KSharedFile (const QFile &file) | |
void | setFileName (const QString &filename) |
void | setFile (const QFile &file) |
QString | fileName () const |
Ticket * | requestWriteTicket () |
Ticket * | requestReadTicket () |
bool | save (Ticket *ticket, const QString &string) |
bool | save (Ticket *ticket, const QByteArray &array) |
QFile * | save (Ticket *ticket) |
QString | readAsString (bool &ok, Ticket *ticket) |
QByteArray | readAsByteArray (bool &ok, Ticket *ticket) |
QFile * | readAsFile (Ticket *ticket) |
bool | unlockReadFile (Ticket *ticket) |
bool | unlockWriteFile (Ticket *ticket) |
bool | canReadLock () |
bool | canWriteLock () |
bool | didIReadLock () |
bool | didIWriteLock () |
Detailed Description
The point of KSharedFile is to make it possible for more than one program to work with a file. KSharedFile to lock a file.It take's care that only one program writes to the file at a time. It'll not create any locks on the file though. The program creates a instance of KSharedFile and sets the FileName. If it want's to write to the file it calls tryLockFile( ) and either get's the lock or not. Then there are also signal which signalize a change.
- Author:
- Holger Freyther <freyther@kde.org>
- Version:
- 0.51
Definition at line 46 of file ksharedfile.h.
Constructor & Destructor Documentation
|
Instantiate the class.
Definition at line 36 of file ksharedfile.cpp. References KSharedFile(), and setFileName(). Referenced by KSharedFile(). |
|
this function is for convience it does the same a above but takes a file as parameter
Definition at line 52 of file ksharedfile.cpp. References KSharedFile(), and setFile(). |
Member Function Documentation
|
sets the Filename
Definition at line 75 of file ksharedfile.cpp. References setFileName(). Referenced by KSharedFile(), setFile(), and setFileName(). |
|
This method is for convience.It sets the File.
Definition at line 85 of file ksharedfile.cpp. References setFile(), and setFileName(). Referenced by KSharedFile(), and setFile(). |
|
Definition at line 89 of file ksharedfile.cpp. |
|
This tries to lock the file. It returns right after trying either successful or not
Definition at line 95 of file ksharedfile.cpp. |
|
This tries to to lock the file for reading.
Definition at line 131 of file ksharedfile.cpp. |
|
This writes to the file if the ticket is valid.
Definition at line 241 of file ksharedfile.cpp. References save(). Referenced by save(). |
|
This writes to the file if the ticket is valid.
Definition at line 254 of file ksharedfile.cpp. References save(). |
|
after locking this unlocks the file
Definition at line 194 of file ksharedfile.cpp. References unlockReadFile(). Referenced by unlockReadFile(). |
|
check whether or not the file is locked
Definition at line 228 of file ksharedfile.cpp. |
|
Definition at line 314 of file ksharedfile.cpp. |
|
In future this will tell you who to blame for the file is locked.
Definition at line 322 of file ksharedfile.cpp. |
|
This signal get emitted when the file get unlocked.
|
|
The file got locked.
|
|
The file changed during a lock and unlock session.
|
The documentation for this class was generated from the following files: