![]() |
TSDuck v3.46-4930
MPEG Transport Stream Toolkit
|
#include <tsDuckConfigFile.h>


Public Types | |
| enum | FileStyle { LOCAL_SYSTEM , UNIX_STYLE , WINDOWS_STYLE } |
Public Member Functions | |
| void | clear () |
| void | deleteSection (const UString &name) |
| fs::path | fileName () const |
| void | getSectionNames (UStringVector &names) const |
| void | getValues (const UString &entry, UStringVector &values) const |
| bool | hasSection (const UString &name) const |
| bool | isLoaded () const |
| bool | load (const fs::path &filename, Report &report=(ts::CerrReport::Instance())) |
| bool | merge (const fs::path &filename, Report &report=(ts::CerrReport::Instance())) |
| void | merge (std::istream &strm) |
| ConfigSection & | operator[] (const UString &name) |
| const ConfigSection & | operator[] (const UString &name) const |
| bool | save (const fs::path &filename=UString(), Report &report=(ts::CerrReport::Instance())) const |
| std::ostream & | save (std::ostream &strm) const |
| ConfigSection & | section (const UString &name) |
| const ConfigSection & | section (const UString &name) const |
| size_t | size () const |
| UString | value (const UString &entry, const UString &defvalue=UString()) const |
Static Public Member Functions | |
| static fs::path | DefaultFileName (FileStyle style=LOCAL_SYSTEM, const UString &app_name=UString()) |
| static DuckConfigFile & | Instance () |
| Get the instance of the singleton of this class. | |
A singleton which contains the TSDuck configuration file.
|
inherited |
|
static |
Get the instance of the singleton of this class.
| UString ts::DuckConfigFile::value | ( | const UString & | entry, |
| const UString & | defvalue = UString() ) const |
Get the value of an entry. A section with the name of the executable is searched first. Then, the global section is used.
| [in] | entry | Entry name. |
| [in] | defvalue | Default value. |
| void ts::DuckConfigFile::getValues | ( | const UString & | entry, |
| UStringVector & | values ) const |
Get all values of an entry. A section with the name of the executable is searched first. Then, the global section is used.
| [in] | entry | Entry name. |
| [out] | values | Vector of values. |
|
staticinherited |
Get the default configuration file name.
| [in] | style | System style for file name. |
| [in] | app_name | Application name (default: executable base name). |
|
inlineinherited |
Get the latest loaded file.
|
inlineinherited |
Check if the last load operation succeeded (including in the constructor).
|
inherited |
Reload the configuration from a file.
| [in] | filename | A file name to read. |
| [in,out] | report | Where to report errors. |
|
inherited |
Merge the configuration from a file. The values which are read from the specified file override previous values.
| [in] | filename | A file name to read. |
| [in,out] | report | Where to report errors. |
|
inherited |
Merge the configuration from a file. The values which are read from the specified file override previous values.
| [in,out] | strm | Opened input text stream to read the configuration file. |
|
inherited |
|
inherited |
Save a configuration file in a stream
| [in,out] | strm | Opened output text stream to write the configuration file. |
|
inlineinherited |
Clear the content of the configuration.
|
inlineinherited |
Get the number of sections in the file.
|
inlineinherited |
Check if a section exists.
| [in] | name | The section name. |
|
inherited |
Get the names of all sections.
| [out] | names | Returned names of all sections. |
|
inlineinherited |
Get a reference to a section inside the configuration file instance. Create the section if it does not exist.
| [in] | name | The section name. |
|
inherited |
Get a reference to a section inside the configuration file instance.
| [in] | name | The section name. |
|
inlineinherited |
Index operator: get a reference to a section inside the configuration file instance. Create the section if it does not exist.
| [in] | name | The section name. |
|
inlineinherited |
Index operator: get a reference to a section inside the configuration file instance.
| [in] | name | The section name. |
|
inlineinherited |
Delete a section.
| [in] | name | The section name to delete. |