module Version: sig .. end
Definition of the various versions of the class file format.
Type
type t =
| |
Java_1_0 |
| |
Java_1_1 |
| |
Java_1_2 |
| |
Java_1_3 |
| |
Java_1_4 |
| |
Java_1_5 |
| |
Java_1_6 |
| |
Java_1_7 |
| |
Java_1_8 |
val all : t list
The list of versions, in ascending order.
val default : t
The default version used by the library (currently Java_1_7).
val to_string : t -> string
Converts the passed version into a string.
type bound = {
|
bound_version :t; |
|
bound_feature :string; |
}
The type representing version bounds for a given feature.
type bounds = bound * bound option
The type representing version intervals.
The first component is lower bound, while the second one is the
(optional) higher bound.
val make_bounds : string -> t -> t option -> bounds
make_bounds f lo hi returns a version interval for feature f,
with lower version lo, and optional higher version hi.
Both bounds are inclusive. The string f is copied.
val empty_bounds : bounds -> bool
Checks whether the passed bounds consists in an empty interval.
Exception
type error =
exception Exception of error
val string_of_error : error -> string
Constants
val min_supported : Utils.u2 * Utils.u2
This value represents the minimum supported version of the class file
format in (major, minor) fomat.
val max_supported : Utils.u2 * Utils.u2
This value represents the maximum supported version of the class file
format in (major, minor) fomat.
Conversion functions
val major_minor_of_version : t -> Utils.u2 * Utils.u2
Converts the passed version into (major, minor) format.
val version_of_major_minor : Utils.u2 * Utils.u2 -> t
Converts the passed version from (major, minor) format.
Utility functions
val at_least : string -> t -> t -> unit
at_least f v x raises Exception if x is below v.
f is the textual description of the feature tested for version.
val at_most : string -> t -> t -> unit
at_most f v x raises Exception if x is above v.
f is the textual description of the feature tested for version.
val check : bounds -> t -> unit
check b v checks that version v is in bounds b, raising
Exception if not.
val intersect : bounds -> bounds -> bounds
intersect v1 v2 compute the intersection of the intervals
represented by bounds v1 and v2. The returned bounds may
represent an empty interval (where the higher bound is below
the lower bound.
val intersect_list : bounds list -> bounds
intersect_list l applies intersect to l.
Raises Invalid_argument if l is empty.
val equal : t -> t -> bool
Equality over versions.
val compare : t -> t -> int
Comparison over versions.
val hash : t -> int
Hash function over versions.