fpm_versioning Module

Implementation of versioning data for comparing packages


Uses


Contents


Interfaces

public interface char

  • private function as_string(self) result(string)

    Arguments

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

    Version number

    Return Value character(len=:), allocatable

    Character representation of the version

public interface new_version

  • private subroutine new_version_from_string(self, string, error)

    Create a new version from a string

    Arguments

    Type IntentOptional AttributesName
    type(version_t), intent(out) :: self

    Instance of the versioning data

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

    String describing the version information

    type(error_t), intent(out), allocatable:: error

    Error handling

  • private subroutine new_version_from_int(self, num)

    Create a new version from a string

    Arguments

    Type IntentOptional AttributesName
    type(version_t), intent(out) :: self

    Instance of the versioning data

    integer, intent(in) :: num(:)

    Subversion numbers to define version data


Derived Types

type, public :: version_t

Type-Bound Procedures

generic, public :: operator(.match.) => match

Compare a version against a version constraint (x.x.0 <= v < x.x.HUGE)

generic, public :: operator(/=) => not_equals
generic, public :: operator(<) => less
generic, public :: operator(<=) => less_equals
generic, public :: operator(==) => equals
generic, public :: operator(>) => greater
generic, public :: operator(>=) => greater_equals
procedure, public :: to_string

Create a printable string from a version data type