53#ifndef HEADER_INCLUDED__SAGA_API__table_dbase_H
54#define HEADER_INCLUDED__SAGA_API__table_dbase_H
74#define DBF_FT_NONE '\0'
75#define DBF_FT_CHARACTER 'C'
76#define DBF_FT_DATE 'D'
77#define DBF_FT_FLOAT 'F'
78#define DBF_FT_NUMERIC 'N'
79#define DBF_FT_LOGICAL 'L'
80#define DBF_FT_MEMO 'M'
102 bool is_Open (
void)
const {
return( m_hFile != NULL ); }
106 {
return( m_nFields ); }
109 {
return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Name : NULL ); }
112 {
return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Type :
DBF_FT_NONE ); }
115 {
return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Width : 0 ); }
118 {
return( iField >= 0 && iField < m_nFields ? m_Fields[iField].Decimals : 0 ); }
137 bool asInt (
int iField,
int &Value);
138 bool asDouble (
int iField,
double &Value);
142 bool Set_Value (
int iField,
double Value);
150 char Name[12], Type, Displacement[4], WorkAreaID, ProductionIdx;
152 unsigned char Width, Decimals;
160 char LastUpdate[3], Transaction, LanguageDrvID, ProductionIdx;
162 unsigned char FileType, bEncrypted;
169 bool m_bReadOnly, m_bModified;
173 short m_nHeaderBytes, m_nRecordBytes;
175 int m_nFields, m_nRecords, m_Encoding;
181 TDBF_Field *m_Fields;
184 bool Write (
void *buffer,
size_t size,
size_t count);
185 bool Read (
void *buffer,
size_t size,
size_t count);
187 void Header_Write (
void);
188 bool Header_Read (
void);
190 void Init_Record (
void);
virtual ~CSG_Table_DBase(void)
int Get_Field_Width(int iField)
bool asInt(int iField, int &Value)
int Get_File_Position(void)
int Get_File_Length(void)
bool asDouble(int iField, double &Value)
const char * Get_Field_Name(int iField)
bool Set_Value(int iField, double Value)
int Get_Field_Count(void)
bool Open_Write(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true)
int Get_Field_Decimals(int iField)
char Get_Field_Type(int iField)
CSG_String asString(int iField)
CSG_Table_DBase(int Encoding=SG_FILE_ENCODING_ANSI)
bool Set_NoData(int iField)
bool Open_Read(const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true)