top of page
worker_2_software.png

Configuration File Reader

worker_2_software.png

Practically in all applications, there is a need to read a configuration file with parameters. This library is designed to read parameters from a file and provide an environment, which is easy to navigate and access the parameters from an application. The configuration file should have the following section-to-parameter mapping format where each section can have multiple parameters.

    [Section1]
        Parameter1 = ABC
        Parameter2 = 123

    [Section2]

        Parameter1 = ABCDEFGHIGKLMNOPQRSTUVWXYZ\

        12345678910
 

The section breakdown helps better organizing parameters in the configuration file by combining them based on their meaning and usage. Furthermore, developers can use multiple lines to define a value for a parameter, which is useful when the value is a large text. By default, the tool is looking for the backslash character (i.e., "\") at the end of the line as an indicator that it should continue reading the value on the next line, but the tool allows specifying a different character. 

 

The library also allows including comments inside the file, i.e., messages that should be ignored while reading the file. By default, the line that starts with the sign "#" is ignored, but the tool allows specifying a different character. 

bottom of page