LMMS
Loading...
Searching...
No Matches
calf_utils Namespace Reference

Classes

struct  config_exception
struct  config_listener_iface
struct  config_notifier_iface
struct  config_db_iface
class  gkeyfile_config_db
struct  gui_config
class  ptmutex
 Pthreads based mutex class. More...
class  ptlock_base
class  ptlock
 Exception-safe mutex lock. More...
class  pttrylock
 Exception-safe polling mutex lock. More...
class  scope_assign
 Exception-safe temporary assignment. More...
struct  text_exception
struct  file_exception
struct  direntry
 List contents of a directory. More...

Typedefs

typedef std::map< std::string, std::string > dictionary
 String-to-string mapping.

Functions

std::string encode_map (const dictionary &data)
 Serialize a dictionary to a string.
void decode_map (dictionary &data, const std::string &src)
 Deserialize a dictionary from a string.
std::string i2s (int value)
 int-to-string
std::string f2s (double value)
 float-to-string
std::string ff2s (double value)
 float-to-string-that-doesn't-resemble-an-int
std::string to_xml_attr (const std::string &key, const std::string &value)
 Encode a key-value pair as XML attribute.
std::string xml_escape (const std::string &src)
 Escape a string to be used in XML file.
std::string load_file (const std::string &src)
 Load file from disk into a std::string blob, or throw file_exception.
std::string indent (const std::string &src, const std::string &indent)
 Indent a string by another string (prefix each line).
std::vector< direntrylist_directory (const std::string &path)
void decode_map (dictionary &data, const string &src)
vector< direntrylist_directory (const string &path)

Typedef Documentation

◆ dictionary

typedef std::map<std::string, std::string> calf_utils::dictionary

String-to-string mapping.

Function Documentation

◆ decode_map() [1/2]

void calf_utils::decode_map ( dictionary & data,
const std::string & src )
extern

Deserialize a dictionary from a string.

◆ decode_map() [2/2]

void calf_utils::decode_map ( dictionary & data,
const string & src )

◆ encode_map()

string calf_utils::encode_map ( const dictionary & data)
extern

Serialize a dictionary to a string.

◆ f2s()

std::string calf_utils::f2s ( double value)
extern

float-to-string

◆ ff2s()

std::string calf_utils::ff2s ( double value)
extern

float-to-string-that-doesn't-resemble-an-int

◆ i2s()

std::string calf_utils::i2s ( int value)
extern

int-to-string

◆ indent()

std::string calf_utils::indent ( const std::string & src,
const std::string & indent )

Indent a string by another string (prefix each line).

◆ list_directory() [1/2]

std::vector< direntry > calf_utils::list_directory ( const std::string & path)

◆ list_directory() [2/2]

vector< direntry > calf_utils::list_directory ( const string & path)

◆ load_file()

std::string calf_utils::load_file ( const std::string & src)

Load file from disk into a std::string blob, or throw file_exception.

◆ to_xml_attr()

std::string calf_utils::to_xml_attr ( const std::string & key,
const std::string & value )

Encode a key-value pair as XML attribute.

◆ xml_escape()

std::string calf_utils::xml_escape ( const std::string & src)

Escape a string to be used in XML file.