TDWTimestamp Struct Reference

Structure for timestamp type, adapted from SQL_TIMESTAMP_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 timestamp value is valid.
bool operator!= (const TDWTimestamp &in_timestamp) const
 Overloaded != operator.
TDWTimestamp operator+ (simba_int64 in_days) const
 Overloaded + operator.
TDWTimestampoperator- ()
 Overloaded - (negate) operator.
TDWTimestamp operator- (simba_int64 in_days) const
 Overloaded - operator.
simba_double64 operator- (const TDWTimestamp &in_timestamp) const
 Overloaded - (subtract) operator.
bool operator< (const TDWTimestamp &in_timestamp) const
 Overloaded < operator.
bool operator<= (const TDWTimestamp &in_timestamp) const
 Overloaded <= operator.
bool operator== (const TDWTimestamp &in_timestamp) const
 Overloaded == operator.
bool operator> (const TDWTimestamp &in_timestamp) const
 Overloaded > operator.
bool operator>= (const TDWTimestamp &in_timestamp) const
 Overloaded >= operator.
void Set (const simba_wstring &in_value, bool in_throwOnError)
 Sets the timestamp with the given string value.
void Set (const simba_string &in_value, bool in_throwOnError)
 Sets the timestamp with the given string value.
void Set (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError)
 Sets the timestamp with the given string value.
void Set (const simba_char *in_value, bool in_throwOnError)
 Sets the timestamp with the given string value.
 TDWTimestamp (const simba_wstring &in_value, bool in_throwOnError=true)
 Constructor.
 TDWTimestamp (const simba_string &in_value, bool in_throwOnError=true)
 Constructor.
 TDWTimestamp (const simba_char *in_value, simba_size_t in_length, bool in_throwOnError=true)
 Constructor.
 TDWTimestamp (const simba_char *in_value, bool in_throwOnError=true)
 Constructor.
 TDWTimestamp (simba_int16 in_year, simba_uint16 in_month, simba_uint16 in_day, simba_uint16 in_hour, simba_uint16 in_minute, simba_uint16 in_second, simba_uint32 in_fraction)
 Constructor.
 TDWTimestamp ()
 Constructor.
simba_charToCharArray (simba_uint16 in_precision=TDW_TS_MAX_FRACTION_PRECISION, bool in_keepZeroFraction=false) const
 Return a string representation of the TDWTimestamp.
void ToCharArray (simba_char *in_buffer, simba_uint16 in_precision=TDW_TS_MAX_FRACTION_PRECISION, bool in_keepZeroFraction=false) const
 Return a string representation of the TDWTimestamp.
simba_string ToString (simba_uint16 in_precision=TDW_TS_MAX_FRACTION_PRECISION, bool in_keepZeroFraction=false) const
 Return a string representation of the TDWTimestamp.
void UncheckedSet (const simba_char *in_value, simba_size_t in_length)
 Sets the timestamp with the given string value without validating it.

Static Public Member Functions

static bool Validate (const TDWTimestamp &in_timestamp)
 Determine if the specified timestamp value is valid.

Public Attributes

simba_uint16 Day
 The day of the timestamp, starting at 1.
simba_uint32 Fraction
 The fractions of seconds of the timestamp. [0-999999999].
simba_uint16 Hour
 The hour of the timestamp. [0-23].
simba_uint16 Minute
 The minutes of the timestamp. [0-59].
simba_uint16 Month
 The month of the timestamp. [1, 12].
simba_uint16 Second
 The seconds of the timestamp. [0-61].
simba_int16 Year
 The year of the timestamp. [-9999, 9999].

Detailed Description

Structure for timestamp type, adapted from SQL_TIMESTAMP_STRUCT in sqltypes.h.

This structure is used for SQL_Type_Timestamp and SQL_C_Type_Timestamp.


Constructor & Destructor Documentation

TDWTimestamp (  )  [inline]

Constructor.

TDWTimestamp ( simba_int16  in_year,
simba_uint16  in_month,
simba_uint16  in_day,
simba_uint16  in_hour,
simba_uint16  in_minute,
simba_uint16  in_second,
simba_uint32  in_fraction 
)

Constructor.

Parameters:
in_year The year of the timestamp.
in_month The month of the timestamp, starting from 1.
in_day The day of the timestamp, starting from 1.
in_hour The hour of the timestamp, starting from 0.
in_minute The minute of the timestamp, starting from 0.
in_second The second of the timestamp, starting from 0.
in_fraction The fractions of seconds of the timestamp, starting from 0.
TDWTimestamp ( const simba_char in_value,
bool  in_throwOnError = true 
)

