1
/***************************************************************************
2
qgsbdfbase.h - Dbase IV Header
3
--------------------------------------
5
Copyright : (C) 2003 by Gary E.Sherman
6
email : sherman at mrcc.com
7
***************************************************************************
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
14
***************************************************************************/
15
/* $Id: qgsdbfbase.h,v 1.3 2004/02/14 16:44:16 gsherman Exp $ */
17
// Dbase header structure
20
unsigned char valid_dbf;
31
// Field descriptor array - defines a field and its attributes (type,
33
struct FieldDescriptorArray {
36
long field_addr; /* used only in memory */
37
unsigned char field_length;
38
unsigned char field_decimal;
46
typedef struct FieldDescriptorArray Fda;
47
typedef struct DbaseHeader DbH;
50
class DbaseFieldArray {
52
DbaseFieldArray(int numberOfFields);
53
void addField(char *name, char type, unsigned char length,
54
unsigned char decimal);
56
Fda *getField(int index);
58
struct FieldDescriptorArray *fda;
59
unsigned int fieldCount;
64
// Dbase file class (incomplete implementation)
67
DbaseFile(char *fileName, int numRecords, int recordSize, DbaseFieldArray &fda);
69
void writeFieldDescriptors();
70
void writeRecord(const char *data);
72
struct DbaseHeader header;
77
DbaseFieldArray fieldArray;