blob: 548d03aa6480ca244dd69a41d9493ad2781cd2cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
private with Ada.Strings.Unbounded;
-- This source is licensed under Creative Commons CC0 v1.0.
--
-- To read the full text, see license.txt in the main directory of this repository
-- or go to https://creativecommons.org/publicdomain/zero/1.0/legalcode.txt
--
-- For a human readable summary, go to https://creativecommons.org/publicdomain/zero/1.0/
package Candidates is
type State_Name is (ACT, NT, TAS, SA, WA, VIC, QLD, NSW);
type Candidate is private;
-- this is restricted to 255 values for memory conservation reasons
type CandidateID is new Positive range 1 .. 255;
subtype Extended_CandidateID is CandidateID'Base
range CandidateID'First - 1 .. CandidateID'Last;
No_Candidate : constant Extended_CandidateID := Extended_CandidateID'First;
function To_String
(Input_Candidate : in Candidate;
Delimiter : in Character := ',')
return String;
function Candidate_Header
(Delimiter : in Character := ',')
return String;
function Name_And_Party
(Input_Candidate : in Candidate)
return String;
private
package SU renames Ada.Strings.Unbounded;
type Candidate is record
First_Name : SU.Unbounded_String;
Last_Name : SU.Unbounded_String;
Group : SU.Unbounded_String;
Group_Rank : SU.Unbounded_String;
Party : SU.Unbounded_String;
end record;
end Candidates;
|