Class defining YAML conform string conversion methods.
More...
|
| dictionary | BOOL_DICT = {'true': True, 'yes': True, 'false': False, 'no': False} |
| | Dictionary holding all strings which are converted to True/False. More...
|
| |
| tuple | NONE_LIST = ('none', 'null', 'nil') |
| | Tuple holding all strings which are converted to None. More...
|
| |
Class defining YAML conform string conversion methods.
◆ __init__()
| def carputils.cml.cmlconverter.CMLConverterYAML.__init__ |
( |
|
self | ) |
|
◆ convert()
| def carputils.cml.cmlconverter.CMLConverterYAML.convert |
( |
|
s | ) |
|
|
static |
Convert a given string, the type is auto-detected.
- Parameters
-
| s | The string to be converted |
- Returns
- The converted value
◆ to_bool()
| def carputils.cml.cmlconverter.CMLConverterYAML.to_bool |
( |
|
s | ) |
|
|
static |
Tries to convert a given string to a boolean.
- Parameters
-
| s | The string to be converted |
- Returns
- A tuple (state, value) with
state ... The state of the conversion (True or False)
value ... The converted value (None if the conversion failed)
◆ to_none()
| def carputils.cml.cmlconverter.CMLConverterYAML.to_none |
( |
|
s | ) |
|
|
static |
Tries to convert a given string to None.
- Parameters
-
| s | The string to be converted |
- Returns
- A tuple (state, value) with
state ... The state of the conversion (True or False)
value ... The converted value (None if the conversion failed)
◆ BOOL_DICT
| dictionary carputils.cml.cmlconverter.CMLConverterYAML.BOOL_DICT = {'true': True, 'yes': True, 'false': False, 'no': False} |
|
static |
Dictionary holding all strings which are converted to True/False.
◆ NONE_LIST
| tuple carputils.cml.cmlconverter.CMLConverterYAML.NONE_LIST = ('none', 'null', 'nil') |
|
static |
Tuple holding all strings which are converted to None.
The documentation for this class was generated from the following file: