summaryrefslogtreecommitdiff
path: root/src/csv.ads
blob: a8273f5d13f6ec6afd23b342e46294852c7d0746 (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   => Natural,
            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;