53#ifndef HEADER_INCLUDED__SAGA_API__table_value_H
54#define HEADER_INCLUDED__SAGA_API__table_value_H
132 virtual operator double (
void)
const {
return(
asDouble() ); }
156 virtual sLong asLong (
void)
const {
return( m_Value.asLong () ); }
158 virtual double asDouble (
void)
const {
return( m_Value.asDouble() ); }
159 virtual const SG_Char *
asString (
int Decimals =-99)
const {
return( m_Value.c_str () ); }
164 virtual bool Set_Value (
const SG_Char *Value) {
if( Value && m_Value.Cmp(Value) ) { m_Value = Value;
return(
true ); }
return(
false ); }
192 virtual double asDouble (
void)
const {
return( m_JDN ); }
244 virtual sLong asLong (
void)
const {
return( m_Value.Get_Count() ); }
246 virtual double asDouble (
void)
const {
return( 0. ); }
250 virtual bool Set_Value (
const sLong &Value) {
return( m_Value.Create((BYTE *)&Value,
sizeof(Value)) ); }
251 virtual bool Set_Value (
const uLong &Value) {
return( m_Value.Create((BYTE *)&Value,
sizeof(Value)) ); }
252 virtual bool Set_Value (
const double &Value) {
return( m_Value.Create((BYTE *)&Value,
sizeof(Value)) ); }
259 virtual bool Set_NoData (
void) {
return( m_Value.Destroy() ); }
260 virtual bool is_NoData (
void)
const {
return( m_Value.Get_Count() <= 0 ); }
287 if( m_Value ) {
SG_Free(m_Value); }
308 default :
return( (
sLong)0 );
326 default :
return( (
uLong)0 );
344 default :
return( (
double)0. );
364 default : s.
Clear() ;
break;
374 case SG_DATATYPE_Byte :
if( *(BYTE *)m_Value != (BYTE )Value ) { *(BYTE *)m_Value = (BYTE )Value;
return(
true ); }
return(
false );
375 case SG_DATATYPE_Char :
if( *(
char *)m_Value != (
char )Value ) { *(
char *)m_Value = (
char )Value;
return(
true ); }
return(
false );
376 case SG_DATATYPE_Word :
if( *(WORD *)m_Value != (WORD )Value ) { *(WORD *)m_Value = (WORD )Value;
return(
true ); }
return(
false );
377 case SG_DATATYPE_Short :
if( *(
short *)m_Value != (
short )Value ) { *(
short *)m_Value = (
short )Value;
return(
true ); }
return(
false );
378 case SG_DATATYPE_DWord :
if( *(DWORD *)m_Value != (DWORD )Value ) { *(DWORD *)m_Value = (DWORD )Value;
return(
true ); }
return(
false );
379 case SG_DATATYPE_Int :
if( *(
int *)m_Value != (
int )Value ) { *(
int *)m_Value = (
int )Value;
return(
true ); }
return(
false );
382 case SG_DATATYPE_Float :
if( *(
float *)m_Value != (
float )Value ) { *(
float *)m_Value = (
float )Value;
return(
true ); }
return(
false );
383 case SG_DATATYPE_Double:
if( *(
double *)m_Value != (
double )Value ) { *(
double *)m_Value = (
double )Value;
return(
true ); }
return(
false );
384 default :
return(
false );
392 case SG_DATATYPE_Byte :
if( *(BYTE *)m_Value != (BYTE )Value ) { *(BYTE *)m_Value = (BYTE )Value;
return(
true ); }
return(
false );
393 case SG_DATATYPE_Char :
if( *(
char *)m_Value != (
char )Value ) { *(
char *)m_Value = (
char )Value;
return(
true ); }
return(
false );
394 case SG_DATATYPE_Word :
if( *(WORD *)m_Value != (WORD )Value ) { *(WORD *)m_Value = (WORD )Value;
return(
true ); }
return(
false );
395 case SG_DATATYPE_Short :
if( *(
short *)m_Value != (
short )Value ) { *(
short *)m_Value = (
short )Value;
return(
true ); }
return(
false );
396 case SG_DATATYPE_DWord :
if( *(DWORD *)m_Value != (DWORD )Value ) { *(DWORD *)m_Value = (DWORD )Value;
return(
true ); }
return(
false );
397 case SG_DATATYPE_Int :
if( *(
int *)m_Value != (
int )Value ) { *(
int *)m_Value = (
int )Value;
return(
true ); }
return(
false );
400 case SG_DATATYPE_Float :
if( *(
float *)m_Value != (
float )Value ) { *(
float *)m_Value = (
float )Value;
return(
true ); }
return(
false );
401 case SG_DATATYPE_Double:
if( *(
double *)m_Value != (
double )Value ) { *(
double *)m_Value = (
double )Value;
return(
true ); }
return(
false );
402 default :
return(
false );
410 case SG_DATATYPE_Byte :
if( *(BYTE *)m_Value != (BYTE )Value ) { *(BYTE *)m_Value = (BYTE )Value;
return(
true ); }
return(
false );
411 case SG_DATATYPE_Char :
if( *(
char *)m_Value != (
char )Value ) { *(
char *)m_Value = (
char )Value;
return(
true ); }
return(
false );
412 case SG_DATATYPE_Word :
if( *(WORD *)m_Value != (WORD )Value ) { *(WORD *)m_Value = (WORD )Value;
return(
true ); }
return(
false );
413 case SG_DATATYPE_Short :
if( *(
short *)m_Value != (
short )Value ) { *(
short *)m_Value = (
short )Value;
return(
true ); }
return(
false );
414 case SG_DATATYPE_DWord :
if( *(DWORD *)m_Value != (DWORD )Value ) { *(DWORD *)m_Value = (DWORD )Value;
return(
true ); }
return(
false );
415 case SG_DATATYPE_Int :
if( *(
int *)m_Value != (
int )Value ) { *(
int *)m_Value = (
int )Value;
return(
true ); }
return(
false );
418 case SG_DATATYPE_Float :
if( *(
float *)m_Value != (
float )Value ) { *(
float *)m_Value = (
float )Value;
return(
true ); }
return(
false );
419 case SG_DATATYPE_Double:
if( *(
double *)m_Value != (
double )Value ) { *(
double *)m_Value = (
double )Value;
return(
true ); }
return(
false );
420 default :
return(
false );
441 default :
return(
false );
462 default :
return(
false );
483 default :
return(
false );
492 void *m_Value = NULL;
SAGA_API_DLL_EXPORT void SG_Free(void *memblock)
SAGA_API_DLL_EXPORT void * SG_Calloc(size_t num, size_t size)
#define SG_STR_CMP(s1, s2)
size_t SG_Data_Type_Get_Size(TSG_Data_Type Type)
SAGA_API_DLL_EXPORT CSG_String SG_Get_String(double Value, int Precision=-99)
BYTE * Get_Bytes(void) const
static CSG_String Format(const char *Format,...)
const SG_Char * c_str(void) const
int Printf(const char *Format,...)
virtual bool Set_Value(const CSG_Bytes &Value)
virtual uLong asULong(void) const
virtual ~CSG_Table_Value_Binary(void)
virtual CSG_Bytes asBinary(void) const
virtual bool Set_NoData(void)
virtual bool is_NoData(void) const
virtual bool Set_Value(const CSG_Table_Value &Value)
CSG_Bytes & Get_Binary(void)
virtual double asDouble(void) const
virtual bool is_Equal(const CSG_Table_Value &Value) const
CSG_Table_Value_Binary(void)
virtual bool Set_Value(const double &Value)
virtual bool Set_Value(const SG_Char *Value)
virtual const TSG_Table_Value_Type Get_Type(void) const
virtual const SG_Char * asString(int Decimals=-99) const
virtual sLong asLong(void) const
virtual bool Set_Value(const uLong &Value)
virtual bool Set_Value(const sLong &Value)
CSG_Table_Value_Date(void)
virtual const SG_Char * asString(int Decimals=-99) const
virtual uLong asULong(void) const
virtual ~CSG_Table_Value_Date(void)
virtual bool is_Equal(const CSG_Table_Value &Value) const
virtual double asDouble(void) const
virtual bool Set_Value(const sLong &Value)
virtual bool Set_Value(const uLong &Value)
virtual bool Set_Value(const SG_Char *Value)
virtual bool Set_Value(const CSG_Table_Value &Value)
virtual bool Set_Value(const double &Value)
virtual const TSG_Table_Value_Type Get_Type(void) const
virtual sLong asLong(void) const
virtual bool Set_Value(const double &Value)
virtual sLong asLong(void) const
virtual const SG_Char * asString(int Decimals=-99) const
virtual bool Set_Value(const sLong &Value)
virtual bool is_Equal(const CSG_Table_Value &Value) const
virtual ~CSG_Table_Value_Number(void)
virtual uLong asULong(void) const
virtual const TSG_Table_Value_Type Get_Type(void) const
virtual bool Set_Value(const CSG_Table_Value &Value)
virtual bool Set_Value(const uLong &Value)
virtual double asDouble(void) const
virtual bool Set_Value(const SG_Char *Value)
CSG_Table_Value_Number(TSG_Data_Type Type)
virtual const TSG_Data_Type & Get_Data_Type(void) const
virtual ~CSG_Table_Value_String(void)
virtual sLong asLong(void) const
virtual bool Set_Value(const sLong &Value)
virtual const SG_Char * asString(int Decimals=-99) const
CSG_Table_Value_String(void)
virtual bool Set_Value(const SG_Char *Value)
virtual double asDouble(void) const
virtual bool Set_Value(const double &Value)
virtual bool Set_Value(const CSG_Table_Value &Value)
virtual uLong asULong(void) const
virtual bool is_Equal(const CSG_Table_Value &Value) const
virtual bool Set_Value(const uLong &Value)
virtual const TSG_Table_Value_Type Get_Type(void) const
virtual ~CSG_Table_Value(void)
virtual const SG_Char * asString(int Decimals=-99) const =0
virtual const TSG_Table_Value_Type Get_Type(void) const =0
virtual bool Set_Value(const CSG_Table_Value &Value)=0
virtual CSG_Bytes asBinary(void) const
virtual bool Set_Value(const CSG_Bytes &Value)
virtual bool is_Equal(const CSG_Table_Value &Value) const =0
virtual uLong asULong(void) const =0
virtual bool operator==(const CSG_Table_Value &Value) const
virtual bool Set_Value(const SG_Char *Value)=0
virtual bool Set_Value(const sLong &Value)=0
CSG_Table_Value & operator=(double Value)
virtual double asDouble(void) const =0
virtual sLong asLong(void) const =0
virtual bool Set_Value(const double &Value)=0
virtual bool Set_Value(const uLong &Value)=0
bool SG_JulianDayNumber_To_Date(double JDN, int &y, int &m, int &d)
double SG_Date_To_JulianDayNumber(int Year, int Month, int Day)
@ SG_TABLE_VALUE_TYPE_String
@ SG_TABLE_VALUE_TYPE_Date
@ SG_TABLE_VALUE_TYPE_Number
@ SG_TABLE_VALUE_TYPE_Binary