| |
- pybind11_builtins.pybind11_object(builtins.object)
-
- CConfigFileBase
-
- CConfigFile
- CConfigFileMemory
- CConfigFilePrefixer
- CLoadableOptions
class CConfigFile(CConfigFileBase) |
|
This class allows loading and storing values and vectors of different types
from ".ini" files easily.
The contents of the file will be modified by "write" operations in memory,
and will be saved back
to the file at the destructor, and only if at least one write operation
has been applied.
Use base class `CConfigFileBase`'s methods
`read_{int,float,double,string,...}()` and `write()` to actually read and
write values.
See: |
|
- Method resolution order:
- CConfigFile
- CConfigFileBase
- pybind11_builtins.pybind11_object
- builtins.object
Methods defined here:
- __init__(...)
- __init__(*args, **kwargs)
Overloaded function.
1. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFile, fileName: str) -> None
2. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
3. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFile, arg0: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
4. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFile, arg0: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
- assign(...)
- assign(self: mrpt.pymrpt.mrpt.config.CConfigFile, : mrpt.pymrpt.mrpt.config.CConfigFile) -> mrpt.pymrpt.mrpt.config.CConfigFile
C++: mrpt::config::CConfigFile::operator=(const class mrpt::config::CConfigFile &) --> class mrpt::config::CConfigFile &
- clear(...)
- clear(self: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
Empties the "config file"
C++: mrpt::config::CConfigFile::clear() --> void
- discardSavingChanges(...)
- discardSavingChanges(self: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
Discard saving (current) changes to physical file upon destruction
C++: mrpt::config::CConfigFile::discardSavingChanges() --> void
- getAllKeys(...)
- getAllKeys(self: mrpt.pymrpt.mrpt.config.CConfigFile, section: str, keys: List[str]) -> None
Returs a list with all the keys into a section.
C++: mrpt::config::CConfigFile::getAllKeys(const std::string &, class std::vector<std::string > &) const --> void
- getAllSections(...)
- getAllSections(self: mrpt.pymrpt.mrpt.config.CConfigFile, sections: List[str]) -> None
Returns a list with all the section names.
C++: mrpt::config::CConfigFile::getAllSections(class std::vector<std::string > &) const --> void
- getAssociatedFile(...)
- getAssociatedFile(self: mrpt.pymrpt.mrpt.config.CConfigFile) -> str
Returns the file currently open by this object.
C++: mrpt::config::CConfigFile::getAssociatedFile() const --> std::string
- setFileName(...)
- setFileName(self: mrpt.pymrpt.mrpt.config.CConfigFile, fil_path: str) -> None
Associate this object with the given file, reading its contents right
now. Upon destruction, the updated contents will be written to that file.
C++: mrpt::config::CConfigFile::setFileName(const std::string &) --> void
- writeNow(...)
- writeNow(self: mrpt.pymrpt.mrpt.config.CConfigFile) -> None
Dumps the changes to the physical configuration file now, not waiting
until destruction.
std::runtime_error Upon error writing.
C++: mrpt::config::CConfigFile::writeNow() --> void
Methods inherited from CConfigFileBase:
- getContentAsYAML(...)
- getContentAsYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> str
Returns a text block representing the contents of the config file in
YAML format.
setContentFromYAML()
C++: mrpt::config::CConfigFileBase::getContentAsYAML() const --> std::string
- keyExists(...)
- keyExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, key: str) -> bool
Checks if a given key exists inside a section (case insensitive)
sectionExists()
C++: mrpt::config::CConfigFileBase::keyExists(const std::string &, const std::string &) const --> bool
- read_bool(...)
- read_bool(*args, **kwargs)
Overloaded function.
1. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool) -> bool
2. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool, failIfNotFound: bool) -> bool
C++: mrpt::config::CConfigFileBase::read_bool(const std::string &, const std::string &, bool, bool) const --> bool
- read_double(...)
- read_double(*args, **kwargs)
Overloaded function.
1. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
not found and `failIfNotFound`=true
@{
C++: mrpt::config::CConfigFileBase::read_double(const std::string &, const std::string &, double, bool) const --> double
- read_enum(...)
- read_enum(*args, **kwargs)
Overloaded function.
1. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod) -> mrpt::bayes::TKFMethod
2. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod, failIfNotFound: bool) -> mrpt::bayes::TKFMethod
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::bayes::TKFMethod &, bool) const --> enum mrpt::bayes::TKFMethod
3. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
4. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel, failIfNotFound: bool) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::system::VerbosityLevel &, bool) const --> enum mrpt::system::VerbosityLevel
- read_float(...)
- read_float(*args, **kwargs)
Overloaded function.
1. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
C++: mrpt::config::CConfigFileBase::read_float(const std::string &, const std::string &, float, bool) const --> float
- read_int(...)
- read_int(*args, **kwargs)
Overloaded function.
1. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_int(const std::string &, const std::string &, int, bool) const --> int
- read_string(...)
- read_string(*args, **kwargs)
Overloaded function.
1. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
C++: mrpt::config::CConfigFileBase::read_string(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_string_first_word(...)
- read_string_first_word(*args, **kwargs)
Overloaded function.
1. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
Reads a configuration parameter of type "string", and keeps only the
first word (this can be used to eliminate possible comments at the end of
the line)
C++: mrpt::config::CConfigFileBase::read_string_first_word(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_uint64_t(...)
- read_uint64_t(*args, **kwargs)
Overloaded function.
1. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_uint64_t(const std::string &, const std::string &, uint64_t, bool) const --> uint64_t
- sectionExists(...)
- sectionExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section_name: str) -> bool
Checks if a given section exists (name is case insensitive)
keyExists()
C++: mrpt::config::CConfigFileBase::sectionExists(const std::string &) const --> bool
- setContentFromYAML(...)
- setContentFromYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, yaml_block: str) -> None
Changes the contents of the virtual "config file" from a text block
containing a YAML configuration text. Refer to unit test
yaml2config_unittest.cpp for examples of use.
getContentAsYAML()
C++: mrpt::config::CConfigFileBase::setContentFromYAML(const std::string &) --> void
- write(...)
- write(*args, **kwargs)
Overloaded function.
1. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
2. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
3. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
4. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, double, const int, const int, const std::string &) --> void
5. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
6. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
7. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
8. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, float, const int, const int, const std::string &) --> void
Static methods inherited from pybind11_builtins.pybind11_object:
- __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
- Create and return a new object. See help(type) for accurate signature.
|
class CConfigFileBase(pybind11_builtins.pybind11_object) |
|
This class allows loading and storing values and vectors of different types
from a configuration text, which can be implemented as a ".ini" file, a
memory-stored string, etc...
This is a virtual class, use only as a pointer to an implementation of one
of the derived classes.
See: |
|
- Method resolution order:
- CConfigFileBase
- pybind11_builtins.pybind11_object
- builtins.object
Methods defined here:
- __init__(...)
- __init__(*args, **kwargs)
Overloaded function.
1. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, arg0: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> None
2. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> None
- assign(...)
- assign(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, : mrpt.pymrpt.mrpt.config.CConfigFileBase) -> mrpt.pymrpt.mrpt.config.CConfigFileBase
C++: mrpt::config::CConfigFileBase::operator=(const class mrpt::config::CConfigFileBase &) --> class mrpt::config::CConfigFileBase &
- clear(...)
- clear(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> None
Empties the "config file"
C++: mrpt::config::CConfigFileBase::clear() --> void
- getAllKeys(...)
- getAllKeys(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, keys: List[str]) -> None
Returs a list with all the keys into a section
C++: mrpt::config::CConfigFileBase::getAllKeys(const std::string &, class std::vector<std::string > &) const --> void
- getAllSections(...)
- getAllSections(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, sections: List[str]) -> None
Returns a list with all the section names.
C++: mrpt::config::CConfigFileBase::getAllSections(class std::vector<std::string > &) const --> void
- getContentAsYAML(...)
- getContentAsYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> str
Returns a text block representing the contents of the config file in
YAML format.
setContentFromYAML()
C++: mrpt::config::CConfigFileBase::getContentAsYAML() const --> std::string
- keyExists(...)
- keyExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, key: str) -> bool
Checks if a given key exists inside a section (case insensitive)
sectionExists()
C++: mrpt::config::CConfigFileBase::keyExists(const std::string &, const std::string &) const --> bool
- read_bool(...)
- read_bool(*args, **kwargs)
Overloaded function.
1. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool) -> bool
2. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool, failIfNotFound: bool) -> bool
C++: mrpt::config::CConfigFileBase::read_bool(const std::string &, const std::string &, bool, bool) const --> bool
- read_double(...)
- read_double(*args, **kwargs)
Overloaded function.
1. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
not found and `failIfNotFound`=true
@{
C++: mrpt::config::CConfigFileBase::read_double(const std::string &, const std::string &, double, bool) const --> double
- read_enum(...)
- read_enum(*args, **kwargs)
Overloaded function.
1. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod) -> mrpt::bayes::TKFMethod
2. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod, failIfNotFound: bool) -> mrpt::bayes::TKFMethod
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::bayes::TKFMethod &, bool) const --> enum mrpt::bayes::TKFMethod
3. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
4. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel, failIfNotFound: bool) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::system::VerbosityLevel &, bool) const --> enum mrpt::system::VerbosityLevel
- read_float(...)
- read_float(*args, **kwargs)
Overloaded function.
1. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
C++: mrpt::config::CConfigFileBase::read_float(const std::string &, const std::string &, float, bool) const --> float
- read_int(...)
- read_int(*args, **kwargs)
Overloaded function.
1. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_int(const std::string &, const std::string &, int, bool) const --> int
- read_string(...)
- read_string(*args, **kwargs)
Overloaded function.
1. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
C++: mrpt::config::CConfigFileBase::read_string(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_string_first_word(...)
- read_string_first_word(*args, **kwargs)
Overloaded function.
1. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
Reads a configuration parameter of type "string", and keeps only the
first word (this can be used to eliminate possible comments at the end of
the line)
C++: mrpt::config::CConfigFileBase::read_string_first_word(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_uint64_t(...)
- read_uint64_t(*args, **kwargs)
Overloaded function.
1. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_uint64_t(const std::string &, const std::string &, uint64_t, bool) const --> uint64_t
- sectionExists(...)
- sectionExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section_name: str) -> bool
Checks if a given section exists (name is case insensitive)
keyExists()
C++: mrpt::config::CConfigFileBase::sectionExists(const std::string &) const --> bool
- setContentFromYAML(...)
- setContentFromYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, yaml_block: str) -> None
Changes the contents of the virtual "config file" from a text block
containing a YAML configuration text. Refer to unit test
yaml2config_unittest.cpp for examples of use.
getContentAsYAML()
C++: mrpt::config::CConfigFileBase::setContentFromYAML(const std::string &) --> void
- write(...)
- write(*args, **kwargs)
Overloaded function.
1. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
2. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
3. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
4. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, double, const int, const int, const std::string &) --> void
5. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
6. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
7. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
8. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, float, const int, const int, const std::string &) --> void
Static methods inherited from pybind11_builtins.pybind11_object:
- __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
- Create and return a new object. See help(type) for accurate signature.
|
class CConfigFileMemory(CConfigFileBase) |
|
This class implements a config file-like interface over a memory-stored
string list.
Use base class `CConfigFileBase`'s methods
`read_{int,float,double,string,...}()` and `write()` to actually read and
write values.
It can also parse a YAML text block and expose its fields (up to the first
level of hierarchy, as allowed by INI-like files). This can be used to port
MRPT classes relying on INI files to using YAML files transparently.
This feature required building MRPT with yaml-cpp, and is provided by
CConfigFileMemory::setContentFromYAML().
See:
YAML support was introduced in MRPT 1.9.9 |
|
- Method resolution order:
- CConfigFileMemory
- CConfigFileBase
- pybind11_builtins.pybind11_object
- builtins.object
Methods defined here:
- __init__(...)
- __init__(*args, **kwargs)
Overloaded function.
1. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> None
2. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, stringList: List[str]) -> None
3. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, str: str) -> None
4. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, arg0: mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> None
5. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, arg0: mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> None
- assign(...)
- assign(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, : mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> mrpt.pymrpt.mrpt.config.CConfigFileMemory
C++: mrpt::config::CConfigFileMemory::operator=(const class mrpt::config::CConfigFileMemory &) --> class mrpt::config::CConfigFileMemory &
- clear(...)
- clear(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> None
Empties the virtual "config file"
C++: mrpt::config::CConfigFileMemory::clear() --> void
- getAllKeys(...)
- getAllKeys(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, section: str, keys: List[str]) -> None
Returs a list with all the keys into a section
C++: mrpt::config::CConfigFileMemory::getAllKeys(const std::string &, class std::vector<std::string > &) const --> void
- getAllSections(...)
- getAllSections(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, sections: List[str]) -> None
Returns a list with all the section names
C++: mrpt::config::CConfigFileMemory::getAllSections(class std::vector<std::string > &) const --> void
- getContent(...)
- getContent(*args, **kwargs)
Overloaded function.
1. getContent(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, str: str) -> None
Return the current contents of the virtual "config file"
C++: mrpt::config::CConfigFileMemory::getContent(std::string &) const --> void
2. getContent(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory) -> str
C++: mrpt::config::CConfigFileMemory::getContent() const --> std::string
- setContent(...)
- setContent(*args, **kwargs)
Overloaded function.
1. setContent(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, stringList: List[str]) -> None
Changes the contents of the virtual "config file"
C++: mrpt::config::CConfigFileMemory::setContent(const class std::vector<std::string > &) --> void
2. setContent(self: mrpt.pymrpt.mrpt.config.CConfigFileMemory, str: str) -> None
Changes the contents of the virtual "config file"
C++: mrpt::config::CConfigFileMemory::setContent(const std::string &) --> void
Methods inherited from CConfigFileBase:
- getContentAsYAML(...)
- getContentAsYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> str
Returns a text block representing the contents of the config file in
YAML format.
setContentFromYAML()
C++: mrpt::config::CConfigFileBase::getContentAsYAML() const --> std::string
- keyExists(...)
- keyExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, key: str) -> bool
Checks if a given key exists inside a section (case insensitive)
sectionExists()
C++: mrpt::config::CConfigFileBase::keyExists(const std::string &, const std::string &) const --> bool
- read_bool(...)
- read_bool(*args, **kwargs)
Overloaded function.
1. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool) -> bool
2. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool, failIfNotFound: bool) -> bool
C++: mrpt::config::CConfigFileBase::read_bool(const std::string &, const std::string &, bool, bool) const --> bool
- read_double(...)
- read_double(*args, **kwargs)
Overloaded function.
1. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
not found and `failIfNotFound`=true
@{
C++: mrpt::config::CConfigFileBase::read_double(const std::string &, const std::string &, double, bool) const --> double
- read_enum(...)
- read_enum(*args, **kwargs)
Overloaded function.
1. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod) -> mrpt::bayes::TKFMethod
2. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod, failIfNotFound: bool) -> mrpt::bayes::TKFMethod
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::bayes::TKFMethod &, bool) const --> enum mrpt::bayes::TKFMethod
3. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
4. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel, failIfNotFound: bool) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::system::VerbosityLevel &, bool) const --> enum mrpt::system::VerbosityLevel
- read_float(...)
- read_float(*args, **kwargs)
Overloaded function.
1. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
C++: mrpt::config::CConfigFileBase::read_float(const std::string &, const std::string &, float, bool) const --> float
- read_int(...)
- read_int(*args, **kwargs)
Overloaded function.
1. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_int(const std::string &, const std::string &, int, bool) const --> int
- read_string(...)
- read_string(*args, **kwargs)
Overloaded function.
1. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
C++: mrpt::config::CConfigFileBase::read_string(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_string_first_word(...)
- read_string_first_word(*args, **kwargs)
Overloaded function.
1. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
Reads a configuration parameter of type "string", and keeps only the
first word (this can be used to eliminate possible comments at the end of
the line)
C++: mrpt::config::CConfigFileBase::read_string_first_word(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_uint64_t(...)
- read_uint64_t(*args, **kwargs)
Overloaded function.
1. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_uint64_t(const std::string &, const std::string &, uint64_t, bool) const --> uint64_t
- sectionExists(...)
- sectionExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section_name: str) -> bool
Checks if a given section exists (name is case insensitive)
keyExists()
C++: mrpt::config::CConfigFileBase::sectionExists(const std::string &) const --> bool
- setContentFromYAML(...)
- setContentFromYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, yaml_block: str) -> None
Changes the contents of the virtual "config file" from a text block
containing a YAML configuration text. Refer to unit test
yaml2config_unittest.cpp for examples of use.
getContentAsYAML()
C++: mrpt::config::CConfigFileBase::setContentFromYAML(const std::string &) --> void
- write(...)
- write(*args, **kwargs)
Overloaded function.
1. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
2. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
3. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
4. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, double, const int, const int, const std::string &) --> void
5. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
6. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
7. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
8. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, float, const int, const int, const std::string &) --> void
Static methods inherited from pybind11_builtins.pybind11_object:
- __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
- Create and return a new object. See help(type) for accurate signature.
|
class CConfigFilePrefixer(CConfigFileBase) |
|
A wrapper for other CConfigFileBase-based objects that prefixes a given
token to every key and/or section.
If, for example, your code expect:
Using this class with key entries prefix `s1_` will enable the same
existing code to transparently parse this file content:
See:
CConfigFileBase |
|
- Method resolution order:
- CConfigFilePrefixer
- CConfigFileBase
- pybind11_builtins.pybind11_object
- builtins.object
Methods defined here:
- __init__(...)
- __init__(*args, **kwargs)
Overloaded function.
1. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> None
2. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, o: mrpt.pymrpt.mrpt.config.CConfigFileBase, prefix_sections: str, prefix_keys: str) -> None
3. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, arg0: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> None
4. __init__(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, arg0: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> None
- assign(...)
- assign(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, : mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> mrpt.pymrpt.mrpt.config.CConfigFilePrefixer
C++: mrpt::config::CConfigFilePrefixer::operator=(const class mrpt::config::CConfigFilePrefixer &) --> class mrpt::config::CConfigFilePrefixer &
- bind(...)
- bind(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, o: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> None
Make this object to wrap the given existing CConfigFileBase object. Can
be changed at any moment after construction
C++: mrpt::config::CConfigFilePrefixer::bind(const class mrpt::config::CConfigFileBase &) --> void
- clear(...)
- clear(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> None
C++: mrpt::config::CConfigFilePrefixer::clear() --> void
- getAllKeys(...)
- getAllKeys(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, section: str, keys: List[str]) -> None
C++: mrpt::config::CConfigFilePrefixer::getAllKeys(const std::string &, class std::vector<std::string > &) const --> void
- getAllSections(...)
- getAllSections(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, sections: List[str]) -> None
C++: mrpt::config::CConfigFilePrefixer::getAllSections(class std::vector<std::string > &) const --> void
- getBoundConfigFileBase(...)
- getBoundConfigFileBase(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> mrpt.pymrpt.mrpt.config.CConfigFileBase
Returns the currently-bounded config source, or nullptr if none.
C++: mrpt::config::CConfigFilePrefixer::getBoundConfigFileBase() const --> class mrpt::config::CConfigFileBase *
- getKeyPrefix(...)
- getKeyPrefix(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> str
C++: mrpt::config::CConfigFilePrefixer::getKeyPrefix() const --> std::string
- getSectionPrefix(...)
- getSectionPrefix(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer) -> str
C++: mrpt::config::CConfigFilePrefixer::getSectionPrefix() const --> std::string
- setPrefixes(...)
- setPrefixes(self: mrpt.pymrpt.mrpt.config.CConfigFilePrefixer, prefix_sections: str, prefix_keys: str) -> None
Change the prefix for sections and keys. Can be called at any moment.
C++: mrpt::config::CConfigFilePrefixer::setPrefixes(const std::string &, const std::string &) --> void
Methods inherited from CConfigFileBase:
- getContentAsYAML(...)
- getContentAsYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase) -> str
Returns a text block representing the contents of the config file in
YAML format.
setContentFromYAML()
C++: mrpt::config::CConfigFileBase::getContentAsYAML() const --> std::string
- keyExists(...)
- keyExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, key: str) -> bool
Checks if a given key exists inside a section (case insensitive)
sectionExists()
C++: mrpt::config::CConfigFileBase::keyExists(const std::string &, const std::string &) const --> bool
- read_bool(...)
- read_bool(*args, **kwargs)
Overloaded function.
1. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool) -> bool
2. read_bool(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: bool, failIfNotFound: bool) -> bool
C++: mrpt::config::CConfigFileBase::read_bool(const std::string &, const std::string &, bool, bool) const --> bool
- read_double(...)
- read_double(*args, **kwargs)
Overloaded function.
1. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_double(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
not found and `failIfNotFound`=true
@{
C++: mrpt::config::CConfigFileBase::read_double(const std::string &, const std::string &, double, bool) const --> double
- read_enum(...)
- read_enum(*args, **kwargs)
Overloaded function.
1. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod) -> mrpt::bayes::TKFMethod
2. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt::bayes::TKFMethod, failIfNotFound: bool) -> mrpt::bayes::TKFMethod
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::bayes::TKFMethod &, bool) const --> enum mrpt::bayes::TKFMethod
3. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
4. read_enum(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: mrpt.pymrpt.mrpt.system.VerbosityLevel, failIfNotFound: bool) -> mrpt.pymrpt.mrpt.system.VerbosityLevel
C++: mrpt::config::CConfigFileBase::read_enum(const std::string &, const std::string &, const enum mrpt::system::VerbosityLevel &, bool) const --> enum mrpt::system::VerbosityLevel
- read_float(...)
- read_float(*args, **kwargs)
Overloaded function.
1. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float) -> float
2. read_float(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: float, failIfNotFound: bool) -> float
C++: mrpt::config::CConfigFileBase::read_float(const std::string &, const std::string &, float, bool) const --> float
- read_int(...)
- read_int(*args, **kwargs)
Overloaded function.
1. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_int(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_int(const std::string &, const std::string &, int, bool) const --> int
- read_string(...)
- read_string(*args, **kwargs)
Overloaded function.
1. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
C++: mrpt::config::CConfigFileBase::read_string(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_string_first_word(...)
- read_string_first_word(*args, **kwargs)
Overloaded function.
1. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str) -> str
2. read_string_first_word(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: str, failIfNotFound: bool) -> str
Reads a configuration parameter of type "string", and keeps only the
first word (this can be used to eliminate possible comments at the end of
the line)
C++: mrpt::config::CConfigFileBase::read_string_first_word(const std::string &, const std::string &, const std::string &, bool) const --> std::string
- read_uint64_t(...)
- read_uint64_t(*args, **kwargs)
Overloaded function.
1. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int) -> int
2. read_uint64_t(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, defaultValue: int, failIfNotFound: bool) -> int
C++: mrpt::config::CConfigFileBase::read_uint64_t(const std::string &, const std::string &, uint64_t, bool) const --> uint64_t
- sectionExists(...)
- sectionExists(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section_name: str) -> bool
Checks if a given section exists (name is case insensitive)
keyExists()
C++: mrpt::config::CConfigFileBase::sectionExists(const std::string &) const --> bool
- setContentFromYAML(...)
- setContentFromYAML(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, yaml_block: str) -> None
Changes the contents of the virtual "config file" from a text block
containing a YAML configuration text. Refer to unit test
yaml2config_unittest.cpp for examples of use.
getContentAsYAML()
C++: mrpt::config::CConfigFileBase::setContentFromYAML(const std::string &) --> void
- write(...)
- write(*args, **kwargs)
Overloaded function.
1. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
2. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
3. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
4. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, double, const int, const int, const std::string &) --> void
5. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float) -> None
6. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int) -> None
7. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int) -> None
8. write(self: mrpt.pymrpt.mrpt.config.CConfigFileBase, section: str, name: str, value: float, name_padding_width: int, value_padding_width: int, comment: str) -> None
C++: mrpt::config::CConfigFileBase::write(const std::string &, const std::string &, float, const int, const int, const std::string &) --> void
Static methods inherited from pybind11_builtins.pybind11_object:
- __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
- Create and return a new object. See help(type) for accurate signature.
|
class CLoadableOptions(pybind11_builtins.pybind11_object) |
|
This is a virtual base class for sets of options than can be loaded from
and/or saved to configuration plain-text files.
Automatize this class thru a proxy auxiliary class where variables are
registered from pointers, etc... |
|
- Method resolution order:
- CLoadableOptions
- pybind11_builtins.pybind11_object
- builtins.object
Methods defined here:
- __init__(...)
- __init__(*args, **kwargs)
Overloaded function.
1. __init__(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, arg0: mrpt.pymrpt.mrpt.config.CLoadableOptions) -> None
2. __init__(self: mrpt.pymrpt.mrpt.config.CLoadableOptions) -> None
- assign(...)
- assign(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, : mrpt.pymrpt.mrpt.config.CLoadableOptions) -> mrpt.pymrpt.mrpt.config.CLoadableOptions
C++: mrpt::config::CLoadableOptions::operator=(const class mrpt::config::CLoadableOptions &) --> class mrpt::config::CLoadableOptions &
- dumpToConsole(...)
- dumpToConsole(self: mrpt.pymrpt.mrpt.config.CLoadableOptions) -> None
Just like but sending the text to the console
(std::cout)
C++: mrpt::config::CLoadableOptions::dumpToConsole() const --> void
- loadFromConfigFile(...)
- loadFromConfigFile(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, source: mrpt::config::CConfigFileBase, section: str) -> None
This method load the options from a ".ini"-like file or memory-stored
string list.
Only those parameters found in the given "section" and having
the same name that the variable are loaded. Those not found in
the file will stay with their previous values (usually the default
values loaded at initialization). An example of an ".ini" file:
loadFromConfigFileName, saveToConfigFile
C++: mrpt::config::CLoadableOptions::loadFromConfigFile(const class mrpt::config::CConfigFileBase &, const std::string &) --> void
- loadFromConfigFileName(...)
- loadFromConfigFileName(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, config_file: str, section: str) -> None
Behaves like loadFromConfigFile, but you can pass directly a file name
and a temporary CConfigFile object will be created automatically to load
the file.
loadFromConfigFile
C++: mrpt::config::CLoadableOptions::loadFromConfigFileName(const std::string &, const std::string &) --> void
- saveToConfigFile(...)
- saveToConfigFile(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, target: mrpt::config::CConfigFileBase, section: str) -> None
This method saves the options to a ".ini"-like file or memory-stored
string list.
loadFromConfigFile, saveToConfigFileName
C++: mrpt::config::CLoadableOptions::saveToConfigFile(class mrpt::config::CConfigFileBase &, const std::string &) const --> void
- saveToConfigFileName(...)
- saveToConfigFileName(self: mrpt.pymrpt.mrpt.config.CLoadableOptions, config_file: str, section: str) -> None
Behaves like saveToConfigFile, but you can pass directly a file name and
a temporary CConfigFile object will be created automatically to save the
file.
saveToConfigFile, loadFromConfigFileName
C++: mrpt::config::CLoadableOptions::saveToConfigFileName(const std::string &, const std::string &) const --> void
Static methods inherited from pybind11_builtins.pybind11_object:
- __new__(*args, **kwargs) from pybind11_builtins.pybind11_type
- Create and return a new object. See help(type) for accurate signature.
| |