SAGA API v9.10
Loading...
Searching...
No Matches
CSG_File Class Reference

#include <api_core.h>

Inheritance diagram for CSG_File:
CSG_Archive

Public Member Functions

 CSG_File (void)
virtual ~CSG_File (void)
 CSG_File (const SG_Char *FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool Open (const SG_Char *FileName, int Mode=SG_FILE_R, bool bBinary=true, int Encoding=SG_FILE_ENCODING_ANSI)
virtual bool Close (void)
virtual const CSG_StringGet_File_Name (void) const
virtual CSG_String Get_File_Name (size_t Index)
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
bool Flush (void)
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 &Line) 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

Detailed Description

Definition at line 1128 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_File() [1/2]

CSG_File::CSG_File ( void )

Definition at line 88 of file api_file.cpp.

References On_Construction().

Referenced by CSG_Archive::Extract().

◆ ~CSG_File()

CSG_File::~CSG_File ( void )
virtual

Definition at line 102 of file api_file.cpp.

References Close().

◆ CSG_File() [2/2]

CSG_File::CSG_File ( const SG_Char * FileName,
int Mode = SG_FILE_R,
bool bBinary = true,
int Encoding = SG_FILE_ENCODING_ANSI )

Definition at line 94 of file api_file.cpp.

References On_Construction(), Open(), and SG_Char.

Member Function Documentation

◆ Close()

bool CSG_File::Close ( void )
virtual

Reimplemented in CSG_Archive.

Definition at line 164 of file api_file.cpp.

References m_pStream, m_pStream_Base, Set_Encoding(), and SG_FILE_ENCODING_UNDEFINED.

Referenced by CSG_Archive::Close(), Open(), and ~CSG_File().

◆ Flush()

bool CSG_File::Flush ( void )

Definition at line 281 of file api_file.cpp.

References m_pStream_O.

Referenced by CSG_Archive::Extract().

◆ Get_Encoding()

int CSG_File::Get_Encoding ( void ) const
inline

Definition at line 1147 of file api_core.h.

References m_Encoding.

◆ Get_File_Name() [1/2]

virtual CSG_String CSG_File::Get_File_Name ( size_t Index)
inlinevirtual

Reimplemented in CSG_Archive.

Definition at line 1141 of file api_core.h.

References m_FileName.

◆ Get_File_Name() [2/2]

virtual const CSG_String & CSG_File::Get_File_Name ( void ) const
inlinevirtual

Definition at line 1140 of file api_core.h.

References m_FileName.

Referenced by CSG_Grid_File_Info::Create(), CSG_Archive::Extract_All(), and CSG_Archive::Get_File().

◆ Get_File_Type()

virtual TSG_File_Type CSG_File::Get_File_Type ( void ) const
inlinevirtual

Reimplemented in CSG_Archive.

Definition at line 1142 of file api_core.h.

References SG_FILE_TYPE_NORMAL.

◆ Get_Stream()

class wxStreamBase * CSG_File::Get_Stream ( void ) const
inline

Definition at line 1144 of file api_core.h.

References m_pStream.

Referenced by CSG_MetaData::Load(), and CSG_MetaData::Save().

◆ is_EOF()

bool CSG_File::is_EOF ( void ) const

◆ is_Open()

bool CSG_File::is_Open ( void ) const
inline

◆ is_Reading()

◆ is_Writing()

◆ Length()

sLong CSG_File::Length ( void ) const

Definition at line 230 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().

◆ On_Construction()

void CSG_File::On_Construction ( void )
protected

◆ Open()

◆ Printf() [1/2]

int CSG_File::Printf ( const char * Format,
... )

◆ Printf() [2/2]

int CSG_File::Printf ( const wchar_t * Format,
... )

Definition at line 312 of file api_file.cpp.

References is_Writing(), and Write().

◆ Read() [1/2]

size_t CSG_File::Read ( CSG_String & Buffer,
size_t Size ) const

Definition at line 346 of file api_file.cpp.

