KVIrc
4.9.2
DeveloperAPIs
|
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... | |
File utilities functions.
#define KVI_PATH_SEPARATOR "/" |
Referenced by KviApplication::checkGlobalKvircDirectory(), ActionEditor::exportActions(), AliasEditorWidget::exportAliases(), EventEditor::exportAllEvents(), RawEditorWidget::exportAllEvents(), ClassEditorWidget::exportClasses(), EventEditor::exportCurrentHandler(), RawEditorWidget::exportCurrentHandler(), PopupEditorWidget::exportCurrentPopup(), PopupEditorWidget::exportPopups(), AliasEditorWidget::exportSelectionInSinglesFiles(), ClassEditorWidget::exportSelectionInSinglesFiles(), CustomizeToolBarsDialog::exportToolBar(), KviFileUtils::extractFileName(), KviApplication::findLocalKvircDirectory(), KviFileUtils::getFileListingInternal(), KviApplication::getGlobalKvircDirectory(), KviApplication::getLocalKvircDirectory(), KviImageDialog::heartbeat(), KviApplication::loadDirectories(), KviFileUtils::makeDir(), KviApplication::mapImageFile(), and KviApplication::saveKvircDirectory().
#define KVI_PATH_SEPARATOR_CHAR '/' |
Referenced by SetupWizard::accept(), KviPackageWriter::addDirectory(), addon_kvs_cmd_installfiles(), SetupWizard::chooseDataPath(), OptionsWidget_textIcons::chooseFromFile(), SetupWizard::chooseOldDataPath(), DccBroker::chooseSaveFileName(), KviApplication::completeDirectory(), KviModuleManager::completeModuleNames(), LogViewWindow::createLog(), file_kvs_fnc_cwd(), file_kvs_fnc_extractfilename(), file_kvs_fnc_globaldir(), file_kvs_fnc_homedir(), file_kvs_fnc_localdir(), file_kvs_fnc_ps(), file_kvs_fnc_rootdir(), KviApplication::findAudioFile(), KviLocale::findCatalogue(), KviApplication::findImage(), KviApplication::findImageInImageSearchPath(), KviApplication::findImageThemeOnlyCompat(), KviApplication::findLocalKvircDirectory(), KviApplication::findSmallIcon(), KviWindow::getDefaultLogFileName(), KviApplication::getGlobalKvircDirectory(), KviApplication::getLocalKvircDirectory(), KviApplication::getTmpFileName(), PackAddonSaveSelectionWidget::initializePage(), AddonFunctions::installAddonPackage(), KviApplication::KviApplication(), KviKvsCoreSimpleCommands::KVSCSC(), KviModuleManager::loadModulesByCaps(), LogFile::LogFile(), KviFileUtils::makeDir(), SetupWizard::makeLink(), KviApplication::mapImageFile(), PackAddonDialog::packAddon(), package_kvs_fnc_info(), PackThemeDataWidget::parseThemes(), KviTheme::save(), KviThemeInfo::setDirectoryAndLocation(), KviApplication::setupBegin(), SetupWizard::SetupWizard(), and KviPackageReader::unpackFile().