📄 qgsdbfbase.h
字号:
/*************************************************************************** qgsbdfbase.h - Dbase IV Header -------------------------------------- Date : 25-Dec-2003 Copyright : (C) 2003 by Gary E.Sherman email : sherman at mrcc.com *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************//* $Id: qgsdbfbase.h 851 2004-02-14 16:44:16Z gsherman $ */// Dbase header structurestruct DbaseHeader { unsigned char valid_dbf; char year; char month; char day; long num_recs; short size_hdr; short size_rec; char reserved[3]; char lan[13]; char reserved2[4];};// Field descriptor array - defines a field and its attributes (type,// length, etc.struct FieldDescriptorArray { char field_name[11]; char field_type; long field_addr; /* used only in memory */ unsigned char field_length; unsigned char field_decimal; char reserved[2]; char work_area; char lan[2]; char set_fields; char reserved2[8];};// Typedefstypedef struct FieldDescriptorArray Fda;typedef struct DbaseHeader DbH;// Field Array classclass DbaseFieldArray {public: DbaseFieldArray(int numberOfFields); void addField(char *name, char type, unsigned char length, unsigned char decimal); int getNumFields(); Fda *getField(int index);private: struct FieldDescriptorArray *fda; unsigned int fieldCount; int numFields;};// Dbase file class (incomplete implementation)class DbaseFile {public: DbaseFile(char *fileName, int numRecords, int recordSize, DbaseFieldArray &fda); void writeHeader(); void writeFieldDescriptors(); void writeRecord(const char *data); void closeFile(); struct DbaseHeader header;private: char * fileName; int numRecords; int recordSize; DbaseFieldArray fieldArray; long pos; bool firstRecord;};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -