Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Data Structures | Functions
Utils Namespace Reference

The namespace provide utility functions. More...

Data Structures

class  CompileSymbols

Functions

Glib::ustring seconds_to_duration (unsigned long)
 converts a given time in seconds to a duration ustring
Glib::ustring seconds_to_timestamp (const long)
 converts a given time in seconds to a "timestamp"
std::string int_to_string (int num)
 Simply converts any integer to a std::string.
void builder_internal_fetch (Glib::RefPtr< Gtk::Builder > &ref, const char *file)
 Fetches ui definitions either from file or from compiled-in glade xml.
Glib::RefPtr< Gdk::Pixbuf > create_pixbuf_from_data (const guchar *data, gsize len, int width=150, int height=150, bool aspect=false)
Glib::RefPtr< Gdk::Pixbuf > pixbuf_internal_fetch (const char *file, int width=150, int height=150, bool aspect=false)

Detailed Description

The namespace provide utility functions.


Function Documentation

void Utils::builder_internal_fetch ( Glib::RefPtr< Gtk::Builder > &  ref,
const char *  file 
)

Fetches ui definitions either from file or from compiled-in glade xml.

Parameters:
refthe builder to add to
filethe file, Freya maintains a lookup table in release mode.
Glib::RefPtr<Gdk::Pixbuf> Utils::create_pixbuf_from_data ( const guchar *  data,
gsize  len,
int  width = 150,
int  height = 150,
bool  aspect = false 
)
std::string Utils::int_to_string ( int  num)

Simply converts any integer to a std::string.

Parameters:
numthe integer
Returns:
a std::string containing just the number (copy for further use!)
Glib::RefPtr<Gdk::Pixbuf> Utils::pixbuf_internal_fetch ( const char *  file,
int  width = 150,
int  height = 150,
bool  aspect = false 
)
Glib::ustring Utils::seconds_to_duration ( unsigned  long)

converts a given time in seconds to a duration ustring

Parameters:
long,durationin seconds to convert
Returns:
duration as ustring, e.g. "4 hours 2 minutes 0 seconds"

Here is the caller graph for this function:

Glib::ustring Utils::seconds_to_timestamp ( const long  )

converts a given time in seconds to a "timestamp"

Parameters:
long,durationin seconds to convert
Returns:
date as ustring, e.g. 2011-04-02

Here is the caller graph for this function: