tomlf_build_merge Module

Merge TOML data structures, the merge policy can be adjusted.

Note that the context information cannot be preserved.



Variables

Type Visibility Attributes Name Initial
type(enum_policy), public, parameter :: merge_policy = enum_policy()

Actual enumerator for merging data structures


Interfaces

public interface toml_merge_config

Constructor for merge configuration

  • private pure function new_merge_config(table, array, keyval) result(config)

    Create a new merge configuration

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in), optional :: table

    Policy for merging tables

    character(len=*), intent(in), optional :: array

    Policy for merging arrays

    character(len=*), intent(in), optional :: keyval

    Policy for merging values

    Return Value type(toml_merge_config)

    Merge policy


Derived Types

type, public ::  toml_merge_config

Configuration for merging data structures

Components

Type Visibility Attributes Name Initial
integer, public :: array = merge_policy%preserve

Policy for merging arrays

integer, public :: keyval = merge_policy%preserve

Policy for merging values

integer, public :: table = merge_policy%append

Policy for merging tables

Constructor

Constructor for merge configuration

private pure function new_merge_config (table, array, keyval)

Create a new merge configuration


Subroutines

public recursive subroutine merge_array(lhs, rhs)

Append values from one TOML array to another

Arguments

Type IntentOptional Attributes Name
class(toml_array), intent(inout) :: lhs

Instance of array to merge into

class(toml_array), intent(inout) :: rhs

Instance of array to be merged

public recursive subroutine merge_table(lhs, rhs, config)

Merge TOML tables by appending their values

Arguments

Type IntentOptional Attributes Name
class(toml_table), intent(inout) :: lhs

Instance of table to merge into

class(toml_table), intent(inout) :: rhs

Instance of table to be merged

type(toml_merge_config), intent(in), optional :: config

Merge policy