Sayonara Player
Namespaces | Classes | Functions
Helper Namespace Reference

Detailed Description

Helper functions.

Namespaces

 File
 Filehelper functions.
 
 Url
 Helper function for Url handling.
 

Classes

class  StringDummy
 

Functions

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 (quint64 msec, bool empty_zero=false, bool colon=true, bool show_days=true)
 Convert milliseconds to string. More...
 
QString get_error_file ()
 get error log file More...
 
QString get_sayonara_path ()
 get sayonara path in home directory More...
 
QString get_share_path ()
 get share path of sayonara More...
 
QString get_lib_path ()
 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 get_soundfile_extensions ()
 get all supported sound file extensions More...
 
QStringList get_playlistfile_extensions ()
 get all supported playlist file extensions More...
 
QStringList get_podcast_extensions ()
 get all supported podcast file extensions More...
 
int get_random_number (int min, int max)
 get a random val between min max More...
 
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 (quint64 ms)
 sleep More...
 
QStringList get_ip_addresses ()
 get all ip addresses of the host More...
 
void set_environment (const QString &key, const QString &value)
 set an environment variable. This function is platform independent More...
 

Function Documentation

§ calc_hash()

QByteArray Helper::calc_hash ( const QByteArray &  data)

calculate a md5 hashsum

Parameters
datainput data
Returns
hashsum

§ create_link()

QString Helper::create_link ( const QString &  name,
bool  dark = true,
const QString &  target = "",
bool  underline = true 
)

create a link string

Parameters
nameappearing name in link
targettarget url (if not given, name is taken)
underlineif link should be underlined
Returns
link string

§ cvt_ms_to_string()

QString Helper::cvt_ms_to_string ( quint64  msec,
bool  empty_zero = false,
bool  colon = true,
bool  show_days = true 
)

Convert milliseconds to string.

Parameters
msecmilliseconds
empty_zeroif false, prepend a zero to numbers < 10
colonif true, set colon between minutes and seconds
show_daysif true, days will be shown, too
Returns
converted milliseconds

§ cvt_str_to_first_upper()

QString Helper::cvt_str_to_first_upper ( const QString &  str)

Transform all letters after a space to upper case.

Parameters
strinput string
Returns
result string

§ cvt_str_to_very_first_upper()

QString Helper::cvt_str_to_very_first_upper ( const QString &  str)

Transform only first letter to upper case.

Parameters
strinput string
Returns
result string

§ easy_tag_finder()

QString Helper::easy_tag_finder ( const QString &  tag,
const QString &  xml_doc 
)

gets value out of tag

Parameters
tagform: grandparent.parent.child
xml_doccontent of the xml document
Returns
extracted string

§ get_error_file()

QString Helper::get_error_file ( )

get error log file

Returns

§ get_ip_addresses()

QStringList Helper::get_ip_addresses ( )

get all ip addresses of the host

Returns
list of ip addresses

§ get_lib_path()

QString Helper::get_lib_path ( )

get library path of sayonara

Returns
./lib on windows, lib path of unix system

§ get_playlistfile_extensions()

QStringList Helper::get_playlistfile_extensions ( )

get all supported playlist file extensions

Returns

§ get_podcast_extensions()

QStringList Helper::get_podcast_extensions ( )

get all supported podcast file extensions

Returns

§ get_random_number()

int Helper::get_random_number ( int  min,
int  max 
)

get a random val between min max

Parameters
minminimum included value
maxmaximum included value
Returns
random number

§ get_sayonara_path()

QString Helper::get_sayonara_path ( )

get sayonara path in home directory

Returns

§ get_share_path()

QString Helper::get_share_path ( )

get share path of sayonara

Returns
./share on windows, share path of unix system

§ get_soundfile_extensions()

QStringList Helper::get_soundfile_extensions ( )

get all supported sound file extensions

Returns

§ set_environment()

void Helper::set_environment ( const QString &  key,
const QString &  value 
)

set an environment variable. This function is platform independent

Parameters
keyvariable name
valuevariable value

§ sleep_ms()

void Helper::sleep_ms ( quint64  ms)

sleep

Parameters
msmilliseconds to sleep