KVIrc  4.9.2
DeveloperAPIs
Namespaces | Macros | Functions | Variables
KviFileUtils.cpp File Reference
#include "KviFileUtils.h"
#include "KviQString.h"
#include "KviFile.h"
#include "KviMemory.h"
#include <QDir>
#include <QFileInfo>
#include <QtGlobal>
#include <QTextCodec>
#include <QTextStream>

Namespaces

 KviFileUtils
 A namespace to handle file utilities functions.
 

Macros

#define _KVI_FILEUTLIS_CPP_
 

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...
 
QStringList KviFileUtils::getFileListing (const QString &szPath)
 
static QStringList KviFileUtils::getFileListingInternal (const QString &szPath, const QString &szPrefix)
 
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::isReadable (const char *pcPath)
 
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...
 

Variables

static char KviFileUtils::cHexChars [16] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }
 

Macro Definition Documentation

#define _KVI_FILEUTLIS_CPP_