TSDuck v3.40-3963
MPEG Transport Stream Toolkit
|
Representation of a "configuration section". More...
#include <tsConfigSection.h>
Public Member Functions | |
ConfigSection ()=default | |
Constructor. | |
void | append (const UString &entry, bool val) |
Append a boolean value to an entry. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
void | append (const UString &entry, const INT &val) |
Append an integer value to an entry. | |
void | append (const UString &entry, const std::vector< bool > &val) |
Append a vector of booleans to an entry. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
void | append (const UString &entry, const std::vector< INT > &val) |
Append a vector of integers to an entry. | |
void | append (const UString &entry, const UChar *val) |
Append a string value to an entry. | |
void | append (const UString &entry, const UString &val) |
Append a string value to an entry. | |
void | append (const UString &entry, const UStringVector &val) |
Append a vector of strings to an entry. | |
bool | boolValue (const UString &entry, size_t index=0, bool defvalue=false) const |
Get a boolean value in an entry. | |
void | deleteEntry (const UString &entry) |
Delete an entry. | |
size_t | entryCount () const |
Get the number of entries in the section. | |
void | getEntryNames (UStringVector &names) const |
Get the names of all entries in the section. | |
void | reset () |
Reset content of the section. | |
std::ostream & | save (std::ostream &strm) const |
Save the content of the section in a text streams. | |
void | set (const UString &entry, bool val) |
Set the boolean value of an entry. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
void | set (const UString &entry, const INT &val) |
Set the integer value of an entry. | |
void | set (const UString &entry, const std::vector< bool > &val) |
Set the value of an entry from a vector of booleans. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
void | set (const UString &entry, const std::vector< INT > &val) |
Set the value of an entry from a vector of integers. | |
void | set (const UString &entry, const UChar *val) |
Set the string value of an entry. | |
void | set (const UString &entry, const UString &val) |
Set the string value of an entry. | |
void | set (const UString &entry, const UStringVector &val) |
Set the value of an entry from a vector of strings. | |
template<typename INT , typename std::enable_if< std::is_integral< INT >::value >::type * = nullptr> | |
INT | value (const UString &entry, size_t index=0, const INT &defvalue=static_cast< INT >(0)) const |
Get an integer value in an entry. | |
UString | value (const UString &entry, size_t index=0, const UString &defvalue=UString()) const |
Get a value in an entry. | |
size_t | valueCount (const UString &entry) const |
Get the number of values in an entry. | |
Representation of a "configuration section".
A configuration section contains a list of "entries". Each entry has one or more values. A value can be interpreted as a string, integer or boolean.
|
inline |
Get the number of entries in the section.
void ts::ConfigSection::getEntryNames | ( | UStringVector & | names | ) | const |
Get the names of all entries in the section.
[out] | names | The returned names of all entries in the section. |
Get the number of values in an entry.
[in] | entry | Entry name. |
UString ts::ConfigSection::value | ( | const UString & | entry, |
size_t | index = 0 , |
||
const UString & | defvalue = UString() |
||
) | const |
Get a value in an entry.
[in] | entry | Entry name. |
[in] | index | Index of the value in the entry. |
[in] | defvalue | Default value. |
INT ts::ConfigSection::value | ( | const UString & | entry, |
size_t | index = 0 , |
||
const INT & | defvalue = static_cast<INT>(0) |
||
) | const |
Get an integer value in an entry.
INT | An integer type. |
[in] | entry | Entry name. |
[in] | index | Index of the value in the entry. |
[in] | defvalue | Default value. |
bool ts::ConfigSection::boolValue | ( | const UString & | entry, |
size_t | index = 0 , |
||
bool | defvalue = false |
||
) | const |
Get a boolean value in an entry.
[in] | entry | Entry name. |
[in] | index | Index of the value in the entry. |
[in] | defvalue | Default value. |
Delete an entry.
[in] | entry | Entry name. |
Set the string value of an entry.
[in] | entry | Entry name. |
[in] | val | The value to set. |
Set the string value of an entry.
[in] | entry | Entry name. |
[in] | val | The value to set. |
void ts::ConfigSection::set | ( | const UString & | entry, |
const UStringVector & | val | ||
) |
Set the value of an entry from a vector of strings.
[in] | entry | Entry name. |
[in] | val | The values to set. |
void ts::ConfigSection::set | ( | const UString & | entry, |
bool | val | ||
) |
Set the boolean value of an entry.
[in] | entry | Entry name. |
[in] | val | The value to set. |
void ts::ConfigSection::set | ( | const UString & | entry, |
const std::vector< bool > & | val | ||
) |
Set the value of an entry from a vector of booleans.
[in] | entry | Entry name. |
[in] | val | The values to set. |
|
inline |
Set the integer value of an entry.
INT | An integer type. |
[in] | entry | Entry name. |
[in] | val | The value to set. |
Set the value of an entry from a vector of integers.
INT | An integer type. |
[in] | entry | Entry name. |
[in] | val | The values to set. |
Append a string value to an entry.
[in] | entry | Entry name. |
[in] | val | The value to set. |
Append a string value to an entry.
[in] | entry | Entry name. |
[in] | val | The value to set. |
void ts::ConfigSection::append | ( | const UString & | entry, |
const UStringVector & | val | ||
) |
Append a vector of strings to an entry.
[in] | entry | Entry name. |
[in] | val | The values to append. |
Append a boolean value to an entry.
[in] | entry | Entry name. |
[in] | val | The value to append. |
Append a vector of booleans to an entry.
[in] | entry | Entry name. |
[in] | val | The values to append. |
Append an integer value to an entry.
INT | An integer type. |
[in] | entry | Entry name. |
[in] | val | The value to append. |
Append a vector of integers to an entry.
INT | An integer type. |
[in] | entry | Entry name. |
[in] | val | The values to append. |
std::ostream & ts::ConfigSection::save | ( | std::ostream & | strm | ) | const |
Save the content of the section in a text streams.
[in,out] | strm | An standard stream in output mode. |