libabigail
Classes | Typedefs | Functions
abigail::ini Namespace Reference

Namespace for handling ini-style files. More...

Classes

class  config
 The abstraction of the structured content of an .ini file. This roughly follows what is explained at http://en.wikipedia.org/wiki/INI_file. More...
 
class  function_call_expr
 The abstraction of a function call expression. More...
 
class  list_property
 A class representing a list property. More...
 
class  list_property_value
 Abstracts the value of a property representing a list of strings. More...
 
class  property
 The base class of the different kinds of properties of an INI file. More...
 
class  property_value
 Base class of propertie values. More...
 
class  simple_property
 A simple property. That is, one which value is a string_property_value. More...
 
class  string_property_value
 A property value which is a string. More...
 
class  tuple_property
 Abstraction of a tuple property. A tuple property is a property which value is a tuple_property_value. More...
 
class  tuple_property_value
 A property value that is a tuple. More...
 

Typedefs

typedef shared_ptr< configconfig_sptr
 A convenience typedef for a shared pointer to config. More...
 
typedef shared_ptr< function_call_exprfunction_call_expr_sptr
 Convenience typedef for a shared pointer to function_call_expr. More...
 
typedef shared_ptr< list_propertylist_property_sptr
 A convenience typedef for a shared_ptr to a list_property. More...
 
typedef shared_ptr< list_property_valuelist_property_value_sptr
 A convenience typedef for a shared_ptr to list_property_value. More...
 
typedef shared_ptr< propertyproperty_sptr
 Convenience typefef for shared_ptr to property. More...
 
typedef shared_ptr< property_valueproperty_value_sptr
 Convenience typedef for a shared_ptr to property_value. More...
 
typedef shared_ptr< simple_propertysimple_property_sptr
 Convenience typedef for a shared_ptr to an simple_property. More...
 
typedef shared_ptr< string_property_valuestring_property_value_sptr
 A convenience typedef for a shared_ptr to string_property_value. More...
 
typedef shared_ptr< tuple_propertytuple_property_sptr
 Convenience typedef for a shared_ptr of tuple_property. More...
 
typedef shared_ptr< tuple_property_valuetuple_property_value_sptr
 Convenience typedef for a shared_ptr to a tuple_property_value. More...
 

Functions

list_propertyis_list_property (const property *p)
 Test if an instance of a property is actually an instance of list_property. More...
 
list_property_sptr is_list_property (const property_sptr p)
 Test if an instance of a property is actually an instance of list_property. More...
 
list_property_valueis_list_property_value (const property_value *v)
 Test if an instance of @property_value is a list_property_value. More...
 
list_property_value_sptr is_list_property_value (const property_value_sptr &v)
 Test if an instance of @property_value is a list_property_value. More...
 
simple_propertyis_simple_property (const property *p)
 Tests if a property is a simple property. More...
 
simple_property_sptr is_simple_property (const property_sptr p)
 Tests if a property is a simple property. More...
 
string_property_valueis_string_property_value (const property_value *v)
 Test if a given property value is a string property value. More...
 
string_property_value_sptr is_string_property_value (const property_value_sptr v)
 Test if a given property value is a string property value. More...
 
tuple_propertyis_tuple_property (const property *p)
 Test if an instance of property is an instance of tuple_property. More...
 
tuple_property_sptr is_tuple_property (const property_sptr p)
 Test if an instance of property is an instance of tuple_property. More...
 
tuple_property_valueis_tuple_property_value (const property_value *v)
 Test if a given instance of property_value is an instance of tuple_property_value too. More...
 
tuple_property_value_sptr is_tuple_property_value (const property_value_sptr v)
 Test if a given instance of property_value is an instance of tuple_property_value too. More...
 
config_sptr read_config (const string &path)
 Parse an ini config file from an on-disk file. More...
 
bool read_config (const string &path, config &conf)
 Parse an ini config file from a file on disk. More...
 
bool read_config (istream &input, config &conf)
 Parse an ini config file from an input stream. More...
 
config_sptr read_config (std::istream &input)
 Parse an ini config file from an input stream. More...
 
bool read_config (std::istream &input, config &conf)
 
function_call_expr_sptr read_function_call_expr (const string &input)
 Read a function call expression and build its representation. More...
 
bool read_function_call_expr (const string &input, function_call_expr_sptr &expr)
 Read a function call expression and build its representation. More...
 
bool read_function_call_expr (std::istream &input, function_call_expr_sptr &expr)
 Read a function call expression and build its representation. More...
 
bool read_sections (const string &path, config::sections_type &sections)
 Parse the sections of an *.ini file. More...
 
bool read_sections (std::istream &input, config::sections_type &sections)
 Parse the sections of an *.ini file. More...
 
bool write_config (const config &conf, const string &path)
 Serialize an instance of conf to an on-disk file. More...
 
bool write_config (const config &conf, std::ostream &output)
 Serialize an instance of config to an output stream. More...
 
bool write_sections (const config::sections_type &sections, const string &path)
 Serialize a vector of sections that make up an ini config to a file. More...
 
