kfileio.h
00001 /* 00002 Copyright (c) 2005 Tom Albers <tomalbers@kde.nl> 00003 Copyright (c) 1997-1999 Stefan Taferner <taferner@kde.org> 00004 00005 This library is free software; you can redistribute it and/or modify it 00006 under the terms of the GNU Library General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or (at your 00008 option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, but WITHOUT 00011 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to the 00017 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 00018 02110-1301, USA. 00019 */ 00020 00021 #ifndef KPIMUTILS_KFILEIO_H 00022 #define KPIMUTILS_KFILEIO_H 00023 00024 #include "kpimutils_export.h" 00025 00026 class QByteArray; 00027 class QString; 00028 class QWidget; 00029 00030 namespace KPIMUtils { 00031 00044 KPIMUTILS_EXPORT QByteArray kFileToByteArray( const QString & fileName, 00045 bool ensureNewline = true, 00046 bool withDialogs = true ); 00047 00064 KPIMUTILS_EXPORT bool kByteArrayToFile( const QByteArray & buffer, 00065 const QString & fileName, 00066 bool askIfExists = false, 00067 bool createBackup = true, 00068 bool withDialogs = true ); 00069 00089 KPIMUTILS_EXPORT QString checkAndCorrectPermissionsIfPossible( const QString &toCheck, 00090 const bool recursive, 00091 const bool wantItReadable, 00092 const bool wantItWritable ); 00093 00118 KPIMUTILS_EXPORT bool checkAndCorrectPermissionsIfPossibleWithErrorHandling( QWidget *parent, 00119 const QString &toCheck, 00120 const bool recursive, 00121 const bool wantItReadable, 00122 const bool wantItWritable ); 00123 00133 KPIMUTILS_EXPORT bool removeDirAndContentsRecursively( const QString & path ); 00134 00135 } 00136 00137 #endif