SAGA API  v9.5
CSG_Buffer Class Reference

#include <api_core.h>

Public Member Functions

 CSG_Buffer (void)
 
bool Create (void)
 
 CSG_Buffer (const CSG_Buffer &Buffer)
 
bool Create (const CSG_Buffer &Buffer)
 
 CSG_Buffer (size_t Size)
 
bool Create (size_t Size)
 
virtual ~CSG_Buffer (void)
 
void Destroy (void)
 
bool Set_Size (size_t Size, bool bShrink=true)
 
bool Inc_Size (size_t Size)
 
size_t Get_Size (void) const
 
bool Set_Data (const char *Data, size_t Size, bool bShrink=true)
 
char * Get_Data (int Offset=0) const
 
CSG_Bufferoperator= (const CSG_Buffer &Buffer)
 
char & operator[] (int Position)
 
char operator[] (int Position) const
 
void Add_Value (char Value, bool bBigEndian=false)
 
void Add_Value (short Value, bool bBigEndian=false)
 
void Add_Value (int Value, bool bBigEndian=false)
 
void Add_Value (float Value, bool bBigEndian=false)
 
void Add_Value (double Value, bool bBigEndian=false)
 
CSG_Bufferoperator+= (char Value)
 
CSG_Bufferoperator+= (short Value)
 
CSG_Bufferoperator+= (int Value)
 
CSG_Bufferoperator+= (float Value)
 
CSG_Bufferoperator+= (double Value)
 
void Set_Value (int Offset, char Value, bool bBigEndian=false)
 
void Set_Value (int Offset, short Value, bool bBigEndian=false)
 
void Set_Value (int Offset, int Value, bool bBigEndian=false)
 
void Set_Value (int Offset, float Value, bool bBigEndian=false)
 
void Set_Value (int Offset, double Value, bool bBigEndian=false)
 
short asShort (int Offset, bool bBigEndian=false) const
 
int asInt (int Offset, bool bBigEndian=false) const
 
float asFloat (int Offset, bool bBigEndian=false) const
 
double asDouble (int Offset, bool bBigEndian=false) const
 

Detailed Description

Definition at line 223 of file api_core.h.

Constructor & Destructor Documentation

◆ CSG_Buffer() [1/3]

CSG_Buffer::CSG_Buffer ( void  )

Definition at line 673 of file api_memory.cpp.

◆ CSG_Buffer() [2/3]

CSG_Buffer::CSG_Buffer ( const CSG_Buffer Buffer)

Definition at line 687 of file api_memory.cpp.

References Create().

◆ CSG_Buffer() [3/3]

CSG_Buffer::CSG_Buffer ( size_t  Size)

Definition at line 701 of file api_memory.cpp.

References Create().

◆ ~CSG_Buffer()

CSG_Buffer::~CSG_Buffer ( void  )
virtual

Definition at line 715 of file api_memory.cpp.

References Destroy().

Member Function Documentation

◆ Add_Value() [1/5]

void CSG_Buffer::Add_Value ( char  Value,
bool  bBigEndian = false 
)
inline

Definition at line 250 of file api_core.h.

◆ Add_Value() [2/5]

void CSG_Buffer::Add_Value ( double  Value,
bool  bBigEndian = false 
)
inline

Definition at line 254 of file api_core.h.

◆ Add_Value() [3/5]

void CSG_Buffer::Add_Value ( float  Value,
bool  bBigEndian = false 
)
inline

Definition at line 253 of file api_core.h.

◆ Add_Value() [4/5]

void CSG_Buffer::Add_Value ( int  Value,
bool  bBigEndian = false 
)
inline

Definition at line 252 of file api_core.h.

◆ Add_Value() [5/5]

void CSG_Buffer::Add_Value ( short  Value,
bool  bBigEndian = false 
)
inline

Definition at line 251 of file api_core.h.

◆ asDouble()

double CSG_Buffer::asDouble ( int  Offset,
bool  bBigEndian = false 
) const
inline

Definition at line 271 of file api_core.h.

References SG_Swap_Bytes().

◆ asFloat()

float CSG_Buffer::asFloat ( int  Offset,
bool  bBigEndian = false 
) const
inline

Definition at line 270 of file api_core.h.

References SG_Swap_Bytes().

◆ asInt()

