SAGA API
v9.6
|
#include <api_core.h>
Public Member Functions | |
CSG_File (void) | |
virtual | ~CSG_File (void) |
CSG_File (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) | |
virtual bool | Open (const CSG_String &FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI) |
virtual bool | Close (void) |
virtual const CSG_String & | Get_File_Name (void) const |
virtual TSG_File_Type | Get_File_Type (void) const |
class wxStreamBase * | Get_Stream (void) const |
bool | Set_Encoding (int Encoding) |
int | Get_Encoding (void) const |
bool | is_Open (void) const |
bool | is_Reading (void) const |
bool | is_Writing (void) const |
bool | is_EOF (void) const |
sLong | Length (void) const |
bool | Seek (sLong Offset, int Origin=SG_FILE_START) const |
bool | Seek_Start (void) const |
bool | Seek_End (void) const |
sLong | Tell (void) const |
int | Printf (const char *Format,...) |
int | Printf (const wchar_t *Format,...) |
size_t | Read (void *Buffer, size_t Size, size_t Count=1) const |
size_t | Write (void *Buffer, size_t Size, size_t Count=1) const |
size_t | Read (CSG_String &Buffer, size_t Size) const |
size_t | Write (const CSG_String &Buffer) const |
bool | Read_Line (CSG_String &sLine) const |
int | Read_Char (void) const |
int | Read_Int (bool bBigEndian=false) const |
bool | Write_Int (int Value, bool bBigEndian=false) |
double | Read_Double (bool bBigEndian=false) const |
bool | Write_Double (double Value, bool bBigEndian=false) |
bool | Scan (int &Value) const |
bool | Scan (double &Value) const |
bool | Scan (CSG_String &Value, SG_Char Separator) const |
int | Scan_Int (void) const |
double | Scan_Double (void) const |
CSG_String | Scan_String (SG_Char Separator) const |
Protected Member Functions | |
void | On_Construction (void) |
Protected Attributes | |
int | m_Mode |
int | m_Encoding |
CSG_String | m_FileName |
void * | m_pStream |
void * | m_pConvert |
Definition at line 1123 of file api_core.h.
CSG_File::CSG_File | ( | void | ) |
Definition at line 86 of file api_file.cpp.
References On_Construction().
|
virtual |
Definition at line 100 of file api_file.cpp.
References Close().
CSG_File::CSG_File | ( | const CSG_String & | FileName, |
int | Mode = SG_FILE_R , |
||
bool | bBinary = true , |
||
int | Encoding = SG_FILE_ENCODING_ANSI |
||
) |
Definition at line 92 of file api_file.cpp.
References On_Construction(), and Open().
|
virtual |
Reimplemented in CSG_File_Zip.
Definition at line 160 of file api_file.cpp.
References m_pStream, m_pStream_Base, Set_Encoding(), and SG_FILE_ENCODING_UNDEFINED.
Referenced by CSG_File_Zip::Close(), Open(), and ~CSG_File().
|
inline |
Definition at line 1141 of file api_core.h.
|
inlinevirtual |
Definition at line 1135 of file api_core.h.
Referenced by CSG_Grid_File_Info::Create(), and CSG_File_Zip::Get_File().
|
inlinevirtual |
Reimplemented in CSG_File_Zip.
Definition at line 1136 of file api_core.h.
References SG_FILE_TYPE_NORMAL.
|
inline |
Definition at line 1138 of file api_core.h.
Referenced by CSG_MetaData::Load(), and CSG_MetaData::Save().
bool CSG_File::is_EOF | ( | void | ) | const |
Definition at line 232 of file api_file.cpp.
References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.
Referenced by CSG_Grid_File_Info::Create(), Read_Line(), and Scan().
|
inline |
Definition at line 1143 of file api_core.h.
Referenced by CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().
|
inline |
Definition at line 1144 of file api_core.h.
References SG_FILE_W.
Referenced by CSG_Grid_File_Info::Create(), CSG_File_Zip::Get_File(), CSG_File_Zip::Get_File_Name(), CSG_File_Zip::is_Directory(), is_EOF(), CSG_Projection::Load(), CSG_MetaData::Load(), CSG_File_Zip::Open(), Read(), Read_Char(), Read_Line(), and Scan().
|
inline |
Definition at line 1145 of file api_core.h.
References SG_FILE_R.
Referenced by CSG_File_Zip::Add_Directory(), CSG_File_Zip::Add_File(), Printf(), CSG_Grid_File_Info::Save(), CSG_MetaData::Save(), CSG_Projection::Save(), CSG_Grid_File_Info::Save_AUX_XML(), and Write().
sLong CSG_File::Length | ( | void | ) | const |
Definition at line 226 of file api_file.cpp.
References m_pStream, and m_pStream_Base.
Referenced by CSG_Colors::Load(), CSG_Projection::Load(), and CSG_MetaData::Load_JSON().
|
protected |
Definition at line 180 of file api_file.cpp.
References m_Encoding, m_pConvert, m_pStream, and SG_FILE_ENCODING_UNDEFINED.
Referenced by CSG_File(), and CSG_File_Zip::CSG_File_Zip().
|
virtual |
Definition at line 111 of file api_file.cpp.
References CSG_String::c_str(), Close(), CSG_String::is_Empty(), m_FileName, m_Mode, m_pStream, m_pStream_Base, Set_Encoding(), SG_Dir_Exists(), SG_File_Exists(), SG_File_Get_Path(), SG_FILE_R, and SG_FILE_W.
Referenced by CSG_Table::_Save_Text(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_File(), CSG_Tool_Library::Get_Summary(), CSG_Colors::Load(), CSG_MetaData::Load_JSON(), CSG_Colors::Save(), and CSG_Grid_File_Info::Save_AUX_XML().
int CSG_File::Printf | ( | const char * | Format, |
... | |||
) |
Definition at line 277 of file api_file.cpp.
References is_Writing(), and Write().
Referenced by CSG_Table::_Save_Text(), CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Table::Serialize(), and CSG_Colors::Serialize().
int CSG_File::Printf | ( | const wchar_t * | Format, |
... | |||
) |
Definition at line 302 of file api_file.cpp.
References is_Writing(), and Write().
size_t CSG_File::Read | ( | CSG_String & | Buffer, |
size_t | Size | ||
) | const |
Definition at line 336 of file api_file.cpp.
References CSG_String::Clear(), CSG_Buffer::Get_Data(), is_Reading(), and Read().
size_t CSG_File::Read | ( | void * | Buffer, |
size_t | Size, | ||
size_t | Count = 1 |
||
) | const |
Definition at line 328 of file api_file.cpp.
References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.
Referenced by CSG_Colors::Load(), CSG_Projection::Load(), CSG_MetaData::Load_JSON(), Read(), Read_Double(), Read_Int(), CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().
int CSG_File::Read_Char | ( | void | ) | const |
Definition at line 423 of file api_file.cpp.
References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.
Referenced by Scan().
double CSG_File::Read_Double | ( | bool | bBigEndian = false | ) | const |
Definition at line 455 of file api_file.cpp.
References Read(), and SG_Swap_Bytes().
int CSG_File::Read_Int | ( | bool | bBigEndian = false | ) | const |
Definition at line 429 of file api_file.cpp.
References Read(), and SG_Swap_Bytes().
bool CSG_File::Read_Line | ( | CSG_String & | sLine | ) | const |
Definition at line 385 of file api_file.cpp.
References CSG_String::is_Empty(), is_EOF(), is_Reading(), m_Mode, m_pConvert, m_pStream_I, m_pStream_IO, and SG_FILE_R.
Referenced by CSG_Table::Serialize(), CSG_Colors::Serialize(), and CSG_Parameters::Serialize_Compatibility().
bool CSG_File::Scan | ( | CSG_String & | Value, |
SG_Char | Separator | ||
) | const |
Definition at line 525 of file api_file.cpp.
References CSG_String::Clear(), is_EOF(), is_Reading(), and Read_Char().
bool CSG_File::Scan | ( | double & | Value | ) | const |
Definition at line 503 of file api_file.cpp.
References CSG_String::asDouble(), is_EOF(), is_Reading(), and Read_Char().
bool CSG_File::Scan | ( | int & | Value | ) | const |
Definition at line 481 of file api_file.cpp.
References CSG_String::asInt(), is_EOF(), is_Reading(), and Read_Char().
Referenced by Scan_Double(), Scan_Int(), and Scan_String().
double CSG_File::Scan_Double | ( | void | ) | const |
Definition at line 548 of file api_file.cpp.
References Scan().
Referenced by CSG_Parameters::Serialize_Compatibility().
int CSG_File::Scan_Int | ( | void | ) | const |
Definition at line 543 of file api_file.cpp.
References Scan().
Referenced by CSG_Parameters::Serialize_Compatibility().
CSG_String CSG_File::Scan_String | ( | SG_Char | Separator | ) | const |
Definition at line 553 of file api_file.cpp.
References Scan().
bool CSG_File::Seek | ( | sLong | Offset, |
int | Origin = SG_FILE_START |
||
) | const |
Definition at line 238 of file api_file.cpp.
References m_Mode, m_pStream, m_pStream_I, m_pStream_IO, m_pStream_O, SG_FILE_CURRENT, SG_FILE_END, SG_FILE_R, and SG_FILE_W.
Referenced by Seek_End(), and Seek_Start().
bool CSG_File::Seek_End | ( | void | ) | const |
Definition at line 258 of file api_file.cpp.
References Seek().
Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().
bool CSG_File::Seek_Start | ( | void | ) | const |
bool CSG_File::Set_Encoding | ( | int | Encoding | ) |
Definition at line 188 of file api_file.cpp.
References m_Encoding, m_pConvert, SG_FILE_ENCODING_ANSI, SG_FILE_ENCODING_UTF16BE, SG_FILE_ENCODING_UTF16LE, SG_FILE_ENCODING_UTF32BE, SG_FILE_ENCODING_UTF32LE, SG_FILE_ENCODING_UTF7, and SG_FILE_ENCODING_UTF8.
Referenced by Close(), Open(), and CSG_File_Zip::Open().
sLong CSG_File::Tell | ( | void | ) | const |
Definition at line 261 of file api_file.cpp.
References m_Mode, m_pStream, m_pStream_I, m_pStream_IO, m_pStream_O, SG_FILE_R, and SG_FILE_W.
size_t CSG_File::Write | ( | const CSG_String & | Buffer | ) | const |
Definition at line 368 of file api_file.cpp.
References CSG_Buffer::Get_Data(), CSG_Buffer::Get_Size(), m_pConvert, CSG_String::to_ASCII(), CSG_String::w_str(), and Write().
size_t CSG_File::Write | ( | void * | Buffer, |
size_t | Size, | ||
size_t | Count = 1 |
||
) | const |
Definition at line 360 of file api_file.cpp.
References is_Writing(), m_Mode, m_pStream_IO, m_pStream_O, and SG_FILE_W.
Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox(), CSG_Tool_Library::Get_Summary(), Printf(), CSG_Colors::Save(), CSG_Projection::Save(), CSG_Grid_File_Info::Save_AUX_XML(), CSG_Colors::Serialize(), Write(), Write_Double(), and Write_Int().
bool CSG_File::Write_Double | ( | double | Value, |
bool | bBigEndian = false |
||
) |
Definition at line 470 of file api_file.cpp.
References SG_Swap_Bytes(), and Write().
bool CSG_File::Write_Int | ( | int | Value, |
bool | bBigEndian = false |
||
) |
Definition at line 444 of file api_file.cpp.
References SG_Swap_Bytes(), and Write().
|
protected |
Definition at line 1183 of file api_core.h.
Referenced by On_Construction(), and Set_Encoding().
|
protected |
Definition at line 1185 of file api_core.h.
Referenced by CSG_File_Zip::Add_File(), CSG_File_Zip::Get_File(), and Open().
|
protected |
Definition at line 1183 of file api_core.h.
Referenced by is_EOF(), Open(), CSG_File_Zip::Open(), Read(), Read_Char(), Read_Line(), Seek(), Tell(), and Write().
|
protected |
Definition at line 1187 of file api_core.h.
Referenced by On_Construction(), Read_Line(), Set_Encoding(), and Write().
|
protected |
Definition at line 1187 of file api_core.h.
Referenced by CSG_File_Zip::Add_Directory(), CSG_File_Zip::Add_File(), Close(), CSG_File_Zip::Get_File(), Length(), On_Construction(), Open(), CSG_File_Zip::Open(), Seek(), and Tell().