ZEDA  1.6.18
Data Structures | Macros | Functions
zeda_csv.h File Reference

CSV file operations. More...

#include <zeda/zeda_string.h>
Include dependency graph for zeda_csv.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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

CSV file operations.

Author
Zhidao

This module is not available in the kernel space, since it requires the file pointer.