| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(xml_tag), | private, | allocatable | :: | tag(:) | |||
| integer(kind=I4P), | private | :: | nt | = | 0_I4P |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(xml_file), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | name |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(xml_file), | intent(inout) | :: | self | |||
| character(len=*), | intent(in) | :: | source_string |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(xml_file), | intent(in) | :: | self | |||
| type(xml_tag), | intent(in) | :: | tag | |||
| logical, | intent(inout) | :: | is_done(:) | |||
| character(len=:), | intent(inout), | allocatable | :: | tag_string |
type, public:: xml_file !< XML file class. private type(xml_tag), allocatable :: tag(:) !< XML tags array. integer(I4P) :: nt=0_I4P !< Number of XML tags. contains ! public methods procedure, pass(self) :: add_tag !< Add tag to XML file. procedure, pass(self) :: content !< Return tag content of tag named *name*. procedure, pass(self) :: delete_tag !< Add tag from XML file. procedure, pass(self) :: free !< Free dynamic memory. procedure, pass(self) :: parse !< Parse xml file. procedure, pass(self) :: stringify !< Convert the whole file data into a string. ! private methods procedure, pass(self), private :: add_child !< Add child ID to tag children list. procedure, pass(self), private :: parse_from_string !< Parse xml data from string. procedure, pass(self), private :: stringify_recursive !< Convert recursively tags with children into a string. ! operators final :: finalize !< Free dynamic memory when finalizing. endtype xml_file