temp_dir_manager Derived Type

type, public :: temp_dir_manager


Components

Type Visibility Attributes Name Initial
character(len=:), public, allocatable :: path
logical, public :: cleanup_on_destroy = .true.

Finalization Procedures

final :: temp_dir_destroy

  • private subroutine temp_dir_destroy(this)

    Arguments

    Type IntentOptional Attributes Name
    type(temp_dir_manager), intent(inout) :: this

Type-Bound Procedures

procedure, public :: create => temp_dir_create

  • private subroutine temp_dir_create(this, prefix)

    Arguments

    Type IntentOptional Attributes Name
    class(temp_dir_manager), intent(inout) :: this
    character(len=*), intent(in) :: prefix

procedure, public :: get_path => temp_dir_get_path

  • private function temp_dir_get_path(this) result(path)

    Arguments

    Type IntentOptional Attributes Name
    class(temp_dir_manager), intent(in) :: this

    Return Value character(len=:), allocatable

procedure, public :: get_file_path => temp_dir_get_file_path

  • private function temp_dir_get_file_path(this, filename) result(file_path)

    Arguments

    Type IntentOptional Attributes Name
    class(temp_dir_manager), intent(in) :: this
    character(len=*), intent(in) :: filename

    Return Value character(len=:), allocatable

procedure, public :: cleanup => temp_dir_cleanup

  • private subroutine temp_dir_cleanup(this)

    Arguments

    Type IntentOptional Attributes Name
    class(temp_dir_manager), intent(inout) :: this

Source Code

    type :: temp_dir_manager
        character(len=:), allocatable :: path
        logical :: cleanup_on_destroy = .true.
    contains
        procedure :: create => temp_dir_create
        procedure :: get_path => temp_dir_get_path
        procedure :: get_file_path => temp_dir_get_file_path
        procedure :: cleanup => temp_dir_cleanup
        final :: temp_dir_destroy
    end type temp_dir_manager