![]() |
Sayonara Player
|
Helper functions.
Namespaces | |
File | |
FileUtils functions. | |
Classes | |
class | Image |
class | Set |
A set structure. Inherited from std::set with some useful methods. For integer and String this set is ordered. More... | |
class | Tree |
The Tree class. More... | |
Functions | |
uint64_t | current_date_to_int () |
uint64_t | date_to_int (const QDateTime &date) |
QDateTime | int_to_date (uint64_t date) |
QString | cvt_str_to_first_upper (const QString &str) |
Transform all letters after a space to upper case. More... | |
QString | cvt_str_to_very_first_upper (const QString &str) |
Transform only first letter to upper case. More... | |
QString | cvt_ms_to_string (MilliSeconds msec, bool empty_zero=false, bool colon=true, bool show_days=true) |
Convert milliseconds to string. More... | |
QString | cvt_not_null (const QString &str) |
QString | sayonara_path (const QString &append_path=QString()) |
get sayonara path in home directory More... | |
QString | share_path (const QString &append_path=QString()) |
get share path of sayonara More... | |
QString | lib_path (const QString &append_path=QString()) |
get library path of sayonara More... | |
QString | create_link (const QString &name, bool dark=true, const QString &target="", bool underline=true) |
create a link string More... | |
QStringList | soundfile_extensions (bool with_asterisk=true) |
get all supported sound file extensions More... | |
QStringList | playlist_extensions (bool with_asterisk=true) |
get all supported playlist file extensions More... | |
QStringList | podcast_extensions (bool with_asterisk=true) |
get all supported podcast file extensions More... | |
QStringList | image_extensions (bool with_asterisk=true) |
int | random_number (int min, int max) |
get a random val between min max More... | |
QString | random_string (int max_chars) |
QString | easy_tag_finder (const QString &tag, const QString &xml_doc) |
gets value out of tag More... | |
QByteArray | calc_hash (const QByteArray &data) |
calculate a md5 hashsum More... | |
void | sleep_ms (uint64_t ms) |
sleep More... | |
QStringList | ip_addresses () |
get all ip addresses of the host More... | |
QByteArray | cvt_pixmap_to_bytearray (const QPixmap &pm) |
QPixmap | cvt_bytearray_to_pixmap (const QByteArray &arr) |
void | set_environment (const QString &key, const QString &value) |
set an environment variable. This function is platform independent More... | |
void | unset_environment (const QString &key) |
template<typename T , typename FN > | |
bool | contains (const T &container, FN fn) |
template<typename T , typename FN > | |
void | sort (T &container, FN fn) |
template<typename T , typename FN > | |
T::iterator | find (T &container, FN fn) |
template<typename T , typename FN > | |
T::const_iterator | find (const T &container, FN fn) |
template<typename T > | |
constexpr std::add_const< T >::type & | AsConst (T &t) |
template<typename T , typename FN > | |
int | indexOf (const T &container, FN fn) |
QByteArray Util::calc_hash | ( | const QByteArray & | data | ) |
calculate a md5 hashsum
data | input data |
QString Util::create_link | ( | const QString & | name, |
bool | dark = true , |
||
const QString & | target = "" , |
||
bool | underline = true |
||
) |
create a link string
name | appearing name in link |
target | target url (if not given, name is taken) |
underline | if link should be underlined |
QString Util::cvt_ms_to_string | ( | MilliSeconds | msec, |
bool | empty_zero = false , |
||
bool | colon = true , |
||
bool | show_days = true |
||
) |
Convert milliseconds to string.
msec | milliseconds |
empty_zero | if false, prepend a zero to numbers < 10 |
colon | if true, set colon between minutes and seconds |
show_days | if true, days will be shown, too |
QString Util::cvt_str_to_first_upper | ( | const QString & | str | ) |
Transform all letters after a space to upper case.
str | input string |
QString Util::cvt_str_to_very_first_upper | ( | const QString & | str | ) |
Transform only first letter to upper case.
str | input string |
QString Util::easy_tag_finder | ( | const QString & | tag, |
const QString & | xml_doc | ||
) |
gets value out of tag
tag | form: grandparent.parent.child |
xml_doc | content of the xml document |
QStringList Util::ip_addresses | ( | ) |
get all ip addresses of the host
QString Util::lib_path | ( | const QString & | append_path = QString() | ) |
get library path of sayonara
QStringList Util::playlist_extensions | ( | bool | with_asterisk = true | ) |
get all supported playlist file extensions
QStringList Util::podcast_extensions | ( | bool | with_asterisk = true | ) |
get all supported podcast file extensions
int Util::random_number | ( | int | min, |
int | max | ||
) |
get a random val between min max
min | minimum included value |
max | maximum included value |
QString Util::sayonara_path | ( | const QString & | append_path = QString() | ) |
get sayonara path in home directory
void Util::set_environment | ( | const QString & | key, |
const QString & | value | ||
) |
set an environment variable. This function is platform independent
key | variable name |
value | variable value |
QString Util::share_path | ( | const QString & | append_path = QString() | ) |
get share path of sayonara
void Util::sleep_ms | ( | uint64_t | ms | ) |
sleep
ms | milliseconds to sleep |
QStringList Util::soundfile_extensions | ( | bool | with_asterisk = true | ) |
get all supported sound file extensions