int CSG_Buffer::asInt ( int  Offset,
bool  bBigEndian = false 
) const
inline

Definition at line 269 of file api_core.h.

References SG_Swap_Bytes().

◆ asShort()

short CSG_Buffer::asShort ( int  Offset,
bool  bBigEndian = false 
) const
inline

Definition at line 268 of file api_core.h.

References SG_Swap_Bytes().

◆ Create() [1/3]

bool CSG_Buffer::Create ( const CSG_Buffer Buffer)

Definition at line 695 of file api_memory.cpp.

References Set_Data().

◆ Create() [2/3]

bool CSG_Buffer::Create ( size_t  Size)

Definition at line 709 of file api_memory.cpp.

References Set_Size().

◆ Create() [3/3]

bool CSG_Buffer::Create ( void  )

Definition at line 679 of file api_memory.cpp.

References Destroy().

Referenced by CSG_Buffer().

◆ Destroy()

void CSG_Buffer::Destroy ( void  )

Definition at line 720 of file api_memory.cpp.

References SG_Free().

Referenced by Create(), Set_Size(), and ~CSG_Buffer().

◆ Get_Data()

char* CSG_Buffer::Get_Data ( int  Offset = 0) const
inline

◆ Get_Size()

size_t CSG_Buffer::Get_Size ( void  ) const
inline

◆ Inc_Size()

bool CSG_Buffer::Inc_Size ( size_t  Size)
inline

Definition at line 240 of file api_core.h.

◆ operator+=() [1/5]

CSG_Buffer& CSG_Buffer::operator+= ( char  Value)
inline

Definition at line 256 of file api_core.h.

◆ operator+=() [2/5]

CSG_Buffer& CSG_Buffer::operator+= ( double  Value)
inline

Definition at line 260 of file api_core.h.

◆ operator+=() [3/5]

CSG_Buffer& CSG_Buffer::operator+= ( float  Value)
inline

Definition at line 259 of file api_core.h.

◆ operator+=() [4/5]

CSG_Buffer& CSG_Buffer::operator+= ( int  Value)
inline

Definition at line 258 of file api_core.h.

◆ operator+=() [5/5]

CSG_Buffer& CSG_Buffer::operator+= ( short  Value)
inline

Definition at line 257 of file api_core.h.

◆ operator=()

CSG_Buffer& CSG_Buffer::operator= ( const CSG_Buffer Buffer)
inline

Definition at line 246 of file api_core.h.

◆ operator[]() [1/2]

char& CSG_Buffer::operator[] ( int  Position)
inline

Definition at line 247 of file api_core.h.

◆ operator[]() [2/2]

char CSG_Buffer::operator[] ( int  Position) const
inline

Definition at line 248 of file api_core.h.

◆ Set_Data()

bool CSG_Buffer::Set_Data ( const char *  Data,
size_t  Size,
bool  bShrink = true 
)

Definition at line 755 of file api_memory.cpp.

References Set_Size().

Referenced by Create(), CSG_String::to_ASCII(), CSG_String::to_MBChar(), and CSG_String::to_UTF8().

◆ Set_Size()

bool CSG_Buffer::Set_Size ( size_t  Size,
bool  bShrink = true 
)

Definition at line 732 of file api_memory.cpp.

References Destroy(), and SG_Realloc().

Referenced by Create(), and Set_Data().

◆ Set_Value() [1/5]

void CSG_Buffer::Set_Value ( int  Offset,
char  Value,
bool  bBigEndian = false 
)
inline

Definition at line 262 of file api_core.h.

◆ Set_Value() [2/5]

void CSG_Buffer::Set_Value ( int  Offset,
double  Value,
bool  bBigEndian = false 
)
inline

Definition at line 266 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [3/5]

void CSG_Buffer::Set_Value ( int  Offset,
float  Value,
bool  bBigEndian = false 
)
inline

Definition at line 265 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [4/5]

void CSG_Buffer::Set_Value ( int  Offset,
int  Value,
bool  bBigEndian = false 
)
inline

Definition at line 264 of file api_core.h.

References SG_Swap_Bytes().

◆ Set_Value() [5/5]

void CSG_Buffer::Set_Value ( int  Offset,
short  Value,
bool  bBigEndian = false 
)
inline

Definition at line 263 of file api_core.h.

References SG_Swap_Bytes().


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