Skip to content

finer_section_t

Section class definition.

Source: src/lib/finer_section_t.f90

Dependencies

Contents

Derived Types

section

Section data of file INI.

Components

NameTypeAttributesDescription
snamecharacter(len=:)allocatableSection name.
optionstype(option)allocatableSection options.

Type-Bound Procedures

NameAttributesDescription
addAdd an option (scalar).
count_valuespass(self)Count option value(s).
freepass(self)Free dynamic memory.
free_optionspass(self)Free all options.
free_optionpass(self)Free a option.
getGet option value (scalar).
has_optionspass(self)Inquire if section has options.
indexpass(self)Return the index of an option.
looppass(self)Loop over options.
max_chars_lenpass(self)Return max len of option-name/values on all options.
namepass(self)Return section name.
options_numberpass(self)Return the options number.
option_pairspass(self)Return an option pairs.
parsepass(self)Parse section data.
printpass(self)Pretty print data.
setSet option value (scalar).
savepass(self)Save data.
assignment(=)Assignment overloading.
operator(==)Equal operator overloading.
add_optionpass(self)Add an option (scalar).
add_a_optionpass(self)Add an option (array).
get_optionpass(self)Get option value (scalar).
get_a_optionpass(self)Get option value (array).
parse_namepass(self)Get section name.
parse_optionspass(self)Get section options.
sanitize_sourcenopassSanitize source.
set_optionpass(self)Set option value (scalar).
set_a_optionpass(self)Set option value (array).
assign_sectionpass(lhs)Assignment overloading.
section_eq_stringpass(lhs)Equal to string logical operator.
section_eq_characterpass(lhs)Equal to character logical operator.

Interfaces

section

Overload section name with a function returning a new (itiliazed) section instance.

Module procedures: new_section

Subroutines

free

Free dynamic memory.

Attributes: elemental

