Loading...
Searching...
No Matches
csv.h File Reference
`#include "arc/std/bool.h"`
`#include "arc/std/parser.h"`
`#include "arc/std/string.h"`
`#include <stdint.h>`

Go to the source code of this file.

## Data Structures

struct | ARC_ParserCSVData
| defines a csv data type, data is set by the callback passed in when createing a parserCSV as parser More...

## Macros

#define | ARC_PARSER_CSV_CHAR_COMMA 1
#define | ARC_PARSER_CSV_CHAR_NEWLINE 2
#define | ARC_PARSER_CSV_CHAR_BEFORE_COMMA 3
#define | ARC_PARSER_CSV_CHAR_AFTER_COMMA 4
#define | ARC_PARSER_CSV_LINE 5
#define | ARC_PARSER_CSV_DATA 6
#define | ARC_PARSER_CSV_STRING 7
#define | ARC_PARSER_CSV_NON_COMMA_CHAR 8

## Typedefs

typedef void(* | ARC_ParserCSV_CastTypeFn) (void **data, ARC_String *string)
| a callback for the csv parser to use to cast that data the stored data
typedef void(* | ARC_ParserCSV_DestroyTypeFn) (void *data)
| a callback for the csv parser to use to free csv data
typedef struct ARC_ParserCSVData | ARC_ParserCSVData
| defines a csv data type, data is set by the callback passed in when createing a parserCSV as parser

## Functions

void | ARC_ParserCSV_CreateAsParser (ARC_Parser **parser, ARC_Bool header, ARC_ParserCSV_CastTypeFn castTypeFn, ARC_ParserCSV_DestroyTypeFn destroyTypeFn)
| creates a parser for the Parser Lang

## Macro Definition Documentation

## ARC_PARSER_CSV_CHAR_AFTER_COMMA

#define ARC_PARSER_CSV_CHAR_AFTER_COMMA 4

Definition at line 66 of file csv.h.

## ARC_PARSER_CSV_CHAR_BEFORE_COMMA

#define ARC_PARSER_CSV_CHAR_BEFORE_COMMA 3

Definition at line 65 of file csv.h.

## ARC_PARSER_CSV_CHAR_COMMA

#define ARC_PARSER_CSV_CHAR_COMMA 1

Definition at line 63 of file csv.h.

## ARC_PARSER_CSV_CHAR_NEWLINE

#define ARC_PARSER_CSV_CHAR_NEWLINE 2

Definition at line 64 of file csv.h.

## ARC_PARSER_CSV_DATA

#define ARC_PARSER_CSV_DATA 6

Definition at line 68 of file csv.h.

## ARC_PARSER_CSV_LINE

#define ARC_PARSER_CSV_LINE 5

Definition at line 67 of file csv.h.

## ARC_PARSER_CSV_NON_COMMA_CHAR

#define ARC_PARSER_CSV_NON_COMMA_CHAR 8

Definition at line 70 of file csv.h.

## ARC_PARSER_CSV_STRING

#define ARC_PARSER_CSV_STRING 7

Definition at line 69 of file csv.h.

## Typedef Documentation

## ARC_ParserCSV_CastTypeFn

typedef void(* ARC_ParserCSV_CastTypeFn) (void **data, ARC_String *string)

a callback for the csv parser to use to cast that data the stored data

Note
  this callback will only be called on non-header data

Parameters

  | [in/out] | data the csv data casted into the users type
  [in] | string | an value of the csv as a string

Definition at line 28 of file csv.h.

## ARC_ParserCSV_DestroyTypeFn

typedef void(* ARC_ParserCSV_DestroyTypeFn) (void *data)

a callback for the csv parser to use to free csv data

Note
  this callback will only be called on non-header data

Parameters

  [in] | data | the csv data to free

Definition at line 37 of file csv.h.

## ARC_ParserCSVData

typedef struct ARC_ParserCSVData ARC_ParserCSVData

defines a csv data type, data is set by the callback passed in when createing a parserCSV as parser

Note
  this data can be retieved after parsing by calling get data, check arc/std/parser.h for more information

## Function Documentation

## ARC_ParserCSV_CreateAsParser()

void ARC_ParserCSV_CreateAsParser | ( | ARC_Parser ** | parser,
|  | ARC_Bool | header,
|  | ARC_ParserCSV_CastTypeFn | castTypeFn,
|  | ARC_ParserCSV_DestroyTypeFn | destroyTypeFn )

creates a parser for the Parser Lang

Note
  the rules will be inited for the parser lang
  the parsed data will be saved as a vector of ARC_ParserLanguageTag

Parameters

  [out] | parser | the parser to create