tomlf_ser Module

TOML serializer implementation



Interfaces

public interface new

Overloaded constructor for TOML serializers

  • public subroutine new_serializer(self, config)

    Constructor to create new serializer instance

    Arguments

    Type IntentOptional Attributes Name
    type(toml_serializer), intent(out) :: self

    Instance of the TOML serializer

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

    Configuration for serializer

public interface toml_dump

  • private subroutine toml_dump_to_file(val, filename, error, config)

    Write string representation of JSON value to a file

    Arguments

    Type IntentOptional Attributes Name
    class(toml_value), intent(inout) :: val

    TOML value to visit

    character(len=*), intent(in) :: filename

    File name to write to

    type(toml_error), intent(out), allocatable :: error

    Error handling

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

    Configuration for serializer

  • private subroutine toml_dump_to_unit(val, io, error, config)

    Write string representation of JSON value to a connected formatted unit

    Arguments

    Type IntentOptional Attributes Name
    class(toml_value), intent(inout) :: val

    TOML value to visit

    integer, intent(in) :: io

    Formatted unit to write to

    type(toml_error), intent(out), allocatable :: error

    Error handling

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

    Configuration for serializer

public interface toml_dumps

  • private subroutine toml_dump_to_string(val, string, error, config)

    Create a string representing the JSON value

    Arguments

    Type IntentOptional Attributes Name
    class(toml_value), intent(inout) :: val

    TOML value to visit

    character(len=:), intent(out), allocatable :: string

    Formatted unit to write to

    type(toml_error), intent(out), allocatable :: error

    Error handling

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

    Configuration for serializer

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


Derived Types

type, public, extends(toml_visitor) ::  toml_serializer

TOML serializer to produduce a TOML document from a datastructure

Constructor

Create standard constructor

private function new_serializer_func (config)

Default constructor for TOML serializer

Type-Bound Procedures

procedure, public :: visit ../../

Visit a TOML value


Functions

public function toml_serialize(val, config) result(string)

Serialize a JSON value to a string and return it.

Read more…

Arguments

Type IntentOptional Attributes Name
class(toml_value), intent(inout) :: val

TOML value to visit

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

Configuration for serializer

Return Value character(len=:), allocatable

Serialized JSON value


Subroutines

public subroutine new_serializer(self, config)

Constructor to create new serializer instance

Arguments

Type IntentOptional Attributes Name
type(toml_serializer), intent(out) :: self

Instance of the TOML serializer

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

Configuration for serializer