summaryrefslogtreecommitdiff
path: root/src/csv.ads
blob: 74c2971fc86c7e3074e5d526412ecec838d20ca5 (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


with Ada.Strings.Unbounded;
with Ada.Containers.Vectors;
use type Ada.Strings.Unbounded.Unbounded_String;


generic
    Delimiter : in Character := ',';
    Quote     : in Character := '"';
    Escape    : in Character := '\';
package CSV is


    package String_Vectors is new Ada.Containers.Vectors
           (Index_Type   => Positive,
            Element_Type => Ada.Strings.Unbounded.Unbounded_String);


    subtype CSV_Record is String_Vectors.Vector;


    function Parse_Line
           (Input : in String)
        return CSV_Record;


    function Unparse_Record
           (Input : in CSV_Record)
        return String;


end CSV;