libkdepim

kfileio.h

00001 /* Load / save entire (local) files with nice diagnostics dialog messages.
00002  * These functions load/save the whole buffer in one i/o call, so they
00003  * should be pretty efficient.
00004  *
00005  * Author: Stefan Taferner <taferner@kde.org>
00006  * This code is under GPL.
00007  */
00008 #ifndef kpim_kfileio_h
00009 #define kpim_kfileio_h
00010 
00011 #include <qcstring.h>
00012 #include <qwidget.h>
00013 
00014 #include <kdepimmacros.h>
00015 
00016 class QString;
00017 
00018 namespace KPIM {
00019 
00028 QCString kFileToString(const QString &fileName, bool ensureNewline=true,
00029               bool withDialogs=true) KDE_EXPORT;
00030 
00031 // unused
00032 //QByteArray kFileToBytes(const QString &fileName, bool withDialogs=true);
00033 
00034 
00040 bool kBytesToFile(const char* aBuffer, int len,
00041                   const QString &aFileName,
00042                   bool aAskIfExists, bool aBackup, bool aVerbose) KDE_EXPORT;
00043 
00044 bool kCStringToFile(const QCString& buffer, const QString &fileName,
00045            bool askIfExists=false, bool createBackup=true,
00046            bool withDialogs=true) KDE_EXPORT;
00048 KDE_EXPORT bool kByteArrayToFile(const QByteArray& buffer, const QString &fileName,
00049            bool askIfExists=false, bool createBackup=true,
00050            bool withDialogs=true) KDE_EXPORT;
00051 
00052 
00072 QString checkAndCorrectPermissionsIfPossible( const QString &toCheck,
00073    const bool recursive, const bool wantItReadable,
00074    const bool wantItWritable );
00075 
00100 bool checkAndCorrectPermissionsIfPossibleWithErrorHandling( QWidget *parent, 
00101    const QString &toCheck, const bool recursive, const bool wantItReadable,
00102    const bool wantItWritable );
00103 }
00104 
00105 #endif /*kpim_kfileio_h*/
KDE Home | KDE Accessibility Home | Description of Access Keys