libtdepim

tdefileio.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_tdefileio_h
00009 #define kpim_tdefileio_h
00010 
00011 #include <tqcstring.h>
00012 #include <tqwidget.h>
00013 
00014 #include <tdepimmacros.h>
00015 
00016 class TQString;
00017 
00018 namespace KPIM {
00019 
00028 TQCString kFileToString(const TQString &fileName, bool ensureNewline=true,
00029               bool withDialogs=true) KDE_EXPORT;
00030 
00031 // unused
00032 //TQByteArray kFileToBytes(const TQString &fileName, bool withDialogs=true);
00033 
00034 
00040 bool kBytesToFile(const char* aBuffer, int len,
00041                   const TQString &aFileName,
00042                   bool aAskIfExists, bool aBackup, bool aVerbose) KDE_EXPORT;
00043 
00044 bool kCStringToFile(const TQCString& buffer, const TQString &fileName,
00045            bool askIfExists=false, bool createBackup=true,
00046            bool withDialogs=true) KDE_EXPORT;
00048 KDE_EXPORT bool kByteArrayToFile(const TQByteArray& buffer, const TQString &fileName,
00049            bool askIfExists=false, bool createBackup=true,
00050            bool withDialogs=true) KDE_EXPORT;
00051 
00052 
00072 TQString checkAndCorrectPermissionsIfPossible( const TQString &toCheck,
00073    const bool recursive, const bool wantItReadable,
00074    const bool wantItWritable );
00075 
00100 bool checkAndCorrectPermissionsIfPossibleWithErrorHandling( TQWidget *parent, 
00101    const TQString &toCheck, const bool recursive, const bool wantItReadable,
00102    const bool wantItWritable );
00103 }
00104 
00105 #endif /*kpim_tdefileio_h*/