ZEDA  1.6.18
Data Structures | Macros | Functions
file operations.

Data Structures

struct  zCSV
 CSV manager class. More...
 

Macros

#define zCSVLineNum(csv)   (csv)->nl
 number of lines of a CSV file. More...
 
#define zCSVIsEOF(csv)   feof( (csv)->fp )
 check if the stream is at the end-of-file. More...
 
#define zCSVLineIsEmpty(csv)   ( (csv)->buf[0] == '\0' )
 check if the current buffer is exhausted. More...
 

Functions

zCSVzCSVOpen (zCSV *csv, char filename[])
 open a CSV file. More...
 
void zCSVClose (zCSV *csv)
 close a CSV file. More...
 
void zCSVRewind (zCSV *csv)
 rewind the stream of a CSV file. More...
 
char * zCSVGetLine (zCSV *csv)
 get a line from the current stream of a CSV file. More...
 
char * zCSVGoToLine (zCSV *csv, int i)
 go to a specified line in a CSV file. More...
 
char * zCSVGetField (zCSV *csv, char *field, size_t size)
 get a field from the current buffer of a CSV file. More...
 
char * zCSVSkipField (zCSV *csv)
 skip a field from the current buffer of a CSV file. More...
 
bool zCSVGetInt (zCSV *csv, int *val)
 get an integer value from the current buffer of a CSV file. More...
 
bool zCSVGetIntN (zCSV *csv, int val[], int n)
 get multiple integer values from the current buffer of a CSV file. More...
 
bool zCSVGetDouble (zCSV *csv, double *val)
 get a double-precision floating-point value from the current buffer of a CSV file. More...
 
bool zCSVGetDoubleN (zCSV *csv, double val[], int n)
 get multiple double-precision floating-point values from the current buffer of a CSV file. More...
 

Detailed Description

Macro Definition Documentation

◆ zCSVLineNum

#define zCSVLineNum (   csv)    (csv)->nl

number of lines of a CSV file.

◆ zCSVIsEOF

#define zCSVIsEOF (   csv)    feof( (csv)->fp )

check if the stream is at the end-of-file.

◆ zCSVLineIsEmpty

#define zCSVLineIsEmpty (   csv)    ( (csv)->buf[0] == '\0' )

check if the current buffer is exhausted.

Function Documentation

◆ zCSVOpen()

zCSV* zCSVOpen ( zCSV csv,
char  filename[] 
)

open a CSV file.

◆ zCSVClose()

void zCSVClose ( zCSV csv)

close a CSV file.

◆ zCSVRewind()

void zCSVRewind ( zCSV csv)

rewind the stream of a CSV file.

◆ zCSVGetLine()

char* zCSVGetLine ( zCSV csv)

get a line from the current stream of a CSV file.

◆ zCSVGoToLine()

char* zCSVGoToLine ( zCSV csv,
int  i 
)

go to a specified line in a CSV file.

◆ zCSVGetField()

char* zCSVGetField ( zCSV csv,
char *  field,
size_t  size 
)

get a field from the current buffer of a CSV file.

◆ zCSVSkipField()

char* zCSVSkipField ( zCSV csv)

skip a field from the current buffer of a CSV file.

◆ zCSVGetInt()

bool zCSVGetInt ( zCSV csv,
int *  val 
)

get an integer value from the current buffer of a CSV file.

◆ zCSVGetIntN()

bool zCSVGetIntN ( zCSV csv,
int  val[],
int  n 
)

get multiple integer values from the current buffer of a CSV file.

◆ zCSVGetDouble()

bool zCSVGetDouble ( zCSV csv,
double *  val 
)

get a double-precision floating-point value from the current buffer of a CSV file.

◆ zCSVGetDoubleN()

bool zCSVGetDoubleN ( zCSV csv,
double  val[],
int  n 
)

get multiple double-precision floating-point values from the current buffer of a CSV file.