foxy_xml_file Module

module~~foxy_xml_file~~UsesGraph module~foxy_xml_file foxy_xml_file module~foxy_xml_tag foxy_xml_tag module~foxy_xml_tag->module~foxy_xml_file module~penf penf module~penf->module~foxy_xml_file module~penf->module~foxy_xml_tag module~stringifor stringifor module~penf->module~stringifor module~stringifor_string_t stringifor_string_t module~penf->module~stringifor_string_t module~befor64 befor64 module~penf->module~befor64 module~befor64_pack_data_m befor64_pack_data_m module~penf->module~befor64_pack_data_m module~stringifor->module~foxy_xml_tag module~stringifor_string_t->module~stringifor module~befor64->module~stringifor_string_t module~befor64_pack_data_m->module~befor64 module~penf_global_parameters_variables penf_global_parameters_variables module~penf_global_parameters_variables->module~penf module~penf_b_size penf_b_size module~penf_global_parameters_variables->module~penf_b_size module~penf_stringify penf_stringify module~penf_global_parameters_variables->module~penf_stringify module~penf_b_size->module~penf module~penf_b_size->module~penf_stringify module~penf_stringify->module~penf iso_fortran_env iso_fortran_env iso_fortran_env->module~penf_stringify
Help

FoXy XML file class.

Used By

module~~foxy_xml_file~~UsedByGraph module~foxy_xml_file foxy_xml_file module~foxy foxy module~foxy_xml_file->module~foxy program~parse_file_simple parse_file_simple module~foxy->program~parse_file_simple program~create_tag create_tag module~foxy->program~create_tag program~add_attributes add_attributes module~foxy->program~add_attributes program~delete_attributes delete_attributes module~foxy->program~delete_attributes program~parse_string_simple parse_string_simple module~foxy->program~parse_string_simple program~indent_tag indent_tag module~foxy->program~indent_tag program~delete_content delete_content module~foxy->program~delete_content program~add_tag add_tag module~foxy->program~add_tag program~delete_tag delete_tag module~foxy->program~delete_tag program~write_tag write_tag module~foxy->program~write_tag
Help

Derived Types

type, public :: xml_file

Components

TypeVisibility AttributesNameInitial
integer(kind=I4P), private :: Nt =0

Number of XML tags.

type(xml_tag), private, allocatable:: tag(:)

XML tags array.

Finalizations Procedures

final :: finalize

Free dynamic memory when finalizing.

Type-Bound Procedures

procedure, public :: free

Free dynamic memory.

procedure, public :: parse

Parse xml data from string or file.

procedure, public :: content

Return tag content of tag named name.

procedure, public :: stringify

Convert the whole file data into a string.

procedure, public :: add_tag

Add tag to XML file.

procedure, public :: delete_tag

Add tag from XML file.

procedure, private :: parse_from_string

Parse xml data from string.

Description

XML file class.


Functions

private pure function content(self, name)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(in) :: self

XML file.

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

Tag name.

Return Value character(len=:), allocatable

Tag content.

Description

Return tag content of tag named name.

private pure function stringify(self) result(string)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(in) :: self

XML file.

Return Value character(len=:), allocatable

Output string containing the whole xml file.

Description

Convert the whole file data into a string.

private function load_file_as_stream(filename, delimiter_start, delimiter_end, fast_read, iostat, iomsg) result(stream)

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: filename

File name.

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

Delimiter from which start the stream.

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

Delimiter to which end the stream.

logical, intent(in), optional :: fast_read

Flag for activating efficient reading with one single read.

integer(kind=I4P), intent(out), optional :: iostat

IO error.

character(len=*), intent(out), optional :: iomsg

IO error message.

Return Value character(len=:), allocatable

Output string containing the file data as a single stream.

Description

Load file contents and store as single characters stream.


Subroutines

private elemental subroutine free(self)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(inout) :: self

XML file.

Description

Free dynamic memory.

private subroutine finalize(file)

Arguments

Type IntentOptional AttributesName
type(xml_file), intent(inout) :: file

XML file.

Description

Free dynamic memory when finalizing.

private subroutine parse(self, string, filename)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(inout) :: self

XML file.

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

String containing xml data.

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

File name containing xml data.

Description

Parse xml data from string or file.

private elemental subroutine add_tag(self, tag)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(inout) :: self

XML file.

type(xml_tag), intent(in) :: tag

XML tag.

Description

Add tag to XML file.

private elemental subroutine delete_tag(self, name)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(inout) :: self

XML file.

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

XML tag name.

Description

Delete tag from XML file.

private subroutine parse_from_string(self, source_string)

Arguments

Type IntentOptional AttributesName
class(xml_file), intent(inout) :: self

XML file.

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

String containing xml data.

Description

Parse xml data from string.