Constructor.

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

Constructor.

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

Constructor.

Parameters:
in_value The timestamp as a string in the format YYYY-DD-MM hh:mm:ss[.fffffffff].
in_throwOnError True to throw an exception on error; false otherwise.
TDWTimestamp ( const simba_wstring in_value,
bool  in_throwOnError = true 
)

Constructor.

Parameters:
in_value The timestamp as a string in the format YYYY-DD-MM hh:mm:ss[.fffffffff].
in_throwOnError True to throw an exception on error; false otherwise.

Member Function Documentation

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 timestamp value is valid.

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

Overloaded != operator.

TDWTimestamp operator+ ( simba_int64  in_days  )  const

Overloaded + operator.

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

Overloaded - (negate) operator.

TDWTimestamp operator- ( simba_int64  in_days  )  const

Overloaded - operator.

Parameters:
in_days The number of days to subtract from this timestamp.
Returns:
The new timestamp adjusted by in_days.
simba_double64 operator- ( const TDWTimestamp in_timestamp  )  const

Overloaded - (subtract) operator.

bool operator< ( const TDWTimestamp in_timestamp  )  const

Overloaded < operator.

bool operator<= ( const TDWTimestamp in_timestamp  )  const

Overloaded <= operator.

bool operator== ( const TDWTimestamp in_timestamp  )  const

Overloaded == operator.

bool operator> ( const TDWTimestamp in_timestamp  )  const

Overloaded > operator.

bool operator>= ( const TDWTimestamp in_timestamp  )  const

Overloaded >= operator.

void Set ( const simba_wstring in_value,
bool  in_throwOnError 
)

Sets the timestamp with the given string value.

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

Sets the timestamp with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD hh:mm:ss[.fffffffff].
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 timestamp with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD hh:mm:ss[.fffffffff]. (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 timestamp with the given string value.

Parameters:
in_value The string value in the format of YYYY-MM-DD hh:mm:ss[.fffffffff]. (NOT OWN)
in_throwOnError True to throw an exception on error; false otherwise.
simba_char* ToCharArray ( simba_uint16  in_precision = TDW_TS_MAX_FRACTION_PRECISION,
bool  in_keepZeroFraction = false 
) const

Return a string representation of the TDWTimestamp.

The format is [-]YYYY-MM-DD hh:mm:ss[.fffffffff].

Parameters:
in_precision The fractional precision to use in the string.
Returns:
The NUL-terminated string representation of the TDWTimestamp. (OWN)
void ToCharArray ( simba_char in_buffer,
simba_uint16  in_precision = TDW_TS_MAX_FRACTION_PRECISION,
bool  in_keepZeroFraction = false 
) const

Return a string representation of the TDWTimestamp.

The format is [-]YYYY-MM-DD hh:mm:ss[.fffffffff].

Parameters:
in_buffer The buffer to use for the string, must be at least 23 + in_precision characters long. (NOT OWN)
in_precision The fractional precision to use in the string.
simba_string ToString ( simba_uint16  in_precision = TDW_TS_MAX_FRACTION_PRECISION,
bool  in_keepZeroFraction = false 
) const

Return a string representation of the TDWTimestamp.

The format is [-]YYYY-MM-DD hh:mm:ss[.fffffffff].

Parameters:
in_precision The fractional precision to use in the string.
Returns:
The string representation of the TDWTimestamp.
void UncheckedSet ( const simba_char in_value,
simba_size_t  in_length 
)

Sets the timestamp with the given string value without validating it.

Parameters:
in_value The string value in the format of YYYY-MM-DD hh:mm:ss[.fffffffff]. (NOT OWN).
static bool Validate ( const TDWTimestamp in_timestamp  )  [static]

Determine if the specified timestamp value is valid.

Parameters:
in_timestamp The timestamp to check for validity.
Returns:
True if valid; false otherwise.

Member Data Documentation

The day of the timestamp, starting at 1.

The fractions of seconds of the timestamp. [0-999999999].

Note that this is always given as nano-second precision. If the actual precision of the data is less, then the value of the fraction should be padded with zeros. For instance, with a precision of 3, the value "123" should be represented as 123000000.

The hour of the timestamp. [0-23].

The minutes of the timestamp. [0-59].

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

The seconds of the timestamp. [0-61].

The year of the timestamp. [-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