![]() |
Sayonara Player
|
FileUtils functions. More...
Functions | |
QString | cleanFilename (const QString &filename) |
formatter for filepaths. Removes double separators and replaces them with os specific separators. More... | |
QByteArray | getMD5Sum (const QString &filename) |
void | removeFilesInDirectory (const QString &dirName, const QStringList &filters) |
Remove all files from directory. More... | |
void | removeFilesInDirectory (const QString &dirName) |
void | deleteFiles (const QStringList &files) |
Remove all given files (also directories can be specified) More... | |
QString | getParentDirectory (const QString &path) |
get parent directory of a filepath More... | |
QString | getFilenameOfPath (const QString &path) |
extract pure filename from a complete file path More... | |
void | splitFilename (const QString &src, QString &dir, QString &filename) |
split filename into the dir and filename More... | |
std::pair< QString, QString > | splitFilename (const QString &src) |
QStringList | splitDirectories (const QString &path) |
returns all parts of a directory path More... | |
QString | getFileExtension (const QString &filename) |
get file extension More... | |
QStringList | getParentDirectories (const QStringList &list) |
extract parent folder of a file list (see also get_parentDirectory(const QString& path) More... | |
QString | getAbsoluteFilename (const QString &filename) |
get absolute filename of file More... | |
bool | createDirectories (const QString &path) |
create all directories necessary to access path More... | |
bool | createSymlink (const QString &source, const QString &target) |
create_symlink More... | |
QString | getFilesizeString (Filesize filesize) |
convert filesize to string More... | |
bool | isAbsolute (const QString &filename) |
Tell whether filename is absolute. More... | |
QList< QChar > | invalidFilenameChars () |
bool | writeFile (const QByteArray &raw_data, const QString &filename) |
Write raw data to file. More... | |
bool | readFileIntoString (const QString &filename, QString &content) |
read a complete file into a string More... | |
bool | readFileIntoByteArray (const QString &filename, QByteArray &content) |
read a complete file into a byte array More... | |
bool | checkFile (const QString &filepath) |
Check, if file is valid. Web URLs are always valid. More... | |
QString | getCommonDirectory (const QStringList &paths) |
get_commonDirectory More... | |
QString | getCommonDirectory (QString dir1, QString dir2) |
get_commonDirectory More... | |
bool | createDir (const QString &dirName) |
createDir More... | |
bool | copyDir (const QString &srcDir, const QString &targetDirectory, QString &new_filename) |
copyDir More... | |
bool | moveDir (const QString &srcDir, const QString &targetDirectory, QString &new_filename) |
moveDir More... | |
bool | renameDir (const QString &srcDir, const QString &newName) |
renameDir More... | |
bool | canCopyDir (const QString &srcDir, const QString &targetDirectory) |
can_copyDir More... | |
bool | moveFile (const QString &file, const QString &dir, QString &newName) |
move_file More... | |
bool | copyFile (const QString &file, const QString &dir, QString &newName) |
copy_file More... | |
bool | moveFiles (const QStringList &files, const QString &dir, QStringList &newNames) |
move_files More... | |
bool | renameFile (const QString &oldName, const QString &newName) |
rename_file More... | |
bool | copyFiles (const QStringList &files, const QString &dir, QStringList &new_files) |
copy_files More... | |
bool | isUrl (const QString &str) |
is_url More... | |
bool | isWWW (const QString &str) |
is_www More... | |
bool | isFile (const QString &filename) |
is_file More... | |
bool | isDir (const QString &filename) |
isDir More... | |
bool | isSoundFile (const QString &extension) |
is_soundfile More... | |
bool | isPlaylistFile (const QString &extension) |
is_playlistfile More... | |
bool | isImageFile (const QString &extension) |
is_imagefile More... | |
bool | exists (const QString &filename) |
exists More... | |
bool | isSamePath (const QString &filename1, const QString &filename2) |
Compares two filepaths by cleaning them. More... | |
bool | isSubdir (const QString &dir, const QString &parentDir) |
Checks if dir is a subdir of parentDir. More... | |
FileUtils functions.
bool Util::File::canCopyDir | ( | const QString & | srcDir, |
const QString & | targetDirectory | ||
) |
can_copyDir
srcDir | |
targetDirectory |
bool Util::File::checkFile | ( | const QString & | filepath | ) |
Check, if file is valid. Web URLs are always valid.
filepath | path to file or resource |
QString Util::File::cleanFilename | ( | const QString & | filename | ) |
formatter for filepaths. Removes double separators and replaces them with os specific separators.
filename | input filename |
bool Util::File::copyDir | ( | const QString & | srcDir, |
const QString & | targetDirectory, | ||
QString & | new_filename | ||
) |
copyDir
srcDir | |
targetDirectory |
bool Util::File::copyFile | ( | const QString & | file, |
const QString & | dir, | ||
QString & | newName | ||
) |
copy_file
file | |
dir |
bool Util::File::copyFiles | ( | const QStringList & | files, |
const QString & | dir, | ||
QStringList & | new_files | ||
) |
copy_files
files | |
dir |
bool Util::File::createDir | ( | const QString & | dirName | ) |
createDir
dirName |
bool Util::File::createDirectories | ( | const QString & | path | ) |
create all directories necessary to access path
path | full target path |
bool Util::File::createSymlink | ( | const QString & | source, |
const QString & | target | ||
) |
create_symlink
source | |
target |
void Util::File::deleteFiles | ( | const QStringList & | files | ) |
Remove all given files (also directories can be specified)
files | list of files |
bool Util::File::exists | ( | const QString & | filename | ) |
exists
filename |
QString Util::File::getAbsoluteFilename | ( | const QString & | filename | ) |
get absolute filename of file
filename |
QString Util::File::getCommonDirectory | ( | const QStringList & | paths | ) |
get_commonDirectory
paths |
QString Util::File::getCommonDirectory | ( | QString | dir1, |
QString | dir2 | ||
) |
get_commonDirectory
dir1 | |
dir2 |
QString Util::File::getFileExtension | ( | const QString & | filename | ) |
get file extension
filename | filename to get the extension for |
QString Util::File::getFilenameOfPath | ( | const QString & | path | ) |
extract pure filename from a complete file path
path | complete file path |
QString Util::File::getFilesizeString | ( | Filesize | filesize | ) |
convert filesize to string
filesize | in bytes |
QStringList Util::File::getParentDirectories | ( | const QStringList & | list | ) |
extract parent folder of a file list (see also get_parentDirectory(const QString& path)
list | file list |
QString Util::File::getParentDirectory | ( | const QString & | path | ) |
get parent directory of a filepath
path | File- or directory path |
bool Util::File::isAbsolute | ( | const QString & | filename | ) |
Tell whether filename is absolute.
filename | the filename to check |
bool Util::File::isDir | ( | const QString & | filename | ) |
isDir
filename |
bool Util::File::isFile | ( | const QString & | filename | ) |
is_file
filename |
bool Util::File::isImageFile | ( | const QString & | extension | ) |
is_imagefile
extension |
bool Util::File::isPlaylistFile | ( | const QString & | extension | ) |
is_playlistfile
extension |
bool Util::File::isSamePath | ( | const QString & | filename1, |
const QString & | filename2 | ||
) |
Compares two filepaths by cleaning them.
filename1 | |
filename2 |
bool Util::File::isSoundFile | ( | const QString & | extension | ) |
is_soundfile
extension |
bool Util::File::isSubdir | ( | const QString & | dir, |
const QString & | parentDir | ||
) |
Checks if dir is a subdir of parentDir.
dir | the dir of interest |
otherDir | the maybe-parentdir |
bool Util::File::isUrl | ( | const QString & | str | ) |
is_url
str |
bool Util::File::isWWW | ( | const QString & | str | ) |
is_www
str |
bool Util::File::moveDir | ( | const QString & | srcDir, |
const QString & | targetDirectory, | ||
QString & | new_filename | ||
) |
moveDir
srcDir | |
targetDirectory |
bool Util::File::moveFile | ( | const QString & | file, |
const QString & | dir, | ||
QString & | newName | ||
) |
move_file
file | |
dir |
bool Util::File::moveFiles | ( | const QStringList & | files, |
const QString & | dir, | ||
QStringList & | newNames | ||
) |
move_files
files | |
dir |
bool Util::File::readFileIntoByteArray | ( | const QString & | filename, |
QByteArray & | content | ||
) |
read a complete file into a byte array
filename | filename |
content | target reference to content |
bool Util::File::readFileIntoString | ( | const QString & | filename, |
QString & | content | ||
) |
read a complete file into a string
filename | filename |
content | target reference to content |
void Util::File::removeFilesInDirectory | ( | const QString & | dirName, |
const QStringList & | filters | ||
) |
Remove all files from directory.
dirName | directory name |
filters | file name filters |
bool Util::File::renameDir | ( | const QString & | srcDir, |
const QString & | newName | ||
) |
renameDir
srcDir | |
newName |
bool Util::File::renameFile | ( | const QString & | oldName, |
const QString & | newName | ||
) |
rename_file
oldName | |
newName |
QStringList Util::File::splitDirectories | ( | const QString & | path | ) |
returns all parts of a directory path
path |
void Util::File::splitFilename | ( | const QString & | src, |
QString & | dir, | ||
QString & | filename | ||
) |
split filename into the dir and filename
src | |
path | |
filename |
bool Util::File::writeFile | ( | const QByteArray & | raw_data, |
const QString & | filename | ||
) |
Write raw data to file.
raw_data | raw data |
filename | target_filename |