KVIrc 5.2.4
Developer APIs
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 <QString>
#include <QStringList>
#include <QtGlobal>
#include <QStringConverter>
#include <QTextStream>

Namespaces

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

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

◆ _KVI_FILEUTLIS_CPP_

#define _KVI_FILEUTLIS_CPP_