References CSG_String::Clear(), CSG_Buffer::Get_Data(), is_Reading(), and Read().

◆ Read() [2/2]

size_t CSG_File::Read ( void * Buffer,
size_t Size,
size_t Count = 1 ) const

◆ Read_Char()

int CSG_File::Read_Char ( void ) const

Definition at line 437 of file api_file.cpp.

References is_Reading(), m_Mode, m_pStream_I, m_pStream_IO, and SG_FILE_R.

Referenced by Scan(), Scan(), and Scan().

◆ Read_Double()

double CSG_File::Read_Double ( bool bBigEndian = false) const

Definition at line 469 of file api_file.cpp.

References Read(), and SG_Swap_Bytes().

◆ Read_Int()

int CSG_File::Read_Int ( bool bBigEndian = false) const

Definition at line 443 of file api_file.cpp.

References Read(), and SG_Swap_Bytes().

◆ Read_Line()

◆ Scan() [1/3]

bool CSG_File::Scan ( CSG_String & Value,
SG_Char Separator ) const

Definition at line 539 of file api_file.cpp.

References CSG_String::Clear(), is_EOF(), is_Reading(), Read_Char(), and SG_Char.

◆ Scan() [2/3]

bool CSG_File::Scan ( double & Value) const

Definition at line 517 of file api_file.cpp.

References CSG_String::asDouble(), is_EOF(), is_Reading(), and Read_Char().

◆ Scan() [3/3]

bool CSG_File::Scan ( int & Value) const

Definition at line 495 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().

◆ Scan_Double()

double CSG_File::Scan_Double ( void ) const

Definition at line 562 of file api_file.cpp.

References Scan().

Referenced by CSG_Parameters::Serialize_Compatibility().

◆ Scan_Int()

int CSG_File::Scan_Int ( void ) const

Definition at line 557 of file api_file.cpp.

References Scan().

Referenced by CSG_Parameters::Serialize_Compatibility().

◆ Scan_String()

CSG_String CSG_File::Scan_String ( SG_Char Separator) const

Definition at line 567 of file api_file.cpp.

References Scan(), and SG_Char.

◆ Seek()

bool CSG_File::Seek ( sLong Offset,
int Origin = SG_FILE_START ) const

◆ Seek_End()

bool CSG_File::Seek_End ( void ) const

Definition at line 262 of file api_file.cpp.

References Seek().

Referenced by CSG_Tool_Library_Manager::Create_Python_ToolBox().

◆ Seek_Start()

bool CSG_File::Seek_Start ( void ) const

Definition at line 261 of file api_file.cpp.

References Seek().

Referenced by CSG_Colors::Load().

◆ Set_Encoding()

◆ Tell()

sLong CSG_File::Tell ( void ) const

Definition at line 265 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.

◆ Write() [1/2]

size_t CSG_File::Write ( const CSG_String & Buffer) const

◆ Write() [2/2]

◆ Write_Double()

bool CSG_File::Write_Double ( double Value,
bool bBigEndian = false )

Definition at line 484 of file api_file.cpp.

References SG_Swap_Bytes(), and Write().

◆ Write_Int()

bool CSG_File::Write_Int ( int Value,
bool bBigEndian = false )

Definition at line 458 of file api_file.cpp.

References SG_Swap_Bytes(), and Write().

Member Data Documentation

◆ m_Encoding

int CSG_File::m_Encoding
protected

Definition at line 1191 of file api_core.h.

Referenced by CSG_Archive::Extract(), Get_Encoding(), On_Construction(), and Set_Encoding().

◆ m_FileName

CSG_String CSG_File::m_FileName
protected

◆ m_Mode

int CSG_File::m_Mode
protected

◆ m_pConvert

void * CSG_File::m_pConvert
protected

Definition at line 1195 of file api_core.h.

Referenced by On_Construction(), Read_Line(), Set_Encoding(), and Write().

◆ m_pStream


The documentation for this class was generated from the following files: