32 while (mask != 0x00 && (mask&0x01) == 0) {
37 fFieldDatabase->addByteField(label,
byte, 0);
42 float divisor,
int isSigned) {
43 u_int8_t
byte =
getByte(ptr, limit);
47 float value = isSigned ? (int8_t)
byte/divisor :
byte/divisor;
48 fFieldDatabase->addFloatField(label, value);
51 fFieldDatabase->addByteField(label,
byte, isSigned);
57 float divisor, int16_t offset,
int isSigned) {
63 float value = isSigned ? (int16_t)bytes/divisor : bytes/divisor;
64 fFieldDatabase->addFloatField(label, value);
67 fFieldDatabase->add2ByteField(label, bytes, isSigned);
73 float divisor,
int isSigned) {
78 float value = isSigned ? (int32_t)bytes/divisor : bytes/divisor;
79 fFieldDatabase->addFloatField(label, value);
82 fFieldDatabase->add4ByteField(label, bytes, isSigned);
90 float value = *(
float*)&bytes;
91 if (divisor != 0.0) value /= divisor;
92 fFieldDatabase->addFloatField(label, value);
98 fFieldDatabase->addDoubleField(label, *(
double*)&bytes);
102 #define PI 3.14159265359 108 double* value = (
double*)&bytes;
111 fFieldDatabase->addDoubleField(label, (*value)*(180/
PI));
117 double* value = (
double*)&bytes;
119 fFieldDatabase->addDoubleField(label, *value);
125 fFieldDatabase->add2ByteDateField(label, bytes);
130 int isInMilliseconds) {
132 fFieldDatabase->add8ByteTimestampField(label, value, isInMilliseconds);
136 ::noteStringField(
char const* label, u_int8_t
const*& ptr,
unsigned stringLength, u_int8_t
const* limit) {
137 if (limit != NULL && ptr > limit - stringLength)
throw END_OF_DATA;
139 char str[stringLength+1];
141 for (i = 0; i < stringLength; ++i) str[i] = *ptr++;
144 fFieldDatabase->addStringField(label, str);
149 u_int8_t v1 =
getByte(ptr, limit);
150 u_int8_t v2 =
getByte(ptr, limit);
151 u_int8_t v3 =
getByte(ptr, limit);
154 u_int32_t value = (v1<<24)|(v2<<16)|(v3<<8);
155 fFieldDatabase->add4ByteVersionField(label, value);
u_int8_t getByte(u_int8_t const *&ptr, u_int8_t const *limit)
u_int64_t getWord64LE(u_int8_t const *&ptr, u_int8_t const *limit)
void note8ByteDoubleField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)
void note8ByteLatitudeOrLongitudeFieldInDegrees(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)
unsigned getWord32LE(u_int8_t const *&ptr, u_int8_t const *limit)
void note8ByteLatitudeOrLongitudeFieldInRadians(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)
void enterSubByteField(char const *label, u_int8_t byte, u_int8_t mask)
void note4ByteField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit, float divisor=0.0, int isSigned=0)
void note8ByteTimestampField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit, int isInMilliseconds=0)
void note3ByteVersionField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)
u_int16_t get2BytesLE(u_int8_t const *&ptr, u_int8_t const *limit)
void noteStringField(char const *label, u_int8_t const *&ptr, unsigned stringLength, u_int8_t const *limit)
void note2ByteField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit, float divisor=0.0, int16_t offset=0, int isSigned=0)
void note4ByteFloatField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit, float divisor=0.0)
void noteByteField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit, float divisor=0.0, int isSigned=0)
void note2ByteDateField(char const *label, u_int8_t const *&ptr, u_int8_t const *limit)