SAGA API
v9.6
|
#include <table_dbase.h>
Public Member Functions | |
CSG_Table_DBase (int Encoding=SG_FILE_ENCODING_ANSI) | |
virtual | ~CSG_Table_DBase (void) |
void | Close (void) |
bool | Open_Read (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Load=true) |
bool | Open_Write (const SG_Char *FileName, class CSG_Table *pTable, bool bRecords_Save=true) |
int | Get_Field_Count (void) |
const char * | Get_Field_Name (int iField) |
char | Get_Field_Type (int iField) |
int | Get_Field_Width (int iField) |
int | Get_Field_Decimals (int iField) |
int | Get_File_Position (void) |
int | Get_File_Length (void) |
int | Get_Count (void) |
bool | Move_First (void) |
bool | Move_Next (void) |
void | Add_Record (void) |
void | Flush_Record (void) |
bool | isDeleted (void) |
bool | asInt (int iField, int &Value) |
bool | asDouble (int iField, double &Value) |
CSG_String | asString (int iField) |
bool | Set_Value (int iField, double Value) |
bool | Set_Value (int iField, const CSG_String &Value) |
bool | Set_NoData (int iField) |
Definition at line 90 of file table_dbase.h.
CSG_Table_DBase::CSG_Table_DBase | ( | int | Encoding = SG_FILE_ENCODING_ANSI | ) |
Definition at line 82 of file table_dbase.cpp.
References CSG_Table::m_Encoding, and CSG_Table::m_nFields.
|
virtual |
Definition at line 92 of file table_dbase.cpp.
References Close().
void CSG_Table_DBase::Add_Record | ( | void | ) |
Definition at line 612 of file table_dbase.cpp.
Referenced by Open_Write().
bool CSG_Table_DBase::asDouble | ( | int | iField, |
double & | Value | ||
) |
Definition at line 667 of file table_dbase.cpp.
References CSG_String::asDouble(), CSG_String::asInt(), DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, CSG_String::Length(), CSG_String::Mid(), and CSG_String::Replace().
Referenced by asInt(), and Open_Read().
bool CSG_Table_DBase::asInt | ( | int | iField, |
int & | Value | ||
) |
Definition at line 652 of file table_dbase.cpp.
References asDouble().
CSG_String CSG_Table_DBase::asString | ( | int | iField | ) |
Definition at line 713 of file table_dbase.cpp.
References DBF_FT_DATE, CSG_String::from_UTF8(), SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF8, and CSG_String::Trim().
Referenced by Open_Read().
void CSG_Table_DBase::Close | ( | void | ) |
Definition at line 98 of file table_dbase.cpp.
References Flush_Record(), CSG_Table::m_nFields, CSG_Table::m_nRecords, and SG_FREE_SAFE.
Referenced by Open_Read(), Open_Write(), and ~CSG_Table_DBase().
void CSG_Table_DBase::Flush_Record | ( | void | ) |
Definition at line 630 of file table_dbase.cpp.
Referenced by Close(), Move_First(), Move_Next(), and Open_Write().
|
inline |
Definition at line 122 of file table_dbase.h.
Referenced by Open_Read().
|
inline |
Definition at line 103 of file table_dbase.h.
Referenced by Open_Read(), and Open_Write().
|
inline |
Definition at line 115 of file table_dbase.h.
Referenced by Open_Read().
|
inline |
Definition at line 106 of file table_dbase.h.
Referenced by Open_Read().
|
inline |
Definition at line 109 of file table_dbase.h.
References DBF_FT_NONE.
Referenced by Open_Read(), and Open_Write().
|
inline |
Definition at line 112 of file table_dbase.h.
|
inline |
Definition at line 121 of file table_dbase.h.
int CSG_Table_DBase::Get_File_Position | ( | void | ) |
Definition at line 552 of file table_dbase.cpp.
bool CSG_Table_DBase::isDeleted | ( | void | ) |
Definition at line 646 of file table_dbase.cpp.
bool CSG_Table_DBase::Move_First | ( | void | ) |
Definition at line 563 of file table_dbase.cpp.
References Flush_Record().
Referenced by Open_Read().
bool CSG_Table_DBase::Move_Next | ( | void | ) |
Definition at line 585 of file table_dbase.cpp.
References Flush_Record().
Referenced by Open_Read().
bool CSG_Table_DBase::Open_Read | ( | const SG_Char * | FileName, |
class CSG_Table * | pTable, | ||
bool | bRecords_Load = true |
||
) |
Definition at line 127 of file table_dbase.cpp.
References _TL, CSG_Table::Add_Field(), CSG_Table::Add_Record(), asDouble(), asString(), Close(), DBF_FT_CHARACTER, DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_LOGICAL, DBF_FT_NUMERIC, CSG_Table::Destroy(), Get_Count(), Get_Field_Count(), Get_Field_Decimals(), Get_Field_Name(), Get_Field_Type(), Move_First(), Move_Next(), CSG_Table_Record::Set_NoData(), CSG_Table_Record::Set_Value(), SG_DATATYPE_Char, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_Long, SG_DATATYPE_String, SG_UI_Msg_Add_Error(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().
bool CSG_Table_DBase::Open_Write | ( | const SG_Char * | FileName, |
class CSG_Table * | pTable, | ||
bool | bRecords_Save = true |
||
) |
Definition at line 307 of file table_dbase.cpp.
References _TL, Add_Record(), CSG_Table_Record::asDouble(), CSG_Table_Record::asString(), CSG_String::b_str(), Close(), DBF_FT_CHARACTER, DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, Flush_Record(), CSG_Table::Get_Count(), Get_Field_Count(), CSG_Table::Get_Field_Count(), CSG_Table::Get_Field_Length(), CSG_Table::Get_Field_Name(), Get_Field_Type(), CSG_Table::Get_Field_Type(), CSG_Table::Get_Record(), CSG_Table_Record::is_NoData(), CSG_String::Length(), CSG_Table::m_Encoding, CSG_Table::m_nFields, Set_NoData(), Set_Value(), SG_Calloc(), SG_DATATYPE_Bit, SG_DATATYPE_Byte, SG_DATATYPE_Char, SG_DATATYPE_Color, SG_DATATYPE_Date, SG_DATATYPE_Double, SG_DATATYPE_DWord, SG_DATATYPE_Float, SG_DATATYPE_Int, SG_DATATYPE_Long, SG_DATATYPE_Short, SG_DATATYPE_String, SG_DATATYPE_ULong, SG_DATATYPE_Word, SG_UI_Msg_Add_Error(), SG_UI_Process_Set_Progress(), and SG_UI_Process_Set_Ready().
Referenced by CSG_Table::_Save_DBase().
bool CSG_Table_DBase::Set_NoData | ( | int | iField | ) |
Definition at line 904 of file table_dbase.cpp.
Referenced by Open_Write().
bool CSG_Table_DBase::Set_Value | ( | int | iField, |
const CSG_String & | Value | ||
) |
Definition at line 834 of file table_dbase.cpp.
References CSG_String::b_str(), DBF_FT_CHARACTER, DBF_FT_DATE, CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), CSG_String::Length(), M_GET_MIN, SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF8, CSG_String::to_ASCII(), and CSG_String::to_UTF8().
bool CSG_Table_DBase::Set_Value | ( | int | iField, |
double | Value | ||
) |
Definition at line 771 of file table_dbase.cpp.
References DBF_FT_DATE, DBF_FT_FLOAT, DBF_FT_NUMERIC, CSG_String::Format(), CSG_DateTime::Get_Day(), CSG_DateTime::Get_Month(), CSG_DateTime::Get_Year(), and M_GET_MIN.
Referenced by Open_Write().