# Module OASISVersion

    module OASISVersion: sig .. end

Version comparisons

This module handles versions and version comparators. A version is a string of the form "1.0.0". We compare integer and non-integer parts between to version to order them. Version comparators defined relations to a set of version. E.g. ">= 1.0.0" is a version comparator and defines all version above "1.0.0", including "1.0.0".

The version comparison is done using Debian policy for version.

- Author(s): Sylvain Le Gall

### Version

    type t

    val version_compare : t -> t -> int

Compare versions.

    val version_of_string : string -> t

Convert a string to version.

    val string_of_version : t -> string

Convert a version to string.

    val value : t OASISValues.t

Version number value. Not exported.

    val odn_of_t : t -> OASISDataNotation.t

Dump `OASISDataNotation.t`. Not exported.

    val chop : t -> t

Remove the last part of a version, after the last '.'. I.e. 0.2.0~alpha1 -> 0.2.

### Version comparator

    type comparator =

`|` | `VGreater of `t``
`|` | `VGreaterEqual of `t``
`|` | `VEqual of `t``
`|` | `VLesser of `t``
`|` | `VLesserEqual of `t``
`|` | `VOr of `comparator * comparator``
`|` | `VAnd of `comparator * comparator``

    val comparator_apply : t -> comparator -> bool

Apply version comparator expression.

    val string_of_comparator : comparator -> string

Convert a comparator to string. Example of output `">= 3.12.1"`.

    val varname_of_comparator : comparator -> string

Convert a comparator to variable name.

    val comparator_of_string : string -> comparator

Convert a string to comparator. Not exported.

    val comparator_reduce : comparator -> comparator

Simplify comparator, if possible. Not exported.

    val comparator_value : comparator OASISValues.t

Check that we have a version constraint. Not exported.

    val odn_of_comparator : comparator -> OASISDataNotation.t

Dump `OASISDataNotation.t`. Not exported.

    module StringVersion: sig .. end

The module `OASISVersion.StringVersion` uses `string` for version.