#include <DataCSV.h>
Public Member Functions | |
bool | DataToStringCSV (const p_data_hdr_t &hdr, const uint8_t *buf, string &csv) |
int | ReadHeaderFromFile (FILE *pFile, uint32_t id, vector< data_info_t > &columnHeaders) |
bool | StringCSVToData (string &s, p_data_hdr_t &hdr, uint8_t *buf, uint32_t bufSize, const vector< data_info_t > &columnHeaders) |
int | WriteDataToFile (uint64_t orderId, FILE *pFile, const p_data_hdr_t &dataHdr, const uint8_t *dataBuf) |
int | WriteHeaderToFile (FILE *pFile, uint32_t id) |
bool cDataCSV::DataToStringCSV | ( | const p_data_hdr_t & | hdr, |
const uint8_t * | buf, | ||
string & | csv | ||
) |
Convert data to a csv string buf is assumed to be large enough to hold the data structure csv filled with csv data return true if success, false if no map found
Definition at line 184 of file DataCSV.cpp.
int cDataCSV::ReadHeaderFromFile | ( | FILE * | pFile, |
uint32_t | id, | ||
vector< data_info_t > & | columnHeaders | ||
) |
Definition at line 65 of file DataCSV.cpp.
bool cDataCSV::StringCSVToData | ( | string & | s, |
p_data_hdr_t & | hdr, | ||
uint8_t * | buf, | ||
uint32_t | bufSize, | ||
const vector< data_info_t > & | columnHeaders | ||
) |
Parse a csv string into a data packet data needs the id set to the proper data id buf memory to fill with data bufSize size of available memory in buf order id contains the value for ordering data returns true if success, false if no map found
Definition at line 139 of file DataCSV.cpp.
int cDataCSV::WriteDataToFile | ( | uint64_t | orderId, |
FILE * | pFile, | ||
const p_data_hdr_t & | dataHdr, | ||
const uint8_t * | dataBuf | ||
) |
Definition at line 117 of file DataCSV.cpp.
int cDataCSV::WriteHeaderToFile | ( | FILE * | pFile, |
uint32_t | id | ||
) |
Definition at line 39 of file DataCSV.cpp.