lineparser#

A collection of tools to parse lines in a Boost config file.

get_key_value_pair(line: str) tuple[str, str][source]#

Extract key and value from a line in a cfg file.

Extracts everything before an equal sign as the key, and everything after as the value.

is_commented(line: str) bool[source]#

Check if a line starts with a comment sign (#), ignoring whitespaces.

is_empty(line: str) bool[source]#

Check if a line is empty or commented.

string_to_value(string: str) bool | float | int | str[source]#

Attempt to convert a string to a float or int.

strip_comment(line: str) str[source]#

Remove everything before a comment sign (#).