add_tag Subroutine

private elemental subroutine add_tag(self, tag)

Add tag to XML file.

Type Bound

xml_file

Arguments

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

XML file.

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

XML tag.


Called by

proc~~add_tag~~CalledByGraph proc~add_tag xml_file%add_tag proc~parse_from_string xml_file%parse_from_string proc~parse_from_string->proc~add_tag program~foxy_test_add_tag foxy_test_add_tag program~foxy_test_add_tag->proc~add_tag proc~parse~2 xml_file%parse proc~parse~2->proc~parse_from_string program~foxy_test_delete_tag foxy_test_delete_tag program~foxy_test_delete_tag->proc~parse~2 program~foxy_test_parse_file_simple foxy_test_parse_file_simple program~foxy_test_parse_file_simple->proc~parse~2 program~foxy_test_parse_string_nested_tags foxy_test_parse_string_nested_tags program~foxy_test_parse_string_nested_tags->proc~parse~2 program~foxy_test_parse_string_simple foxy_test_parse_string_simple program~foxy_test_parse_string_simple->proc~parse~2 program~foxy_test_write_tag foxy_test_write_tag program~foxy_test_write_tag->proc~parse~2

Source Code

   elemental subroutine add_tag(self, tag)
   !< Add tag to XML file.
   class(xml_file), intent(inout) :: self       !< XML file.
   type(xml_tag),   intent(in)    :: tag        !< XML tag.
   type(xml_tag), allocatable     :: tag_new(:) !< New (extended) tags array.

   if (self%nt>0_I4P) then
      allocate(tag_new(1:self%nt + 1))
      tag_new(1:self%nt) = self%tag(1:self%nt)
      tag_new(self%nt + 1) = tag
   else
      allocate(tag_new(1:1))
      tag_new(1) = tag
   endif

   call move_alloc(from=tag_new, to=self%tag)
   self%nt = self%nt + 1
   endsubroutine add_tag