libtdepim

tdefileio.h
1/* Load / save entire (local) files with nice diagnostics dialog messages.
2 * These functions load/save the whole buffer in one i/o call, so they
3 * should be pretty efficient.
4 *
5 * Author: Stefan Taferner <taferner@kde.org>
6 * This code is under GPL.
7 */
8#ifndef kpim_tdefileio_h
9#define kpim_tdefileio_h
10
11#include <tqcstring.h>
12#include <tqwidget.h>
13
14#include <tdemacros.h>
15
16class TQString;
17
18namespace KPIM {
19
28TQCString kFileToString(const TQString &fileName, bool ensureNewline=true,
29 bool withDialogs=true) TDE_EXPORT;
30
31// unused
32//TQByteArray kFileToBytes(const TQString &fileName, bool withDialogs=true);
33
34
40bool kBytesToFile(const char* aBuffer, int len,
41 const TQString &aFileName,
42 bool aAskIfExists, bool aBackup, bool aVerbose) TDE_EXPORT;
43
44bool kCStringToFile(const TQCString& buffer, const TQString &fileName,
45 bool askIfExists=false, bool createBackup=true,
46 bool withDialogs=true) TDE_EXPORT;
48bool kByteArrayToFile(const TQByteArray& buffer, const TQString &fileName,
49 bool askIfExists=false, bool createBackup=true,
50 bool withDialogs=true) TDE_EXPORT;
51
52
72TQString checkAndCorrectPermissionsIfPossible( const TQString &toCheck,
73 const bool recursive, const bool wantItReadable,
74 const bool wantItWritable );
75
101 const TQString &toCheck, const bool recursive, const bool wantItReadable,
102 const bool wantItWritable );
103}
104
105#endif /*kpim_tdefileio_h*/
TDEPIM classes for drag and drop of mails.
TDE_EXPORT bool kBytesToFile(const char *aBuffer, int len, const TQString &aFileName, bool aAskIfExists, bool aBackup, bool aVerbose)
Save a file.
Definition: tdefileio.cpp:176
TDE_EXPORT TQCString kFileToString(const TQString &aFileName, bool aEnsureNL, bool aVerbose)
Load a file.
Definition: tdefileio.cpp:36
TDE_EXPORT bool kByteArrayToFile(const TQByteArray &aBuffer, const TQString &aFileName, bool aAskIfExists, bool aBackup, bool aVerbose)
Does not stop at NUL.
Definition: tdefileio.cpp:263
bool checkAndCorrectPermissionsIfPossibleWithErrorHandling(TQWidget *parent, const TQString &toCheck, const bool recursive, const bool wantItReadable, const bool wantItWritable)
Checks and corrects the permissions of a file or folder, and if requested all files and folders below...
Definition: tdefileio.cpp:368
TQString checkAndCorrectPermissionsIfPossible(const TQString &toCheck, const bool recursive, const bool wantItReadable, const bool wantItWritable)
Checks and corrects the permissions of a file or folder, and if requested all files and folders below...
Definition: tdefileio.cpp:271