![]() |
Sayonara Player
|
FileUtils functions. More...
Functions | |
QString | clean_filename (const QString &filename) |
formatter for filepaths. Removes double separators and replaces them with os specific separators. More... | |
QString | calc_file_extension (const QString &filename) |
calc_file_extension More... | |
QByteArray | calc_md5_sum (const QString &filename) |
void | remove_files_in_directory (const QString &dir_name, const QStringList &filters) |
Remove all files from directory. More... | |
void | remove_files_in_directory (const QString &dir_name) |
void | delete_files (const QStringList &files) |
Remove all given files (also directories can be specified) More... | |
QString | get_parent_directory (const QString &path) |
get parent directory of a filepath More... | |
QString | get_filename_of_path (const QString &path) |
extract pure filename from a complete file path More... | |
void | split_filename (const QString &src, QString &dir, QString &filename) |
split filename into the dir and filename More... | |
QStringList | split_directories (const QString &path) |
returns all parts of a directory path More... | |
QString | get_file_extension (const QString &filename) |
get file extension More... | |
QStringList | get_parent_directories (const QStringList &list) |
extract parent folder of a file list (see also get_parent_directory(const QString& path) More... | |
QString | get_absolute_filename (const QString &filename) |
get absolute filename of file More... | |
bool | create_directories (const QString &path) |
create all directories necessary to access path More... | |
bool | create_symlink (const QString &source, const QString &target) |
create_symlink More... | |
QString | calc_filesize_str (uint64_t filesize) |
convert filesize to string More... | |
bool | is_absolute (const QString &filename) |
Tell whether filename is absolute. More... | |
bool | write_file (const QByteArray &raw_data, const QString &filename) |
Write raw data to file. More... | |
bool | read_file_into_str (const QString &filename, QString &content) |
read a complete file into a string More... | |
bool | read_file_into_byte_arr (const QString &filename, QByteArray &content) |
read a complete file into a byte array More... | |
bool | check_file (const QString &filepath) |
Check, if file is valid. Web URLs are always valid. More... | |
bool | is_in_sayonara_dir (const QString &path) |
is_in_sayonara_dir More... | |
QString | get_common_directory (const QStringList &paths) |
get_common_directory More... | |
QString | get_common_directory (QString dir1, QString dir2) |
get_common_directory More... | |
bool | create_dir (const QString &dir_name) |
create_dir More... | |
bool | copy_dir (const QString &src_dir, const QString &target_dir) |
copy_dir More... | |
QString | move_dir (const QString &src_dir, const QString &target_dir) |
move_dir More... | |
bool | rename_dir (const QString &src_dir, const QString &new_name) |
rename_dir More... | |
bool | can_copy_dir (const QString &src_dir, const QString &target_dir) |
can_copy_dir More... | |
bool | move_file (const QString &file, const QString &dir) |
move_file More... | |
bool | copy_file (const QString &file, const QString &dir) |
copy_file More... | |
bool | move_files (const QStringList &files, const QString &dir) |
move_files More... | |
bool | rename_file (const QString &old_name, const QString &new_name) |
rename_file More... | |
bool | copy_files (const QStringList &files, const QString &dir) |
copy_files More... | |
bool | is_url (const QString &str) |
is_url More... | |
bool | is_www (const QString &str) |
is_www More... | |
bool | is_file (const QString &filename) |
is_file More... | |
bool | is_dir (const QString &filename) |
is_dir More... | |
bool | is_soundfile (const QString &filename) |
is_soundfile More... | |
bool | is_playlistfile (const QString &filename) |
is_playlistfile More... | |
bool | is_imagefile (const QString &filename) |
is_imagefile More... | |
bool | exists (const QString &filename) |
exists More... | |
FileUtils functions.
QString Util::File::calc_file_extension | ( | const QString & | filename | ) |
calc_file_extension
filename |
QString Util::File::calc_filesize_str | ( | uint64_t | filesize | ) |
convert filesize to string
filesize | in bytes |
bool Util::File::can_copy_dir | ( | const QString & | src_dir, |
const QString & | target_dir | ||
) |
can_copy_dir
src_dir | |
target_dir |
bool Util::File::check_file | ( | const QString & | filepath | ) |
Check, if file is valid. Web URLs are always valid.
filepath | path to file or resource |
QString Util::File::clean_filename | ( | const QString & | filename | ) |
formatter for filepaths. Removes double separators and replaces them with os specific separators.
filename | input filename |
bool Util::File::copy_dir | ( | const QString & | src_dir, |
const QString & | target_dir | ||
) |
copy_dir
src_dir | |
target_dir |
bool Util::File::copy_file | ( | const QString & | file, |
const QString & | dir | ||
) |
copy_file
file | |
dir |
bool Util::File::copy_files | ( | const QStringList & | files, |
const QString & | dir | ||
) |
copy_files
files | |
dir |
bool Util::File::create_dir | ( | const QString & | dir_name | ) |
create_dir
dir_name |
bool Util::File::create_directories | ( | const QString & | path | ) |
create all directories necessary to access path
path | full target path |
bool Util::File::create_symlink | ( | const QString & | source, |
const QString & | target | ||
) |
create_symlink
source | |
target |
void Util::File::delete_files | ( | 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::get_absolute_filename | ( | const QString & | filename | ) |
get absolute filename of file
filename |
QString Util::File::get_common_directory | ( | const QStringList & | paths | ) |
get_common_directory
paths |
QString Util::File::get_common_directory | ( | QString | dir1, |
QString | dir2 | ||
) |
get_common_directory
dir1 | |
dir2 |
QString Util::File::get_file_extension | ( | const QString & | filename | ) |
get file extension
filename | filename to get the extension for |
QString Util::File::get_filename_of_path | ( | const QString & | path | ) |
extract pure filename from a complete file path
path | complete file path |
QStringList Util::File::get_parent_directories | ( | const QStringList & | list | ) |
extract parent folder of a file list (see also get_parent_directory(const QString& path)
list | file list |
QString Util::File::get_parent_directory | ( | const QString & | path | ) |
get parent directory of a filepath
path | File- or directory path |
bool Util::File::is_absolute | ( | const QString & | filename | ) |
Tell whether filename is absolute.
filename | the filename to check |
bool Util::File::is_dir | ( | const QString & | filename | ) |
is_dir
filename |
bool Util::File::is_file | ( | const QString & | filename | ) |
is_file
filename |
bool Util::File::is_imagefile | ( | const QString & | filename | ) |
is_imagefile
filename |
bool Util::File::is_in_sayonara_dir | ( | const QString & | path | ) |
is_in_sayonara_dir
path |
bool Util::File::is_playlistfile | ( | const QString & | filename | ) |
is_playlistfile
filename |
bool Util::File::is_soundfile | ( | const QString & | filename | ) |
is_soundfile
filename |
bool Util::File::is_url | ( | const QString & | str | ) |
is_url
str |
bool Util::File::is_www | ( | const QString & | str | ) |
is_www
str |
QString Util::File::move_dir | ( | const QString & | src_dir, |
const QString & | target_dir | ||
) |
move_dir
src_dir | |
target_dir |
bool Util::File::move_file | ( | const QString & | file, |
const QString & | dir | ||
) |
move_file
file | |
dir |
bool Util::File::move_files | ( | const QStringList & | files, |
const QString & | dir | ||
) |
move_files
files | |
dir |
bool Util::File::read_file_into_byte_arr | ( | const QString & | filename, |
QByteArray & | content | ||
) |
read a complete file into a byte array
filename | filename |
content | target reference to content |
bool Util::File::read_file_into_str | ( | const QString & | filename, |
QString & | content | ||
) |
read a complete file into a string
filename | filename |
content | target reference to content |
void Util::File::remove_files_in_directory | ( | const QString & | dir_name, |
const QStringList & | filters | ||
) |
Remove all files from directory.
dir_name | directory name |
filters | file name filters |
bool Util::File::rename_dir | ( | const QString & | src_dir, |
const QString & | new_name | ||
) |
rename_dir
src_dir | |
new_name |
bool Util::File::rename_file | ( | const QString & | old_name, |
const QString & | new_name | ||
) |
rename_file
old_name | |
new_name |
QStringList Util::File::split_directories | ( | const QString & | path | ) |
returns all parts of a directory path
path |
void Util::File::split_filename | ( | const QString & | src, |
QString & | dir, | ||
QString & | filename | ||
) |
split filename into the dir and filename
src | |
path | |
filename |
bool Util::File::write_file | ( | const QByteArray & | raw_data, |
const QString & | filename | ||
) |
Write raw data to file.
raw_data | raw data |
filename | target_filename |