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