Main MRPT website > C++ reference for MRPT 1.9.9
List of all members | Classes | Public Member Functions | Private Member Functions
mrpt::config::simpleini::MRPT_IniFileParser Struct Reference

Detailed Description

MRPT custom INI file parser to allow minimal file preprocessing:

Definition at line 2104 of file SimpleIni.h.

#include <simpleini/SimpleIni.h>

Inheritance diagram for mrpt::config::simpleini::MRPT_IniFileParser:
Inheritance graph

Classes

struct  ParseContext
 

Public Member Functions

 MRPT_IniFileParser ()
 
 MRPT_IniFileParser (const MRPT_IniFileParser &rhs)
 
MRPT_IniFileParseroperator= (const MRPT_IniFileParser &rhs)
 
virtual size_t SizeFromStore (const char *a_pInputData, size_t a_uInputDataLen) override
 Calculate the number of SI_CHAR required for converting the input from the storage format. More...
 
virtual bool ConvertFromStore (const char *a_pInputData, size_t a_uInputDataLen, char *a_pOutputData, size_t a_uOutputDataSize) override
 Convert the input string from the storage format to SI_CHAR. More...
 
size_t SizeToStore (const char *a_pInputData)
 Calculate the number of char required by the storage format of this data. More...
 
bool ConvertToStore (const char *a_pInputData, char *a_pOutputData, size_t a_uOutputDataSize)
 Convert the input string to the storage format of this data. More...
 

Private Member Functions

std::string parse_process_var_eval (const ParseContext &pc, std::string expr)
 
void parse_process_var_define (ParseContext &pc, const std::string &var_name, const std::string &var_value)
 
size_t do_parse (const char *in_str, const size_t in_len, char *out_str)
 Shared code for the two virtual methods. More...
 

Constructor & Destructor Documentation

◆ MRPT_IniFileParser() [1/2]

mrpt::config::simpleini::MRPT_IniFileParser::MRPT_IniFileParser ( )
inline

Definition at line 2106 of file SimpleIni.h.

◆ MRPT_IniFileParser() [2/2]

mrpt::config::simpleini::MRPT_IniFileParser::MRPT_IniFileParser ( const MRPT_IniFileParser rhs)
inline

Member Function Documentation

◆ ConvertFromStore()

virtual bool mrpt::config::simpleini::MRPT_IniFileParser::ConvertFromStore ( const char *  a_pInputData,
size_t  a_uInputDataLen,
char *  a_pOutputData,
size_t  a_uOutputDataSize 
)
inlineoverridevirtual

Convert the input string from the storage format to SI_CHAR.

The storage format is always UTF-8 or MBCS.

Parameters
a_pInputDataData in storage format to be converted to SI_CHAR.
a_uInputDataLenLength of storage format data in bytes. This must be the actual length of the data, including nullptr byte if nullptr terminated string is required.
a_pOutputDataPointer to the output buffer to received the converted data.
a_uOutputDataSizeSize of the output buffer in SI_CHAR.
Returns
true if all of the input data was successfully converted.

Reimplemented from mrpt::config::simpleini::SI_ConvertA< char >.

Definition at line 2125 of file SimpleIni.h.

References do_parse().

◆ ConvertToStore()

bool mrpt::config::simpleini::SI_ConvertA< char >::ConvertToStore ( const char *  a_pInputData,
char *  a_pOutputData,
size_t  a_uOutputDataSize 
)
inlineinherited

Convert the input string to the storage format of this data.

The storage format is always UTF-8 or MBCS.

Parameters
a_pInputDatanullptr terminated source string to convert. All of the data will be converted including the terminating nullptr character.
a_pOutputDataPointer to the buffer to receive the converted string.
a_uOutputDataSizeSize of the output buffer in char.
Returns
true if all of the input data, including the terminating nullptr character was successfully converted.

Definition at line 2084 of file SimpleIni.h.

◆ do_parse()

size_t mrpt::config::simpleini::MRPT_IniFileParser::do_parse ( const char *  in_str,
const size_t  in_len,
char *  out_str 
)
inlineprivate

◆ operator=()

MRPT_IniFileParser& mrpt::config::simpleini::MRPT_IniFileParser::operator= ( const MRPT_IniFileParser rhs)
inline

◆ parse_process_var_define()

void mrpt::config::simpleini::MRPT_IniFileParser::parse_process_var_define ( ParseContext pc,
const std::string var_name,
const std::string var_value 
)
inlineprivate

◆ parse_process_var_eval()

std::string mrpt::config::simpleini::MRPT_IniFileParser::parse_process_var_eval ( const ParseContext pc,
std::string  expr 
)
inlineprivate

◆ SizeFromStore()

virtual size_t mrpt::config::simpleini::MRPT_IniFileParser::SizeFromStore ( const char *  a_pInputData,
size_t  a_uInputDataLen 
)
inlineoverridevirtual

Calculate the number of SI_CHAR required for converting the input from the storage format.

The storage format is always UTF-8 or MBCS.

Parameters
a_pInputDataData in storage format to be converted to SI_CHAR.
a_uInputDataLenLength of storage format data in bytes. This must be the actual length of the data, including nullptr byte if nullptr terminated string is required.
Returns
Number of SI_CHAR required by the string when converted. If there are embedded nullptr bytes in the input data, only the string up and not including the nullptr byte will be converted.
-1 cast to size_t on a conversion error.

Reimplemented from mrpt::config::simpleini::SI_ConvertA< char >.

Definition at line 2118 of file SimpleIni.h.

References do_parse(), and SI_ASSERT.

◆ SizeToStore()

size_t mrpt::config::simpleini::SI_ConvertA< char >::SizeToStore ( const char *  a_pInputData)
inlineinherited

Calculate the number of char required by the storage format of this data.

The storage format is always UTF-8 or MBCS.

Parameters
a_pInputDatanullptr terminated string to calculate the number of bytes required to be converted to storage format.
Returns
Number of bytes required by the string when converted to storage format. This size always includes space for the terminating nullptr character.
-1 cast to size_t on a conversion error.

Definition at line 2065 of file SimpleIni.h.




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