26 #ifndef _DJI_TXT_PARSER_HH 27 #define _DJI_TXT_PARSER_HH 29 #include <sys/types.h> 33 #define DEBUG_RECORD_PARSING 1 36 u_int8_t
getByte(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
37 u_int16_t
get2BytesBE(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
38 u_int16_t
get2BytesLE(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
39 unsigned getWord32BE(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
40 unsigned getWord32LE(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
41 u_int64_t
getWord64LE(u_int8_t
const*& ptr, u_int8_t
const* limit = NULL);
44 void printString(
char const* label, u_int8_t
const*& ptr,
unsigned stringLength, u_int8_t
const* limit = NULL);
45 void printHex(
char const* label, u_int8_t
const*& ptr, u_int8_t
const* limit);
47 #define END_OF_DATA 1 // exception thrown if parsing unexpectedly reaches the end of the buffer 59 virtual void parseDetailsArea(u_int8_t
const*& ptr, u_int8_t
const* limit) = 0;
60 virtual int parseRecord(u_int8_t
const*& ptr, u_int8_t
const* limit,
int isScrambled) = 0;
61 virtual void outputOneRow(
int outputColumnLabels = 0) = 0;
u_int16_t get2BytesLE(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
static DJITxtParser * createNew()
virtual void summarizeRecordParsing()=0
void printHex(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)
u_int16_t get2BytesBE(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
virtual void outputOneRow(int outputColumnLabels=0)=0
unsigned getWord32BE(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
virtual void parseDetailsArea(u_int8_t const *&ptr, u_int8_t const *limit)=0
void printString(char const *label, u_int8_t const *&ptr, unsigned stringLength, u_int8_t const *limit=NULL)
u_int8_t getByte(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
u_int64_t getWord64LE(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
unsigned getWord32LE(u_int8_t const *&ptr, u_int8_t const *limit=NULL)
virtual int parseRecord(u_int8_t const *&ptr, u_int8_t const *limit, int isScrambled)=0