Miscellaneous refactoring

This commit is contained in:
Jano at Zelda
2018-02-16 19:58:27 +01:00
parent 724359c0d1
commit ec00e07e79
13 changed files with 183 additions and 189 deletions
+36
View File
@@ -0,0 +1,36 @@
with Semantic_Versioning;
package Alire.Milestones with Preelaborate is
type Milestone (<>) is tagged private;
function "<" (L, R : Milestone) return Boolean;
function New_Milestone (Name : Project_Name;
Version : Semantic_Versioning.Version) return Milestone;
function Project (M : Milestone) return Project_Name;
function Version (M : Milestone) return Semantic_Versioning.Version;
private
type Milestone (Name_Len : Positive) is tagged record
Name : Project_Name (1 .. Name_Len);
Version : Semantic_Versioning.Version;
end record;
use all type Semantic_Versioning.Version;
function "<" (L, R : Milestone) return Boolean is
(L.Name < R.Name or else (L.Name = R.Name and then L.Version < R.Version));
function New_Milestone (Name : Project_Name;
Version : Semantic_Versioning.Version) return Milestone is
(Name'Length, Name, Version);
function Project (M : Milestone) return Project_Name is (M.Name);
function Version (M : Milestone) return Semantic_Versioning.Version is (M.Version);
end Alire.Milestones;