Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
type(string), | private | :: | tag_name | ||||
type(string), | private | :: | tag_content | ||||
type(string), | private, | allocatable | :: | attribute(:,:) | |||
integer(kind=I4P), | private | :: | attributes_number | = | 0 | ||
integer(kind=I4P), | private | :: | indent | = | 0 | ||
logical, | private | :: | is_self_closing | = | .false. |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character, | intent(in) | :: | name | |||
character, | intent(in), | optional | :: | attribute(1:) | ||
character, | intent(in), | optional | :: | attributes(1:,1:) | ||
character, | intent(in), | optional | :: | attributes_stream | ||
logical, | intent(in), | optional | :: | sanitize_attributes_value | ||
character, | intent(in), | optional | :: | content | ||
integer(kind=I4P), | intent(in), | optional | :: | indent | ||
logical, | intent(in), | optional | :: | is_content_indented | ||
logical, | intent(in), | optional | :: | is_self_closing |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character, | intent(in) | :: | name | |||
type(xml_tag), | intent(in) | :: | content | |||
character, | intent(in), | optional | :: | attribute(1:) | ||
character, | intent(in), | optional | :: | attributes(1:,1:) | ||
character, | intent(in), | optional | :: | attributes_stream | ||
logical, | intent(in), | optional | :: | sanitize_attributes_value | ||
integer(kind=I4P), | intent(in), | optional | :: | indent | ||
logical, | intent(in), | optional | :: | is_content_indented |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attribute(1:) | |||
logical, | intent(in), | optional | :: | sanitize_value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attributes(1:,1:) | |||
logical, | intent(in), | optional | :: | sanitize_values |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attributes_stream | |||
logical, | intent(in), | optional | :: | sanitize_values |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | |||
character, | intent(in) | :: | name | |||
character(len=:), | intent(out), | allocatable | :: | content |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | name |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | name(1:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | |||
character, | intent(in) | :: | name |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | |||
logical, | intent(in), | optional | :: | is_indented |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in), | optional | :: | name | ||
character, | intent(in), | optional | :: | attribute(1:) | ||
character, | intent(in), | optional | :: | attributes(1:,1:) | ||
character, | intent(in), | optional | :: | attributes_stream | ||
logical, | intent(in), | optional | :: | sanitize_attributes_value | ||
character, | intent(in), | optional | :: | content | ||
integer(kind=I4P), | intent(in), | optional | :: | indent | ||
logical, | intent(in), | optional | :: | is_content_indented | ||
logical, | intent(in), | optional | :: | is_self_closing |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | |||
logical, | intent(in), | optional | :: | is_indented | ||
logical, | intent(in), | optional | :: | is_content_indented | ||
logical, | intent(in), | optional | :: | only_start | ||
logical, | intent(in), | optional | :: | only_content | ||
logical, | intent(in), | optional | :: | only_end |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(in) | :: | self | |||
integer(kind=I4P), | intent(in) | :: | unit | |||
logical, | intent(in), | optional | :: | is_indented | ||
logical, | intent(in), | optional | :: | is_content_indented | ||
character, | intent(in), | optional | :: | form | ||
character, | intent(in), | optional | :: | end_record | ||
logical, | intent(in), | optional | :: | only_start | ||
logical, | intent(in), | optional | :: | only_content | ||
logical, | intent(in), | optional | :: | only_end | ||
integer(kind=I4P), | intent(out), | optional | :: | iostat | ||
character, | intent(out), | optional | :: | iomsg |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | lhs | |||
type(xml_tag), | intent(in) | :: | rhs |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attribute(1:) | |||
logical, | intent(in), | optional | :: | sanitize_value |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attributes(1:,1:) | |||
logical, | intent(in), | optional | :: | sanitize_values |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | attributes_stream | |||
logical, | intent(in), | optional | :: | sanitize_values |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
integer(kind=I4P), | intent(in) | :: | Na |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | name |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | name(1:) |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | source |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | source | |||
integer(kind=I4P), | intent(out), | optional | :: | tstart | ||
integer(kind=I4P), | intent(out), | optional | :: | tend |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | source |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | self | |||
character, | intent(in) | :: | tag_name | |||
character, | intent(in) | :: | source | |||
integer(kind=I4P), | intent(out), | optional | :: | tstart | ||
integer(kind=I4P), | intent(out), | optional | :: | tend |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(xml_tag), | intent(inout) | :: | lhs | |||
type(xml_tag), | intent(in) | :: | rhs |
type :: xml_tag
!< XML tag class.
!<
!< A valid XML tag must have the following syntax for a tag without a content (with only attributes):
!<```xml
!< <Tag_Name att#1_Name="att#1_val" att#2_Name="att#2_val"... att#Nt_Name="att#Nt_val"/>
!<```
!< while a tag with a content must have the following syntax:
!<```xml
!< <Tag_Name att#1_Name="att#1_val" att#2_Name="att#2_val"... att#Nt_Name="att#Nt_val">Tag_Content</Tag_Name>
!<```
!<
!< It is worth noting that the syntax is case sensitive and that the attributes are optional. Each attribute name must be followed
!< by '="' without any additional white spaces and its value must be termined by '"'. Each attribute is separated by one or more
!< white spaces.
private
type(string) :: tag_name !< Tag name.
type(string) :: tag_content !< Tag content.
type(string), allocatable :: attribute(:,:) !< Attributes names/values pairs, [1:2, 1:].
integer(I4P) :: attributes_number=0 !< Number of defined attributes.
integer(I4P) :: indent=0 !< Number of indent-white-spaces.
logical :: is_self_closing=.false. !< Self closing tag flag.
contains
! public methods
generic :: add_attributes => &
add_single_attribute, &
add_multiple_attributes, &
add_stream_attributes !< Add attributes name/value pairs.
procedure, pass(self) :: attributes !< Return attributes name/value pairs as string.
procedure, pass(self) :: get_content !< Return tag content.
generic :: delete_attributes => &
delete_single_attribute, &
delete_multiple_attributes !< Delete attributes name/value pairs.
procedure, pass(self) :: delete_content !< Delete tag conent.
procedure, pass(self) :: end_tag !< Return `</tag_name>` end tag.
procedure, pass(self) :: free !< Free dynamic memory.
procedure, pass(self) :: is_attribute_present !< Return .true. it the queried attribute name is defined.
procedure, pass(self) :: is_parsed !< Check is tag is correctly parsed, i.e. its *tag_name* is allocated.
procedure, pass(self) :: name !< Return tag name.
procedure, pass(self) :: parse !< Parse the tag contained into a source string.
procedure, pass(self) :: self_closing_tag !< Return `<tag_name.../>` self closing tag.
procedure, pass(self) :: set !< Set tag data.
procedure, pass(self) :: start_tag !< Return `<tag_name...>` start tag.
procedure, pass(self) :: stringify !< Convert the whole tag into a string.
procedure, pass(self) :: write => write_tag !< Write tag to unit file.
generic :: assignment(=) => assign_tag !< Assignment operator overloading.
! private methods
procedure, pass(self), private :: add_single_attribute !< Add one attribute name/value pair.
procedure, pass(self), private :: add_multiple_attributes !< Add list of attributes name/value pairs.
procedure, pass(self), private :: add_stream_attributes !< Add list of attributes name/value pairs passed as stream.
procedure, pass(self), private :: alloc_attributes !< Allocate (prepare for filling) dynamic memory of attributes.
procedure, pass(self), private :: delete_single_attribute !< Delete one attribute name/value pair.
procedure, pass(self), private :: delete_multiple_attributes !< Delete list of attributes name/value pairs.
procedure, pass(self), private :: get !< Get the tag value and attributes from source.
procedure, pass(self), private :: get_value !< Get the tag value from source after tag_name has been set.
procedure, pass(self), private :: get_attributes !< Get the attributes values from source.
procedure, pass(self), private :: parse_tag_name !< Parse the tag name contained into a string.
procedure, pass(self), private :: parse_attributes_names !< Parse the tag attributes names contained into a string.
procedure, pass(self), private :: search !< Search tag named *tag_name* into a string.
! operators
procedure, pass(lhs), private :: assign_tag !< Assignment between two tags.
#if (__GNUC__ < 9)
final :: finalize !< Free dynamic memory when finalizing.
#endif
endtype xml_tag