bool write_sections (const config::sections_type &sections, std::ostream &out)
 Serialize a vector of sections that make up an ini config file to an output stream. More...
 

Detailed Description

Namespace for handling ini-style files.

Typedef Documentation

◆ config_sptr

typedef shared_ptr<config> config_sptr

A convenience typedef for a shared pointer to config.

Definition at line 316 of file abg-ini.h.

◆ function_call_expr_sptr

Convenience typedef for a shared pointer to function_call_expr.

Definition at line 430 of file abg-ini.h.

◆ list_property_sptr

typedef shared_ptr<list_property> list_property_sptr

A convenience typedef for a shared_ptr to a list_property.

Definition at line 244 of file abg-ini.h.

◆ list_property_value_sptr

A convenience typedef for a shared_ptr to list_property_value.

Definition at line 130 of file abg-ini.h.

◆ property_sptr

typedef shared_ptr<property> property_sptr

Convenience typefef for shared_ptr to property.

Definition at line 36 of file abg-ini.h.

◆ property_value_sptr

typedef shared_ptr<property_value> property_value_sptr

Convenience typedef for a shared_ptr to property_value.

Definition at line 63 of file abg-ini.h.

◆ simple_property_sptr

Convenience typedef for a shared_ptr to an simple_property.

Definition at line 206 of file abg-ini.h.

◆ string_property_value_sptr

A convenience typedef for a shared_ptr to string_property_value.

Definition at line 97 of file abg-ini.h.

◆ tuple_property_sptr

typedef shared_ptr<tuple_property> tuple_property_sptr

Convenience typedef for a shared_ptr of tuple_property.

Definition at line 282 of file abg-ini.h.

◆ tuple_property_value_sptr

Convenience typedef for a shared_ptr to a tuple_property_value.

Definition at line 170 of file abg-ini.h.

Function Documentation

◆ is_list_property() [1/2]

list_property * is_list_property ( const property p)

Test if an instance of a property is actually an instance of list_property.

Parameters
pthe property to test.
Returns
the p converted into a list_property if it's of type list_property, or nil otherwise.

Definition at line 686 of file abg-ini.cc.

◆ is_list_property() [2/2]

list_property_sptr is_list_property ( const property_sptr  p)

Test if an instance of a property is actually an instance of list_property.

Parameters
pthe property to test.
Returns
the p converted into a list_property if it's of type list_property, or nil otherwise.

Definition at line 697 of file abg-ini.cc.

◆ is_list_property_value() [1/2]

list_property_value * is_list_property_value ( const property_value v)

Test if an instance of @property_value is a list_property_value.

Parameters
vthe property_value to consider.
Returns
the property_value converted into a list_property_value if the v is a list_property_value, nil otherwise.

Definition at line 437 of file abg-ini.cc.

◆ is_list_property_value() [2/2]

list_property_value_sptr is_list_property_value ( const property_value_sptr v)

Test if an instance of @property_value is a list_property_value.

Parameters
vthe property_value to consider.
Returns
the property_value converted into a list_property_value if the v is a list_property_value, nil otherwise.

Definition at line 448 of file abg-ini.cc.

◆ is_simple_property() [1/2]

simple_property * is_simple_property ( const property p)

Tests if a property is a simple property.

Returns
a pointer to the simple_property sub-object of the property instance, iff it's an simple_property instance.

Definition at line 619 of file abg-ini.cc.

◆ is_simple_property() [2/2]

simple_property_sptr is_simple_property ( const property_sptr  p)

Tests if a property is a simple property.

Returns
a smart pointer to the simple_property sub-object of the property instance, iff it's an simple_property instance.

Definition at line 628 of file abg-ini.cc.

◆ is_string_property_value() [1/2]

string_property_value * is_string_property_value ( const property_value v)

Test if a given property value is a string property value.

Returns
a pointer to the string_property_value sub-object of the property_value instance, if it's an instance of string_property_value too.

Definition at line 341 of file abg-ini.cc.

◆ is_string_property_value() [2/2]

string_property_value_sptr is_string_property_value ( const property_value_sptr  v)

Test if a given property value is a string property value.

Returns
a pointer to the string_property_value sub-object of the property_value instance, if it's an instance of string_property_value too.

Definition at line 350 of file abg-ini.cc.

◆ is_tuple_property() [1/2]

tuple_property * is_tuple_property ( const property p)

Test if an instance of property is an instance of tuple_property.

Parameters
pthe instance of property to test for.
Returns
return a pointer to the sub-object of tuple_property iff p is an instance of tuple_property.

Definition at line 757 of file abg-ini.cc.

◆ is_tuple_property() [2/2]

tuple_property_sptr is_tuple_property ( const property_sptr  p)

Test if an instance of property is an instance of tuple_property.

Parameters
pthe instance of property to test for.
Returns
return a smart pointer to the sub-object of tuple_property iff p is an instance of tuple_property.

Definition at line 768 of file abg-ini.cc.

◆ is_tuple_property_value() [1/2]

tuple_property_value * is_tuple_property_value ( const property_value v)

