genomicSimulationC 0.2.6
Data Fields
gsc_TableFileReader Struct Reference

Stream reader for files of some tabular format. More...

#include <sim-operations.h>

Data Fields

FILE * fp
 File being read. More...
 
char buf [8192]
 A window of characters from the file, loaded into memory for current processing. More...
 
int buf_fill
 Number of characters from the file that are currently loaded in buf. More...
 
int cursor
 Index in buf of the first character that the file reader has not yet parsed. More...
 

Detailed Description

Stream reader for files of some tabular format.

Expected usage is the use of gsc_tablefilereader_create to create an instance of this struct, repeated calls to gsc_tablefilereader_get_next to parse the file, and gsc_tablefilereader_close to close the file after use. The internals of this struct are not intended to be manually manipulated.

A table file consists of one or more lines (separated by
, \r, or \r
) and one or more columns (separated by any combination of \t, ' ', or ','). Line and column separators do not need to be consistent across different line/column gaps in the file.

In the current implementation, the maximum length of a cell that can be read by this file reader is 8192 characters.

Multi-byte characters are not handled correctly in this current implementation.

See also
gsc_tablefilereader_create
gsc_tablefilereader_close
gsc_tablefilereader_get_next

Definition at line 898 of file sim-operations.h.

Field Documentation

◆ buf

char gsc_TableFileReader::buf[8192]

A window of characters from the file, loaded into memory for current processing.

In current implementation, has a maximum capacity of 8192 characters.

Definition at line 901 of file sim-operations.h.

◆ buf_fill

int gsc_TableFileReader::buf_fill

Number of characters from the file that are currently loaded in buf.

Definition at line 903 of file sim-operations.h.

◆ cursor

int gsc_TableFileReader::cursor

Index in buf of the first character that the file reader has not yet parsed.

Definition at line 904 of file sim-operations.h.

◆ fp

FILE* gsc_TableFileReader::fp

File being read.

gsc_tablefilereader_create ensures this is a file successfully opened for reading.

Definition at line 899 of file sim-operations.h.


The documentation for this struct was generated from the following file: