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: Configuration file format in MRPT
Definition at line 39 of file CConfigFilePrefixer.h.
#include <mrpt/config/CConfigFilePrefixer.h>
Public Member Functions | |
CConfigFilePrefixer () | |
Unbound constructor: must bind this object to CConfigFileBase before usage with bind() and setPrefixes() More... | |
CConfigFilePrefixer (const CConfigFileBase &o, const std::string &prefix_sections, const std::string &prefix_keys) | |
Construct and bind to (wrap) a given object with given prefix texts. More... | |
void | bind (const CConfigFileBase &o) |
Make this object to wrap the given existing CConfigFileBase object. More... | |
void | setPrefixes (const std::string &prefix_sections, const std::string &prefix_keys) |
Change the prefix for sections and keys. More... | |
std::string | getSectionPrefix () const |
std::string | getKeyPrefix () const |
CConfigFileBase * | getBoundConfigFileBase () const |
Returns the currently-bounded config source, or nullptr if none. More... | |
virtual | ~CConfigFilePrefixer () |
void | getAllSections (std::vector< std::string > §ions) const override |
Returns a list with all the section names. More... | |
void | getAllKeys (const std::string §ion, std::vector< std::string > &keys) const override |
Returs a list with all the keys into a section. More... | |
bool | sectionExists (const std::string §ion_name) const |
Checks if a given section exists (name is case insensitive) More... | |
template<typename enum_t , typename = std::enable_if_t<std::is_enum<enum_t>::value>> | |
void | write (const std::string §ion, const std::string &name, enum_t value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
Save a configuration parameter. Optionally pads with spaces up to | |
the desired width in number of characters (-1: no fill), and add a final comment field at the end of the line (a "// " prefix is automatically inserted). | |
template<typename data_t , typename = std::enable_if_t<!std::is_enum<data_t>::value>> | |
void | write (const std::string §ion, const std::string &name, const data_t &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
template<typename data_t > | |
void | write (const std::string §ion, const std::string &name, const std::vector< data_t > &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, double value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, float value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
Read a configuration parameter, launching exception if key name is | |
not found and | |
double | read_double (const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const |
float | read_float (const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const |
bool | read_bool (const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const |
int | read_int (const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const |
uint64_t | read_uint64_t (const std::string §ion, const std::string &name, uint64_t defaultValue, bool failIfNotFound=false) const |
std::string | read_string (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
std::string | read_string_first_word (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
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) More... | |
template<class VECTOR_TYPE > | |
void | read_vector (const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const |
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ... ]", where spaces could also be commas. More... | |
template<class MATRIX_TYPE > | |
void | read_matrix (const std::string §ion, const std::string &name, MATRIX_TYPE &outMatrix, const MATRIX_TYPE &defaultMatrix=MATRIX_TYPE(), bool failIfNotFound=false) const |
Reads a configuration parameter as a matrix written in a matlab-like format - for example: "[2 3 4 ; 7 8 9]". More... | |
template<typename ENUMTYPE > | |
ENUMTYPE | read_enum (const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const |
Reads an "enum" value, where the value in the config file can be either a numerical value or the symbolic name, for example: In the code: More... | |
Save a configuration parameter. Optionally pads with spaces up to | |
the desired width in number of characters (-1: no fill), and add a final comment field at the end of the line (a "// " prefix is automatically inserted). | |
template<typename data_t , typename = std::enable_if_t<!std::is_enum<data_t>::value>> | |
void | write (const std::string §ion, const std::string &name, const data_t &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
template<typename data_t > | |
void | write (const std::string §ion, const std::string &name, const std::vector< data_t > &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, double value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, float value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
Read a configuration parameter, launching exception if key name is | |
not found and | |
double | read_double (const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const |
float | read_float (const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const |
bool | read_bool (const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const |
int | read_int (const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const |
uint64_t | read_uint64_t (const std::string §ion, const std::string &name, uint64_t defaultValue, bool failIfNotFound=false) const |
std::string | read_string (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
std::string | read_string_first_word (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
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) More... | |
template<class VECTOR_TYPE > | |
void | read_vector (const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const |
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ... ]", where spaces could also be commas. More... | |
template<class MATRIX_TYPE > | |
void | read_matrix (const std::string §ion, const std::string &name, MATRIX_TYPE &outMatrix, const MATRIX_TYPE &defaultMatrix=MATRIX_TYPE(), bool failIfNotFound=false) const |
Reads a configuration parameter as a matrix written in a matlab-like format - for example: "[2 3 4 ; 7 8 9]". More... | |
template<typename ENUMTYPE > | |
ENUMTYPE | read_enum (const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const |
Reads an "enum" value, where the value in the config file can be either a numerical value or the symbolic name, for example: In the code: More... | |
Save a configuration parameter. Optionally pads with spaces up to | |
the desired width in number of characters (-1: no fill), and add a final comment field at the end of the line (a "// " prefix is automatically inserted). | |
template<typename data_t , typename = std::enable_if_t<!std::is_enum<data_t>::value>> | |
void | write (const std::string §ion, const std::string &name, const data_t &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
template<typename data_t > | |
void | write (const std::string §ion, const std::string &name, const std::vector< data_t > &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, double value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, float value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
Read a configuration parameter, launching exception if key name is | |
not found and | |
double | read_double (const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const |
float | read_float (const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const |
bool | read_bool (const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const |
int | read_int (const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const |
uint64_t | read_uint64_t (const std::string §ion, const std::string &name, uint64_t defaultValue, bool failIfNotFound=false) const |
std::string | read_string (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
std::string | read_string_first_word (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
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) More... | |
template<class VECTOR_TYPE > | |
void | read_vector (const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const |
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ... ]", where spaces could also be commas. More... | |
template<class MATRIX_TYPE > | |
void | read_matrix (const std::string §ion, const std::string &name, MATRIX_TYPE &outMatrix, const MATRIX_TYPE &defaultMatrix=MATRIX_TYPE(), bool failIfNotFound=false) const |
Reads a configuration parameter as a matrix written in a matlab-like format - for example: "[2 3 4 ; 7 8 9]". More... | |
template<typename ENUMTYPE > | |
ENUMTYPE | read_enum (const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const |
Reads an "enum" value, where the value in the config file can be either a numerical value or the symbolic name, for example: In the code: More... | |
Save a configuration parameter. Optionally pads with spaces up to | |
the desired width in number of characters (-1: no fill), and add a final comment field at the end of the line (a "// " prefix is automatically inserted). | |
template<typename data_t , typename = std::enable_if_t<!std::is_enum<data_t>::value>> | |
void | write (const std::string §ion, const std::string &name, const data_t &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
template<typename data_t > | |
void | write (const std::string §ion, const std::string &name, const std::vector< data_t > &value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, double value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
void | write (const std::string §ion, const std::string &name, float value, const int name_padding_width=-1, const int value_padding_width=-1, const std::string &comment=std::string()) |
Read a configuration parameter, launching exception if key name is | |
not found and | |
double | read_double (const std::string §ion, const std::string &name, double defaultValue, bool failIfNotFound=false) const |
float | read_float (const std::string §ion, const std::string &name, float defaultValue, bool failIfNotFound=false) const |
bool | read_bool (const std::string §ion, const std::string &name, bool defaultValue, bool failIfNotFound=false) const |
int | read_int (const std::string §ion, const std::string &name, int defaultValue, bool failIfNotFound=false) const |
uint64_t | read_uint64_t (const std::string §ion, const std::string &name, uint64_t defaultValue, bool failIfNotFound=false) const |
std::string | read_string (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
std::string | read_string_first_word (const std::string §ion, const std::string &name, const std::string &defaultValue, bool failIfNotFound=false) const |
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) More... | |
template<class VECTOR_TYPE > | |
void | read_vector (const std::string §ion, const std::string &name, const VECTOR_TYPE &defaultValue, VECTOR_TYPE &outValues, bool failIfNotFound=false) const |
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ... ]", where spaces could also be commas. More... | |
template<class MATRIX_TYPE > | |
void | read_matrix (const std::string §ion, const std::string &name, MATRIX_TYPE &outMatrix, const MATRIX_TYPE &defaultMatrix=MATRIX_TYPE(), bool failIfNotFound=false) const |
Reads a configuration parameter as a matrix written in a matlab-like format - for example: "[2 3 4 ; 7 8 9]". More... | |
template<typename ENUMTYPE > | |
ENUMTYPE | read_enum (const std::string §ion, const std::string &name, const ENUMTYPE &defaultValue, bool failIfNotFound=false) const |
Reads an "enum" value, where the value in the config file can be either a numerical value or the symbolic name, for example: In the code: More... | |
Protected Member Functions | |
void | writeString (const std::string §ion, const std::string &name, const std::string &str) override |
A virtual method to write a generic string. More... | |
std::string | readString (const std::string §ion, const std::string &name, const std::string &defaultStr, bool failIfNotFound=false) const override |
A virtual method to read a generic string. More... | |
void | writeString (const std::string §ion, const std::string &name, const std::string &str, const int name_padding_width, const int value_padding_width, const std::string &comment) |
Write a generic string with optional padding and a comment field ("//
...") at the end of the line. More... | |
Private Attributes | |
CConfigFileBase * | m_bound_object |
The object we are wrapping. More... | |
std::string | m_prefix_sections |
std::string | m_prefix_keys |
CConfigFilePrefixer::CConfigFilePrefixer | ( | ) |
Unbound constructor: must bind this object to CConfigFileBase before usage with bind() and setPrefixes()
Definition at line 17 of file CConfigFilePrefixer.cpp.
CConfigFilePrefixer::CConfigFilePrefixer | ( | const CConfigFileBase & | o, |
const std::string & | prefix_sections, | ||
const std::string & | prefix_keys | ||
) |
Construct and bind to (wrap) a given object with given prefix texts.
Definition at line 18 of file CConfigFilePrefixer.cpp.
|
virtual |
Definition at line 26 of file CConfigFilePrefixer.cpp.
void CConfigFilePrefixer::bind | ( | const CConfigFileBase & | o | ) |
Make this object to wrap the given existing CConfigFileBase object.
Can be changed at any moment after construction
Definition at line 31 of file CConfigFilePrefixer.cpp.
References m_bound_object.
Referenced by mrpt::nav::CParameterizedTrajectoryGenerator::CreatePTG().
|
overridevirtual |
Returs a list with all the keys into a section.
Implements mrpt::config::CConfigFileBase.
Definition at line 64 of file CConfigFilePrefixer.cpp.
References ASSERTMSG_, mrpt::config::CConfigFileBase::getAllKeys(), m_bound_object, and m_prefix_keys.
|
overridevirtual |
Returns a list with all the section names.
Implements mrpt::config::CConfigFileBase.
Definition at line 53 of file CConfigFilePrefixer.cpp.
References ASSERTMSG_, mrpt::config::CConfigFileBase::getAllSections(), m_bound_object, and m_prefix_sections.
CConfigFileBase * CConfigFilePrefixer::getBoundConfigFileBase | ( | ) | const |
Returns the currently-bounded config source, or nullptr if none.
Definition at line 48 of file CConfigFilePrefixer.cpp.
References m_bound_object.
std::string CConfigFilePrefixer::getKeyPrefix | ( | ) | const |
Definition at line 47 of file CConfigFilePrefixer.cpp.
References m_prefix_keys.
std::string CConfigFilePrefixer::getSectionPrefix | ( | ) | const |
Definition at line 43 of file CConfigFilePrefixer.cpp.
References m_prefix_sections.
|
inherited |
Definition at line 150 of file CConfigFileBase.cpp.
References mrpt::system::lowerCase(), and trim().
Referenced by mrpt::detectors::CFaceDetection::init(), mrpt::pbmap::config_heuristics::load_params(), mrpt::hwdrivers::C2DRangeFinderAbstract::loadCommonParams(), mrpt::hwdrivers::CIMUIntersense::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSkeletonTracker::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCANBusReader::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserSerial::loadConfig_sensorSpecific(), mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2_RGBD360::loadConfig_sensorSpecific(), mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), mrpt::vision::TMultiResDescOptions::loadFromConfigFile(), mrpt::hwdrivers::TCaptureOptions_DUO3D::loadOptionsFrom(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::loadOptionsFrom(), mrpt::graphslam::CGraphSlamEngine< mrpt::graphs::CNetworkOfPoses2DInf >::loadParams(), readConfigFile(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), and mrpt::gui::CPanelCameraSelection::readConfigIntoVideoSourcePanel().
|
inherited |
Definition at line 101 of file CConfigFileBase.cpp.
Referenced by mrpt::detectors::CCascadeClassifierDetection::init(), mrpt::detectors::CFaceDetection::init(), mrpt::nav::PlannerTPS_VirtualBase::internal_loadConfig_PTG(), mrpt::hwdrivers::C2DRangeFinderAbstract::loadCommonParams(), mrpt::hwdrivers::CGenericSensor::loadConfig(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), mrpt::img::TCamera::loadFromConfigFile(), mrpt::vision::TMultiResDescOptions::loadFromConfigFile(), mrpt::nav::CPTG_RobotShape_Polygonal::loadShapeFromConfigFile(), mrpt::topography::path_from_rtk_gps(), and TEST().
|
inlineinherited |
Reads an "enum" value, where the value in the config file can be either a numerical value or the symbolic name, for example: In the code:
In the config file:
Which can be loaded with:
Definition at line 245 of file config/CConfigFileBase.h.
References MRPT_END, MRPT_START, mrpt::typemeta::TEnumType< ENUMTYPE >::name2value(), mrpt::config::CConfigFileBase::read_string_first_word(), and THROW_EXCEPTION_FMT.
Referenced by mrpt::hwdrivers::CVelodyneScanner::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), and mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific().
|
inherited |
Definition at line 113 of file CConfigFileBase.cpp.
Referenced by mrpt::pbmap::config_heuristics::load_params(), mrpt::hwdrivers::CWirelessPower::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGillAnemometer::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRaePID::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens_MT4::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserUSB::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUIntersense::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSkeletonTracker::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboPeakLidar::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIbeoLuxETH::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSICKTim561Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserSerial::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardSonars::loadConfig_sensorSpecific(), mrpt::hwdrivers::CLMS100Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CVelodyneScanner::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2_RGBD360::loadConfig_sensorSpecific(), mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::TCaptureOptions_DUO3D::loadOptionsFrom(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::loadOptionsFrom(), and readConfigFile().
|
inherited |
Definition at line 125 of file CConfigFileBase.cpp.
Referenced by mrpt::detectors::CCascadeClassifierDetection::init(), mrpt::detectors::CFaceDetection::init(), mrpt::nav::PlannerTPS_VirtualBase::internal_loadConfig_PTG(), mrpt::pbmap::config_heuristics::load_params(), mrpt::hwdrivers::CGenericSensor::loadConfig(), mrpt::hwdrivers::CGillAnemometer::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRaePID::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboticHeadInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens_MT4::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens::loadConfig_sensorSpecific(), mrpt::hwdrivers::CImpinjRFID::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUIntersense::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSICKTim561Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCANBusReader::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserSerial::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardSonars::loadConfig_sensorSpecific(), mrpt::hwdrivers::CLMS100Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2_RGBD360::loadConfig_sensorSpecific(), mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), mrpt::vision::TMultiResDescOptions::loadFromConfigFile(), mrpt::hwdrivers::TCaptureOptions_DUO3D::loadOptionsFrom(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::loadOptionsFrom(), mrpt::graphslam::CGraphSlamEngine< mrpt::graphs::CNetworkOfPoses2DInf >::loadParams(), readConfigFile(), mrpt::gui::CPanelCameraSelection::readConfigIntoVideoSourcePanel(), and TEST().
|
inlineinherited |
Reads a configuration parameter as a matrix written in a matlab-like format - for example: "[2 3 4 ; 7 8 9]".
This template method can be instantiated for matrices of the types: int, long, unsinged int, unsigned long, float, double, long double
std::exception | If the key name is not found and "failIfNotFound" is true. Otherwise the "defaultValue" is returned. |
Definition at line 206 of file config/CConfigFileBase.h.
References mrpt::config::CConfigFileBase::readString(), and THROW_EXCEPTION_FMT.
Referenced by mrpt::topography::path_from_rtk_gps().
|
inherited |
Definition at line 169 of file CConfigFileBase.cpp.
References mrpt::system::trim().
Referenced by mrpt::detectors::CCascadeClassifierDetection::init(), mrpt::nav::PlannerTPS_VirtualBase::internal_loadConfig_PTG(), mrpt::pbmap::config_heuristics::load_params(), mrpt::hwdrivers::CGenericSensor::loadConfig(), mrpt::hwdrivers::CWirelessPower::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGillAnemometer::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRaePID::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboticHeadInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens_MT4::loadConfig_sensorSpecific(), mrpt::hwdrivers::CIMUXSens::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserUSB::loadConfig_sensorSpecific(), mrpt::hwdrivers::CImpinjRFID::loadConfig_sensorSpecific(), mrpt::hwdrivers::CEnoseModular::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardENoses::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGyroKVHDSP3000::loadConfig_sensorSpecific(), mrpt::hwdrivers::CRoboPeakLidar::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSICKTim561Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCANBusReader::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSickLaserSerial::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardSonars::loadConfig_sensorSpecific(), mrpt::hwdrivers::CLMS100Eth::loadConfig_sensorSpecific(), mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CGPSInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CHokuyoURG::loadConfig_sensorSpecific(), mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific(), mrpt::hwdrivers::CNationalInstrumentsDAQ::loadConfig_sensorSpecific(), mrpt::hwdrivers::CKinect::loadConfig_sensorSpecific(), mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), mrpt::img::TStereoCamera::loadFromConfigFile(), mrpt::hwdrivers::TCaptureOptions_DUO3D::loadOptionsFrom(), mrpt::hwdrivers::TCaptureOptions_FlyCapture2::loadOptionsFrom(), mrpt::graphslam::CGraphSlamEngine< mrpt::graphs::CNetworkOfPoses2DInf >::loadParams(), readConfigFile(), CGraphSlamHandler< GRAPH_T >::readConfigFname(), mrpt::gui::CPanelCameraSelection::readConfigIntoVideoSourcePanel(), TEST(), and mrpt::gui::CPanelCameraSelection::writeConfigFromVideoSourcePanel().
|
inherited |
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)
Definition at line 180 of file CConfigFileBase.cpp.
References THROW_EXCEPTION, and mrpt::system::tokenize().
Referenced by mrpt::hwdrivers::CCameraSensor::loadConfig_sensorSpecific(), and mrpt::config::CConfigFileBase::read_enum().
|
inherited |
Definition at line 137 of file CConfigFileBase.cpp.
References mrpt::system::os::_strtoull().
Referenced by mrpt::hwdrivers::CEnoseModular::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardENoses::loadConfig_sensorSpecific(), mrpt::hwdrivers::CSwissRanger3DCamera::loadConfig_sensorSpecific(), mrpt::hwdrivers::CNationalInstrumentsDAQ::loadConfig_sensorSpecific(), mrpt::maps::TSetOfMetricMapInitializers::loadFromConfigFile(), and mrpt::hwdrivers::TCaptureOptions_FlyCapture2::loadOptionsFrom().
|
inlineinherited |
Reads a configuration parameter of type vector, stored in the file as a string: "[v1 v2 v3 ... ]", where spaces could also be commas.
std::exception | If the key name is not found and "failIfNotFound" is true. Otherwise the "defaultValue" is returned. |
Definition at line 171 of file config/CConfigFileBase.h.
References mrpt::config::CConfigFileBase::readString(), mrpt::system::tokenize(), and val.
Referenced by mrpt::hwdrivers::C2DRangeFinderAbstract::loadCommonParams(), mrpt::hwdrivers::CRoboticHeadInterface::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardENoses::loadConfig_sensorSpecific(), mrpt::hwdrivers::CBoardSonars::loadConfig_sensorSpecific(), mrpt::img::TCamera::loadFromConfigFile(), and mrpt::vision::TMultiResDescOptions::loadFromConfigFile().
|
overrideprotectedvirtual |
A virtual method to read a generic string.
std::exception | If the key name is not found and "failIfNotFound" is true. Otherwise the "defaultValue" is returned. |
Implements mrpt::config::CConfigFileBase.
Definition at line 84 of file CConfigFilePrefixer.cpp.
References ASSERTMSG_, m_bound_object, m_prefix_keys, m_prefix_sections, and mrpt::config::CConfigFileBase::readString().
|
inherited |
Checks if a given section exists (name is case insensitive)
Definition at line 205 of file CConfigFileBase.cpp.
References mrpt::system::os::_strcmpi().
Referenced by mrpt::hwdrivers::CPhidgetInterfaceKitProximitySensors::loadConfig_sensorSpecific(), and mrpt::hwdrivers::COpenNI2Sensor::loadConfig_sensorSpecific().
void CConfigFilePrefixer::setPrefixes | ( | const std::string & | prefix_sections, |
const std::string & | prefix_keys | ||
) |
Change the prefix for sections and keys.
Can be called at any moment.
Definition at line 36 of file CConfigFilePrefixer.cpp.
References m_prefix_keys, and m_prefix_sections.
Referenced by mrpt::nav::CParameterizedTrajectoryGenerator::CreatePTG().
|
inlineinherited |
Definition at line 101 of file config/CConfigFileBase.h.
References mrpt::to_string(), and mrpt::config::CConfigFileBase::writeString().
|
inlineinherited |
Definition at line 112 of file config/CConfigFileBase.h.
References mrpt::to_string(), and mrpt::config::CConfigFileBase::writeString().
|
inherited |
Definition at line 33 of file CConfigFileBase.cpp.
|
inlineinherited |
Definition at line 85 of file config/CConfigFileBase.h.
Referenced by run_rnav_test(), mrpt::nav::CPTG_DiffDrive_CCS::saveToConfigFile(), mrpt::nav::CPTG_DiffDrive_CS::saveToConfigFile(), mrpt::nav::CPTG_Holo_Blend::saveToConfigFile(), mrpt::nav::CPTG_DiffDrive_CC::saveToConfigFile(), mrpt::nav::CPTG_DiffDrive_alpha::saveToConfigFile(), mrpt::nav::CPTG_DiffDrive_C::saveToConfigFile(), mrpt::img::TCamera::saveToConfigFile(), mrpt::nav::CPTG_DiffDrive_CollisionGridBased::saveToConfigFile(), mrpt::nav::CParameterizedTrajectoryGenerator::saveToConfigFile(), mrpt::nav::CPTG_RobotShape_Polygonal::saveToConfigFile(), mrpt::nav::CPTG_RobotShape_Circular::saveToConfigFile(), mrpt::vision::TMultiResDescMatchOptions::saveToConfigFile(), mrpt::vision::TMultiResDescOptions::saveToConfigFile(), TEST(), and mrpt::gui::CPanelCameraSelection::writeConfigFromVideoSourcePanel().
|
inherited |
Definition at line 47 of file CConfigFileBase.cpp.
|
overrideprotectedvirtual |
A virtual method to write a generic string.
Implements mrpt::config::CConfigFileBase.
Definition at line 74 of file CConfigFilePrefixer.cpp.
References ASSERTMSG_, m_bound_object, m_prefix_keys, m_prefix_sections, and mrpt::config::CConfigFileBase::writeString().
|
protectedinherited |
Write a generic string with optional padding and a comment field ("// ...") at the end of the line.
Definition at line 65 of file CConfigFileBase.cpp.
References mrpt::format().
|
private |
The object we are wrapping.
Definition at line 43 of file CConfigFilePrefixer.h.
Referenced by bind(), getAllKeys(), getAllSections(), getBoundConfigFileBase(), readString(), and writeString().
|
private |
Definition at line 44 of file CConfigFilePrefixer.h.
Referenced by getAllKeys(), getKeyPrefix(), readString(), setPrefixes(), and writeString().
|
private |
Definition at line 44 of file CConfigFilePrefixer.h.
Referenced by getAllSections(), getSectionPrefix(), readString(), setPrefixes(), and writeString().
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at miƩ 12 jul 2023 10:03:34 CEST |