Test if a given instance of property_value is an instance of tuple_property_value too.

Returns
the tuple_property_value sub-object of the property_value instance, if it's an instance of tuple_property_value too.

Definition at line 525 of file abg-ini.cc.

◆ is_tuple_property_value() [2/2]

tuple_property_value_sptr is_tuple_property_value ( const property_value_sptr  v)

Test if a given instance of property_value is an instance of tuple_property_value too.

Returns
the tuple_property_value sub-object of the property_value instance, if it's an instance of tuple_property_value too.

Definition at line 535 of file abg-ini.cc.

◆ read_config() [1/4]

config_sptr read_config ( const string &  path)

Parse an ini config file from an on-disk file.

Returns
a shared pointer to the resulting config, or nil if it couldn't be parsed.

Definition at line 1796 of file abg-ini.cc.

◆ read_config() [2/4]

bool read_config ( const string &  path,
config conf 
)

Parse an ini config file from a file on disk.

Parameters
paththe path to the ini file to parse.
confthe resulting config file to populate as a result of the parsing. This is populated iff the function returns true.
Returns
true upon succcessful completion.

Definition at line 1766 of file abg-ini.cc.

◆ read_config() [3/4]

bool abigail::ini::read_config ( istream &  input,
config conf 
)

Parse an ini config file from an input stream.

Parameters
inputthe input stream to parse the ini config file from.
Returns
true upon successful parsing.

Definition at line 1747 of file abg-ini.cc.

◆ read_config() [4/4]

config_sptr read_config ( std::istream &  input)

Parse an ini config file from an input stream.

Returns
a shared pointer to the resulting config, or nil if it couldn't be parsed.

Definition at line 1782 of file abg-ini.cc.

◆ read_function_call_expr() [1/3]

function_call_expr_sptr read_function_call_expr ( const string &  input)

Read a function call expression and build its representation.

Parameters
inputa string where to read the function call expression from.
Returns
the representation of the expression resulting from the parsing.

Definition at line 2050 of file abg-ini.cc.

◆ read_function_call_expr() [2/3]

bool read_function_call_expr ( const string &  input,
function_call_expr_sptr expr 
)

Read a function call expression and build its representation.

Parameters
inputa string where to read the function call expression from.
exprthe expression resulting from the parsing. This is an output parameter that is set iff this function returns true.
Returns
true iff the parameter expr is successfully set with the resulting of parsing the input.

Definition at line 2035 of file abg-ini.cc.

◆ read_function_call_expr() [3/3]

bool read_function_call_expr ( std::istream &  input,
function_call_expr_sptr expr 
)

Read a function call expression and build its representation.

Parameters
inputthe input stream where to read the function call expression from.
exprthe expression resulting from the parsing. This is an output parameter that is set iff this function returns true.
Returns
true iff the parameter expr is successfully set with the resulting of parsing the input.

Definition at line 2017 of file abg-ini.cc.

◆ read_sections() [1/2]

bool read_sections ( const string &  path,
config::sections_type sections 
)

Parse the sections of an *.ini file.

Parameters
paththe path of the ini file to parse.
sectionout parameter. This is set to the vector of sections that have been parsed from the input stream.
Returns
true upon successful completion and if if the stream is left in a non-erratic state.

Definition at line 1728 of file abg-ini.cc.

◆ read_sections() [2/2]

bool read_sections ( std::istream &  input,
config::sections_type sections 
)

Parse the sections of an *.ini file.

Parameters
inputthe input stream to parse the ini file from.
sectionout parameter. This is set to the vector of sections that have been parsed from the input stream.
Returns
true upon successful completion and if if the stream is left in a non-erratic state.

Definition at line 1701 of file abg-ini.cc.

◆ write_config() [1/2]

bool write_config ( const config conf,
const string &  path 
)

Serialize an instance of conf to an on-disk file.

Parameters
confthe instance of config to serialize.
paththe path to the on-disk file to serialize to.
Returns
true upon successful completion.

Definition at line 1943 of file abg-ini.cc.

◆ write_config() [2/2]

bool write_config ( const config conf,
std::ostream &  output 
)

Serialize an instance of config to an output stream.

Parameters
confthe instance of config to serialize.
outputthe output stream to serialize conf to.
Returns
true upon successful completion.

Definition at line 1927 of file abg-ini.cc.

◆ write_sections() [1/2]

bool write_sections ( const config::sections_type sections,
const string &  path 
)

Serialize a vector of sections that make up an ini config to a file.

Parameters
sectionsthe vector of sections to serialize.
outthe output stream.
Returns
true if the output stream is left in a non-erratic state.

Definition at line 1904 of file abg-ini.cc.

◆ write_sections() [2/2]

bool write_sections ( const config::sections_type sections,
std::ostream &  out 
)

Serialize a vector of sections that make up an ini config file to an output stream.

Note that an ini config is just a collection of sections.

Parameters
sectionsthe vector of sections to serialize.
outthe output stream.
Returns
true if the output stream is left in a non-erratic state.

Definition at line 1882 of file abg-ini.cc.