Section class definition.
Overload section name with a function returning a new (itiliazed) section instance.
Return a new (initiliazed) section instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character, | intent(in), | optional | :: | section_name | Option name. |
New (initiliazed) section instance.
Section data of file INI.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(option), | private, | allocatable | :: | options(:) | Section options. |
||
| character(len=:), | private, | allocatable | :: | sname | Section name. |
Overload section name with a function returning a new (itiliazed) section instance.
| private elemental function new_section(section_name) | Return a new (initiliazed) section instance. |
| generic, public :: add => add_option, add_a_option | Add an option (scalar). Add an option (array). |
| procedure, private, pass(self) :: add_a_option | Add an option (array). |
| procedure, private, pass(self) :: add_option | Add an option (scalar). |
| procedure, private, pass(lhs) :: assign_section | Assignment overloading. |
| generic, public :: assignment(=) => assign_section | Assignment overloading. |
| procedure, public, pass(self) :: count_values | Count option value(s). |
| procedure, public, pass(self) :: free | Free dynamic memory. |
| procedure, public, pass(self) :: free_option | Free a option. |
| procedure, public, pass(self) :: free_options | Free all options. |
| generic, public :: get => get_option, get_a_option | Get option value (scalar). Get option value (array). |
| procedure, private, pass(self) :: get_a_option | Get option value (array). |
| procedure, private, pass(self) :: get_option | Get option value (scalar). |
| procedure, public, pass(self) :: has_options | Inquire if section has options. |
| procedure, public, pass(self) :: index => index_option | Return the index of an option. |
| procedure, public, pass(self) :: loop | Loop over options. |
| procedure, public, pass(self) :: max_chars_len | Return max len of option-name/values on all options. |
| procedure, public, pass(self) :: name | Return section name. |
| generic, public :: operator(==) => section_eq_string, section_eq_character | Equal operator overloading. |
| procedure, public, pass(self) :: option_pairs | Return an option pairs. |
| procedure, public, pass(self) :: options_number | Return the options number. |
| procedure, public, pass(self) :: parse | Parse section data. |
| procedure, private, pass(self) :: parse_name | Get section name. |
| procedure, private, pass(self) :: parse_options | Get section options. |
| procedure, public, pass(self) :: print => print_section | Pretty print data. |
| procedure, private, nopass :: sanitize_source | Sanitize source. |
| procedure, public, pass(self) :: save => save_section | Save data. |
| procedure, private, pass(lhs) :: section_eq_character | Equal to character logical operator. |
| procedure, private, pass(lhs) :: section_eq_string | Equal to string logical operator. |
| generic, public :: set => set_option, set_a_option | Set option value (scalar). Set option value (array). |
| procedure, private, pass(self) :: set_a_option | Set option value (array). |
| procedure, private, pass(self) :: set_option | Set option value (scalar). |
Get the number of values of option into section data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
Number of values.
Inquire is section has options (at least one).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
Inquire result.
Return the index of the option matching the name passed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| logical, | intent(in), | optional | :: | back | If back appears with the value true, the last matching index is returned. |
Index of searched section.
Loop returning option name/value defined into section.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| character(len=:), | intent(out), | allocatable | :: | option_pairs(:) | Couples option name/value [1:2]. |
Flag continuing the loop.
Return the maximum number of characters between option-name/option-values on all options.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
Inquire result.
Return section name.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
Section data.
Return a new (initiliazed) section instance.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character, | intent(in), | optional | :: | section_name | Option name. |
New (initiliazed) section instance.
Return the options number.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
Options number.
Equal to character logical operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | lhs | Left hand side. |
||
| character(kind=CK,len=*), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Equal to string logical operator.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | lhs | Left hand side. |
||
| type(string), | intent(in) | :: | rhs | Right hand side. |
Opreator test result.
Add an option (with array value).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(in) | :: | val(:) | Option value. |
||
| character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
|
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Add an option (with scalar value).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(in) | :: | val | Option value. |
||
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Free dynamic memory.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
Free an option.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
Free all options.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
Procedure for getting option value (array).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(inout) | :: | val(1:) | Value. |
||
| character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
|
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Get option value (scalar).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(inout) | :: | val | Value. |
||
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Return an option pairs.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Option data. |
||
| integer, | intent(in) | :: | option_index | Option index. |
||
| character(len=:), | intent(out), | allocatable | :: | pairs(:) | Option name/values pairs. |
Gett section data from a source string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | sep | Separator of option name/value. |
||
| type(string), | intent(inout) | :: | source | String containing section data. |
||
| integer(kind=I4P), | intent(out) | :: | error | Error code. |
Get section name from a source string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| type(string), | intent(in) | :: | source | String containing section data. |
||
| integer(kind=I4P), | intent(out) | :: | error | Error code. |
Get section options from a source string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | sep | Separator of option name/value. |
||
| type(string), | intent(inout) | :: | source | String containing section data. |
||
| integer(kind=I4P), | intent(out) | :: | error | Error code. |
Print data with a pretty format.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| integer(kind=I4P), | intent(in) | :: | unit | Logic unit. |
||
| logical, | intent(in) | :: | retain_comments | Flag for retaining eventual comments. |
||
| character, | intent(in), | optional | :: | pref | Prefixing string. |
|
| integer(kind=I4P), | intent(out), | optional | :: | iostat | IO error. |
|
| character, | intent(out), | optional | :: | iomsg | IO error message. |
Sanitize source.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character, | intent(in) | :: | sep | Separator of option name/value. |
||
| type(string), | intent(inout) | :: | source | String containing option data. |
||
| integer(kind=I4P), | intent(out) | :: | error | Error code. |
Save data.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(in) | :: | self | Section data. |
||
| integer(kind=I4P), | intent(in) | :: | unit | Logic unit. |
||
| logical, | intent(in) | :: | retain_comments | Flag for retaining eventual comments. |
||
| integer(kind=I4P), | intent(out), | optional | :: | iostat | IO error. |
|
| character, | intent(out), | optional | :: | iomsg | IO error message. |
Set option value (array).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(in) | :: | val(:) | Value. |
||
| character, | intent(in), | optional | :: | delimiter | Delimiter used for separating values. |
|
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |
Set option value (scalar).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(section), | intent(inout) | :: | self | Section data. |
||
| character, | intent(in) | :: | option_name | Option name. |
||
| class(*), | intent(in) | :: | val | Value. |
||
| integer(kind=I4P), | intent(out), | optional | :: | error | Error code. |