KVIrc  4.9.2
DeveloperAPIs
Namespaces | Macros | Functions
KviFileUtils.h File Reference

File utilities functions. More...

#include "kvi_settings.h"
#include "KviCString.h"
#include <QFile>
#include <QStringList>
#include <time.h>

Go to the source code of this file.

Namespaces

 KviFileUtils
 A namespace to handle file utilities functions.
 

Macros

#define KVI_PATH_SEPARATOR   "/"
 
#define KVI_PATH_SEPARATOR_CHAR   '/'
 

Functions

void KviFileUtils::adjustFilePath (QString &szPath)
 Adjusts the file path to the current platform. More...
 
void KviFileUtils::cleanFileName (QString &szPath)
 Removes any unusable character from a filename (with no path!) More...
 
bool KviFileUtils::copyFile (const QString &szSrc, const QString &szDst)
 Copy the file (cp -f) More...
 
bool KviFileUtils::copyFile (const char *pcSrc, const char *pcDst)
 Copy the file (cp -f) More...
 
bool KviFileUtils::deleteDir (const QString &szPath)
 Removes a dir recursively. More...
 
bool KviFileUtils::directoryExists (const QString &szPath)
 Returns true if szPath points to an existing directory. More...
 
void KviFileUtils::encodeFileName (QString &szPath)
 Translates ANY string into a valid filename (with no path!) More...
 
QString KviFileUtils::extractFileName (const QString &szFileNameWithPath, bool bAllowEmpty=true)
 Extracts the filename from a complete path (strips leading path) More...
 
QString KviFileUtils::extractFilePath (const QString &szFileNameWithPath)
 Extracts the filename from a complete path (strips leading path) More...
 
bool KviFileUtils::fileExists (const QString &szPath)
 Returns true if szPath points to an existing file. More...
 
QStringList KviFileUtils::getFileListing (const QString &szPath)
 
bool KviFileUtils::isAbsolutePath (const QString &szPath)
 Returns true if the path is absolute, false otherwise. More...
 
bool KviFileUtils::isReadable (const QString &szFname)
 Returns true if the file is readable, false otherwise. More...
 
bool KviFileUtils::loadFile (const QString &szPath, QString &szBuffer, bool bUtf8=true)
 Loads the file at szPath to szBuffer eventually converting from UTF-8. More...
 
bool KviFileUtils::makeDir (const QString &szPath)
 Create a directory (mkdir) More...
 
bool KviFileUtils::makeDir (const char *pcPath)
 Create a directory (mkdir) More...
 
bool KviFileUtils::readFile (const QString &szPath, QString &szBuffer, unsigned int uMaxSize=65535)
 Reads a complete file and puts it in the string szBuffer. More...
 
bool KviFileUtils::readFile (const char *pcPath, QString &szBuffer, unsigned int uMaxSize=65535)
 Reads a complete file and puts it in the string szBuffer. More...
 
bool KviFileUtils::readLine (QFile *pFile, QString &szBuffer, bool bUtf8=true)
 Reads a text line, returns false if EOF is reached. More...
 
bool KviFileUtils::readLines (QFile *pFile, QStringList &buffer, int iStartLine=0, int iCount=-1, bool bUtf8=true)
 Reads text lines, returns false if EOF is reached. More...
 
bool KviFileUtils::removeDir (const QString &szPath)
 Removes a dir (must be empty) More...
 
bool KviFileUtils::removeDir (const char *pcPath)
 Removes a dir (must be empty) More...
 
bool KviFileUtils::removeFile (const QString &szPath)
 Removes a file. More...
 
bool KviFileUtils::removeFile (const char *pcPath)
 Removes a file. More...
 
bool KviFileUtils::renameFile (const QString &szSrc, const QString &szDst)
 Rename or move the file (mv) More...
 
bool KviFileUtils::renameFile (const char *pcSrc, const char *pcDst)
 Rename or move the file (mv) More...
 
bool KviFileUtils::writeFile (const QString &szPath, const QByteArray &oData, bool bAppend=false)
 Writes a complete file (UTF-8 version) More...
 
bool KviFileUtils::writeFile (const QString &szPath, const QString &szData, bool bAppend=false)
 Writes a complete file (UTF-8 version) More...
 
bool KviFileUtils::writeFile (const char *pcPath, const QString &szData, bool bAppend=false)
 Writes a complete file (UTF-8 version) More...
 
bool KviFileUtils::writeFileLocal8Bit (const QString &szPath, const QString &szData, bool bAppend=false)
 Writes a complete file (local 8 bit version) More...
 
bool KviFileUtils::writeFileLocal8Bit (const char *pcPath, const QString &szData, bool bAppend=false)
 Writes a complete file (local 8 bit version) More...
 

Detailed Description

File utilities functions.

Author
Szymon Stefanek

Macro Definition Documentation

#define KVI_PATH_SEPARATOR   "/"
#define KVI_PATH_SEPARATOR_CHAR   '/'