Something went wrong. Try again.
converts between regular CSV files and the binary CSV format as used in Harmonix Forge engine games (RB4, RBVR, etc)
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556/* (c) 2019 Jan Doczy * This code is licensed under MIT license (see LICENSE.txt for details) */
/* simple and fast CSV reader: * 1. Open CSV file by calling CsvOpen("filename.csv") * 2. Read CSV row by calling CsvReadNextRow(csv_handle) * 3. Read single CSV line column by calling CsvReadNextCol(returned_row_str, csv_handle) */
#ifndef CSV_H_INCLUDED#define CSV_H_INCLUDED
#ifdef __cplusplusextern "C" { /* C++ name mangling */#endif
/* pointer to private handle structure */typedef struct CsvHandle_ *CsvHandle;
/** * openes csv file * @filename: pathname of the file * @return: csv handle * @notes: you should call CsvClose() to release resources */CsvHandle CsvOpen(const char* filename);CsvHandle CsvOpen2(const char* filename, char delim, char quote, char escape);
/** * closes csv handle, releasing all resources * @handle: csv handle */void CsvClose(CsvHandle handle);
/** * reads (first / next) line of csv file * @handle: csv handle */char* CsvReadNextRow(CsvHandle handle);
/** * get column of file * @row: csv row (you can use CsvReadNextRow() to parse next line) * @context: handle returned by CsvOpen() or CsvOpen2() */const char* CsvReadNextCol(char* row, CsvHandle handle);
#ifdef __cplusplus};#endif
#endif