toml_serializer Derived Type

type, public, extends(toml_visitor) :: toml_serializer

TOML serializer to produduce a TOML document from a datastructure


Constructor

public interface toml_serializer

Create standard constructor

  • private function new_serializer_func(config) result(self)

    Default constructor for TOML serializer

    Arguments

    Type IntentOptional Attributes Name
    type(toml_ser_config), intent(in), optional :: config

    Configuration for serializer

    Return Value type(toml_serializer)

    Instance of the TOML serializer


Type-Bound Procedures

procedure, public :: visit

Visit a TOML value

  • private recursive subroutine visit(self, val)

    Visit a TOML value

    Arguments

    Type IntentOptional Attributes Name
    class(toml_serializer), intent(inout) :: self

    Instance of the TOML serializer

    class(toml_value), intent(inout) :: val

    TOML value to visit

Source Code

   type, extends(toml_visitor) :: toml_serializer
      private

      !> Output string
      character(:), allocatable :: output

      !> Configuration for serializer
      type(toml_ser_config) :: config = toml_ser_config()

      !> Special mode for printing array of tables
      logical, private :: array_of_tables = .false.

      !> Special mode for printing inline arrays
      logical, private :: inline_array = .false.

      !> Top of the key stack
      integer, private :: top = 0

      !> Key stack to create table headers
      type(toml_key), allocatable, private :: stack(:)

   contains

      !> Visit a TOML value
      procedure :: visit

   end type toml_serializer