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


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


--  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/


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;