fortran
subroutine free(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.

Call graph

free_options

Free all options.

Attributes: elemental

fortran
subroutine free_options(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.

Call graph

free_option

Free an option.

Attributes: elemental

fortran
subroutine free_option(self, option_name)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
option_namecharacter(len=*)inOption name.

Call graph

option_pairs

Return an option pairs.

Attributes: pure

fortran
subroutine option_pairs(self, option_index, pairs)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inOption data.
option_indexintegerinOption index.
pairscharacter(len=:)outallocatableOption name/values pairs.

Call graph

parse

Gett section data from a source string.

Attributes: elemental

fortran
subroutine parse(self, sep, source, error, token_failed)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inoutString containing section data.
errorinteger(kind=I4P)outError code.
token_failedtype(string)outoptionalEventual token failed to parse.

Call graph

Print data with a pretty format.

fortran
subroutine print_section(self, unit, retain_comments, pref, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
unitinteger(kind=I4P)inLogic unit.
retain_commentslogicalinFlag for retaining eventual comments.
prefcharacter(len=*)inoptionalPrefixing string.
iostatinteger(kind=I4P)outoptionalIO error.
iomsgcharacter(len=*)outoptionalIO error message.

save_section

Save data.

fortran
subroutine save_section(self, unit, retain_comments, iostat, iomsg)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
unitinteger(kind=I4P)inLogic unit.
retain_commentslogicalinFlag for retaining eventual comments.
iostatinteger(kind=I4P)outoptionalIO error.
iomsgcharacter(len=*)outoptionalIO error message.

add_option

Add an option (with scalar value).

If the option already exists, its value is updated.

Attributes: pure

fortran
subroutine add_option(self, option_name, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inOption value.
errorinteger(kind=I4P)outoptionalError code.

Call graph

add_a_option

Add an option (with array value).

If the option already exists, its value is updated.

Attributes: pure

fortran
subroutine add_a_option(self, option_name, val, delimiter, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inOption value.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.
errorinteger(kind=I4P)outoptionalError code.

Call graph

get_option

Get option value (scalar).

fortran
subroutine get_option(self, option_name, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inoutValue.
errorinteger(kind=I4P)outoptionalError code.

Call graph

get_a_option

Procedure for getting option value (array).

fortran
subroutine get_a_option(self, option_name, val, delimiter, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inoutValue.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.
errorinteger(kind=I4P)outoptionalError code.

Call graph

parse_name

Get section name from a source string.

Attributes: elemental

fortran
subroutine parse_name(self, source, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
sourcetype(string)inString containing section data.
errorinteger(kind=I4P)outError code.

Call graph

parse_options

Get section options from a source string.

Attributes: elemental

fortran
subroutine parse_options(self, sep, source, error, token_failed)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inoutString containing section data.
errorinteger(kind=I4P)outError code.
token_failedtype(string)outoptionalEventual token failed to parse.

Call graph

sanitize_source

Sanitize source.

  • Join splitted options;

Attributes: elemental

fortran
subroutine sanitize_source(sep, source, error)

Arguments

NameTypeIntentAttributesDescription
sepcharacter(len=*)inSeparator of option name/value.
sourcetype(string)inoutString containing option data.
errorinteger(kind=I4P)outError code.

Call graph

set_option

Set option value (scalar).

Attributes: pure

fortran
subroutine set_option(self, option_name, val, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inValue.
errorinteger(kind=I4P)outoptionalError code.

Call graph

set_a_option

Set option value (array).

Attributes: pure

fortran
subroutine set_a_option(self, option_name, val, delimiter, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inoutSection data.
option_namecharacter(len=*)inOption name.
valclass(*)inValue.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.
errorinteger(kind=I4P)outoptionalError code.

Call graph

assign_section

Assignment between two sections.

Attributes: elemental

fortran
subroutine assign_section(lhs, rhs)

Arguments

NameTypeIntentAttributesDescription
lhsclass(section)inoutLeft hand side.
rhstype(section)inRigth hand side.

Functions

count_values

Get the number of values of option into section data.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function count_values(self, option_name, delimiter) result(Nv)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
option_namecharacter(len=*)inOption name.
delimitercharacter(len=*)inoptionalDelimiter used for separating values.

Call graph

has_options

Inquire is section has options (at least one).

Attributes: elemental

Returns: logical

fortran
function has_options(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.

Call graph

index_option

Return the index of the option matching the name passed.

@note The matching index returned is the first found if back is not passed or if back=.false.. On the contrary the last found is returned if back=.true..

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function index_option(self, option_name, back) result(ind)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
option_namecharacter(len=*)inOption name.
backlogicalinoptionalIf back appears with the value true, the last matching index is returned.

loop

Loop returning option name/value defined into section.

Returns: logical

fortran
function loop(self, option_pairs) result(again)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.
option_pairscharacter(len=:)outallocatableCouples option name/value [1:2].

Call graph

max_chars_len

Return the maximum number of characters between option-name/option-values on all options.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function max_chars_len(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.

Call graph

name

Return section name.

Attributes: pure

Returns: character(len=len)

fortran
function name(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.

Call graph

options_number

Return the options number.

Attributes: elemental

Returns: integer(kind=I4P)

fortran
function options_number(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(section)inSection data.

Call graph

section_eq_string

Equal to string logical operator.

Attributes: elemental

Returns: logical

fortran
function section_eq_string(lhs, rhs) result(is_it)

Arguments

NameTypeIntentAttributesDescription
lhsclass(section)inLeft hand side.
rhstype(string)inRight hand side.

section_eq_character

Equal to character logical operator.

Attributes: elemental

Returns: logical

fortran
function section_eq_character(lhs, rhs) result(is_it)

Arguments

NameTypeIntentAttributesDescription
lhsclass(section)inLeft hand side.
rhscharacter(kind=CK, len=*)inRight hand side.

new_section

Return a new (initiliazed) section instance.

Attributes: elemental

Returns: type(section)

fortran
function new_section(section_name)

Arguments

NameTypeIntentAttributesDescription
section_namecharacter(len=*)inoptionalOption name.