SAGA API  v9.7
CSG_Archive Class Reference

#include <api_core.h>

Inheritance diagram for CSG_Archive:
CSG_File

Public Member Functions

 CSG_Archive (void)
 
virtual ~CSG_Archive (void)
 
 CSG_Archive (const SG_Char *FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
 
virtual bool Open (const SG_Char *FileName, int Mode=SG_FILE_R, int Encoding=SG_FILE_ENCODING_ANSI)
 
virtual bool Open (const SG_Char *FileName, int Mode, bool bBinary, int Encoding)
 
virtual bool Close (void)
 
virtual const CSG_StringGet_Archive (void) const
 
virtual TSG_File_Type Get_File_Type (void) const
 
bool is_Zip (void) const
 
bool is_Tar (void) const
 
bool Add_Directory (const SG_Char *Name)
 
bool Add_File (const SG_Char *Name, bool bBinary=true)
 
size_t Get_File_Count (void)
 
bool Get_File (const SG_Char *Name)
 
bool Get_File (size_t Index)
 
virtual CSG_String Get_File_Name (size_t Index)
 
bool is_Directory (size_t Index)
 
bool Extract_All (const SG_Char *toDirectory=NULL)
 
bool Extract (const SG_Char *File, const SG_Char *toFile=NULL)
 
- Public Member Functions inherited from CSG_File
 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 const CSG_StringGet_File_Name (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 Attributes

TSG_File_Type m_Type = SG_FILE_TYPE_NORMAL
 
CSG_String m_Archive
 
CSG_Array_Pointer m_Files
 
- Protected Attributes inherited from CSG_File
int m_Mode
 
int m_Encoding
 
CSG_String m_FileName
 
void * m_pStream
 
void * m_pConvert
 

Additional Inherited Members

- Protected Member Functions inherited from CSG_File
void On_Construction (void)
 

Detailed Description

Definition at line 1199 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Archive() [1/2]

CSG_Archive::CSG_Archive ( void  )

Definition at line 575 of file api_file.cpp.

References CSG_File::On_Construction().

◆ ~CSG_Archive()

CSG_Archive::~CSG_Archive ( void  )
virtual

Definition at line 589 of file api_file.cpp.

References Close().

◆ CSG_Archive() [2/2]

CSG_Archive::CSG_Archive ( const SG_Char FileName,
int  Mode = SG_FILE_R,
int  Encoding = SG_FILE_ENCODING_ANSI 
)

Definition at line 581 of file api_file.cpp.

References CSG_File::On_Construction(), and Open().

Member Function Documentation

◆ Add_Directory()

bool CSG_Archive::Add_Directory ( const SG_Char Name)

Definition at line 694 of file api_file.cpp.

References CSG_File::is_Writing(), and CSG_File::m_pStream.

◆ Add_File()

bool CSG_Archive::Add_File ( const SG_Char Name,
bool  bBinary = true 
)

◆ Close()

bool CSG_Archive::Close ( void  )
virtual

◆ Extract()

◆ Extract_All()

◆ Get_Archive()

virtual const CSG_String& CSG_Archive::Get_Archive ( void  ) const
inlinevirtual

Definition at line 1212 of file api_core.h.

◆ Get_File() [1/2]

bool CSG_Archive::Get_File ( const SG_Char Name)

◆ Get_File() [2/2]

bool CSG_Archive::Get_File ( size_t  Index)

◆ Get_File_Count()

size_t CSG_Archive::Get_File_Count ( void  )
inline

Definition at line 1220 of file api_core.h.

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

◆ Get_File_Name()

CSG_String CSG_Archive::Get_File_Name ( size_t  Index)
virtual

Definition at line 777 of file api_file.cpp.

References CSG_File::is_Reading(), and m_Files.

Referenced by CSG_Grid_File_Info::Create().

◆ Get_File_Type()

virtual TSG_File_Type CSG_Archive::Get_File_Type ( void  ) const
inlinevirtual

Reimplemented from CSG_File.

Definition at line 1213 of file api_core.h.

◆ is_Directory()

bool CSG_Archive::is_Directory ( size_t  Index)

Definition at line 733 of file api_file.cpp.

References CSG_File::is_Reading(), and m_Files.

Referenced by Extract_All().

◆ is_Tar()

bool CSG_Archive::is_Tar ( void  ) const
inline

Definition at line 1215 of file api_core.h.

References SG_FILE_TYPE_TAR.

◆ is_Zip()

bool CSG_Archive::is_Zip ( void  ) const
inline

Definition at line 1214 of file api_core.h.

References SG_FILE_TYPE_ZIP.

Referenced by Add_File(), Close(), and Open().

◆ Open() [1/2]

virtual bool CSG_Archive::Open ( const SG_Char FileName,
int  Mode,
bool  bBinary,
int  Encoding 
)
inlinevirtual

Reimplemented from CSG_File.

Definition at line 1208 of file api_core.h.

References Open().

Referenced by Open().

◆ Open() [2/2]

Member Data Documentation

◆ m_Archive

CSG_String CSG_Archive::m_Archive
protected

Definition at line 1234 of file api_core.h.

Referenced by Close(), Extract(), Extract_All(), and Open().

◆ m_Files

CSG_Array_Pointer CSG_Archive::m_Files
protected

Definition at line 1236 of file api_core.h.

Referenced by Close(), Get_File(), Get_File_Name(), is_Directory(), and Open().

◆ m_Type

TSG_File_Type CSG_Archive::m_Type = SG_FILE_TYPE_NORMAL
protected

Definition at line 1232 of file api_core.h.

Referenced by Open().


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