TDWDate Struct Reference

Structure for date type, adapted from SQL_DATE_STRUCT in sqltypes.h. More...

List of all members.

Public Member Functions

simba_uint64 Hash (const simba_byte *in_buffer, simba_uint32 in_seed) const
 Get the hash code for the given data.
bool IsValid () const
 Determine if the currently stored date value is valid.
bool operator!= (const TDWDate &in_date) const
 Overloaded != operator.
TDWDate operator+ (simba_int64 in_days) const
 Overloaded + operator.
TDWDateoperator- ()
 Overloaded - (negate) operator.
TDWDate operator- (simba_int64 in_days) const
 Overloaded - operator.
simba_double64 operator- (const TDWDate &in_date) const
 Overloaded - (subtract) operator.
bool operator< (const TDWDate &in_date) const
 Overloaded < operator.
bool operator<= (const TDWDate &in_date) const
 Overloaded <= operator.
bool operator== (const TDWDate &in_date) const
 Overloaded == operator.
bool operator> (const TDWDate &in_date) const
 Overloaded > operator.
bool operator>= (const TDWDate &in_date) const
 Overloaded >= operator.
void Set (const simba_wstring &in_value, bool in_throwOnError)
 Sets the date with the given string value.
void Set (const simba_string &in_value, bool in_throwOnError)
 Sets the date with the given string value.
void Set (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError)
 Sets the date with the given string value.
void Set (const simba_char *in_value, bool in_throwOnError)
 Sets the date with the given string value.
 TDWDate (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWDate (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWDate (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWDate (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWDate (simba_int16 in_year, simba_uint16 in_month, simba_uint16 in_day)
 Constructor.
 TDWDate ()
 Constructor.
simba_string ToString () const
 Return a string representation of the TDWDate.
void UncheckedSet (const simba_char *in_value, simba_size_t in_length)
 Sets the date with the given string value.

Static Public Member Functions

static simba_uint16 GetNumberDays (simba_int16 in_year, simba_uint16 in_month)
 Get the number of days in the specified year and month.
static bool Validate (simba_int16 in_year, simba_uint16 in_month, simba_uint16 in_day)
 Determine if the specified date is valid.

Public Attributes

simba_uint16 Day
 The day of the date, starting at 1.
simba_uint16 Month
 The month of the date. [1, 12].
simba_int16 Year
 The year of the date. [-9999, 9999].

Detailed Description

Structure for date type, adapted from SQL_DATE_STRUCT in sqltypes.h.

This structure is used for SQL_TYPE_DATE and SQL_C_TYPE_DATE.


Constructor & Destructor Documentation

TDWDate (  )  [inline]

Constructor.

TDWDate ( simba_int16  in_year,
simba_uint16  in_month,
simba_uint16  in_day 
)

Constructor.

Parameters:
in_year The year of the date.
in_month The month of the date, starting from 1.
in_day The day of the date, starting from 1.
TDWDate ( const simba_char in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The date as a NULL-terminated string in the format YYYY-MM-DD. (NOT OWN)
in_throwOnError True to throw an exception on error; false otherwise.
TDWDate ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The date as a string in the format YYYY-MM-DD. (NOT OWN)
in_length The length of the string in characters.
in_throwOnError True to throw an exception on error; false otherwise.
TDWDate ( const simba_string in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The date as a string in the format YYYY-MM-DD.
in_throwOnError True to throw an exception on error; false otherwise.
TDWDate ( const simba_wstring in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The date as a string in the format YYYY-MM-DD.
in_throwOnError True to throw an exception on error; false otherwise.

Member Function Documentation

static simba_uint16 GetNumberDays ( simba_int16  in_year,
simba_uint16  in_month 
) [static]

Get the number of days in the specified year and month.

Parameters:
in_year The year to get the days for.
in_month The month to get the days for.
Returns:
The number of days in the specified year and month.
simba_uint64 Hash ( const simba_byte in_buffer,
simba_uint32  in_seed 
) const

Get the hash code for the given data.

Parameters:
in_buffer The data buffer. (NOT OWN)
in_seed The seed to use
Returns:
A hash code for the given data.
bool IsValid (  )  const

Determine if the currently stored date value is valid.

Returns:
True if valid; false otherwise.
bool operator!= ( const TDWDate in_date  )  const

Overloaded != operator.

TDWDate operator+ ( simba_int64  in_days  )  const

Overloaded + operator.

Parameters:
in_days The number of days to add to this date.
Returns:
The new date adjusted by in_days.
TDWDate& operator- (  ) 

Overloaded - (negate) operator.

TDWDate operator- ( simba_int64  in_days  )  const

Overloaded - operator.

Parameters:
in_days The number of days to subtract from this date.
Returns:
The new date adjusted by in_days.
simba_double64 operator- ( const TDWDate in_date  )  const

Overloaded - (subtract) operator.

bool operator< ( const TDWDate in_date  )  const

Overloaded < operator.

bool operator<= ( const TDWDate in_date  )  const

Overloaded <= operator.

bool operator== ( const TDWDate in_date  )  const

Overloaded == operator.

bool operator> ( const TDWDate in_date  )  const

Overloaded > operator.

bool operator>= ( const TDWDate in_date  )  const

Overloaded >= operator.

void Set ( const simba_wstring in_value,
bool  in_throwOnError 
)

Sets the date with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD.
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_string in_value,
bool  in_throwOnError 
)

Sets the date with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD.
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_char in_value,
simba_size_t  in_length,
bool  in_throwOnError 
)

Sets the date with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD. (NOT OWN)
in_length The length of the string in characters.
in_throwOnError True to throw an exception on error; false otherwise.
void Set ( const simba_char in_value,
bool  in_throwOnError 
)

Sets the date with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD. (NOT OWN)
in_throwOnError True to throw an exception on error; false otherwise.
simba_string ToString (  )  const

Return a string representation of the TDWDate.

The format is [-]YYYY-MM-DD.

Returns:
The string representation of the TDWDate.
void UncheckedSet ( const simba_char in_value,
simba_size_t  in_length 
) [inline]

Sets the date with the given string value.

This method does not validate the input string.

Parameters:
in_value The string value in the format of YYYY-MM-DD. (NOT OWN)
in_length The length of the string in characters.
static bool Validate ( simba_int16  in_year,
simba_uint16  in_month,
simba_uint16  in_day 
) [static]

Determine if the specified date is valid.

Parameters:
in_year The year of the specified date.
in_month The month of the specified date.
in_day The day of the specified date.
Returns:
True if valid; false otherwise.

Member Data Documentation

The day of the date, starting at 1.

The month of the date. [1, 12].

The year of the date. [-9999, 9999].


The documentation for this struct was generated from the following file:

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba