SQLState Class Reference

A Class which represents ODBC SQLStates. More...

List of all members.

Public Member Functions

const simba_charc_str () const
 Get The C-String representation of this SQLState.
void Clear ()
 Clears the 'set' status of this SQLState.
bool IsSet () const
 Check whether this object is 'set'.
bool operator< (const SQLState &in_other) const
 Less-Than Operator.
SQLStateoperator= (const SQLState &in_other)
 Assignment Operator.
bool operator== (const SQLState &in_other) const
 Equality Operator.
simba_char operator[] (simba_size_t in_index) const
 Subscripting Operator.
simba_size_t size () const
 Get the size of this SQLState as a string (always 5).
 SQLState (const SQLState &in_sqlState)
 Copy Constructor.
 SQLState ()
 Constructor.
 SQLState (DiagState in_diagState)
 Constructor.
 SQLState (const simba_string &in_sqlState)
 Constructor.
 SQLState (const simba_char *in_sqlState)
 Constructor.

Static Public Member Functions

static SQLState FromString (simba_string in_string)
 'Lossy' factory function.

Detailed Description

A Class which represents ODBC SQLStates.


Constructor & Destructor Documentation

SQLState ( const simba_char in_sqlState  )  [inline]

Constructor.

Parameters:
in_sqlState The 5-character SQLState this object will represent. (NOT OWN)
SQLState ( const simba_string in_sqlState  )  [inline]

Constructor.

Parameters:
in_sqlState The 5-character SQLState this object will represent.
SQLState ( DiagState  in_diagState  )  [explicit]

Constructor.

Convert a DiagState into an ODBC 3.X SQLState.

Parameters:
in_diagState The DiagState to convert.
SQLState (  )  [inline]

Constructor.

Note: A SQLState constructed with this constructor is not considered to be 'set'. See the documentation for IsSet() for details.

SQLState ( const SQLState in_sqlState  )  [inline]

Copy Constructor.

Parameters:
in_sqlState The SQLState to copy from.

Member Function Documentation

const simba_char* c_str (  )  const

Get The C-String representation of this SQLState.

Returns:
A pointer to the 5-character string which defines this SQLState. (NOT OWN)
void Clear (  ) 

Clears the 'set' status of this SQLState.

After this method is called, IsSet() will return false for this object. See the documentation of IsSet() for details.

static SQLState FromString ( simba_string  in_string  )  [static]

'Lossy' factory function.

This function creates a SQLState from a string which is allowed to be of any length. The algorithm it uses is to trim any whitespace from the beginning and end, then, with the remainder: 1) If there is less than 5 characters remaining, right-pad with '0'. 2) If there is more than 5 characters remaining, truncate and use the first 5. 3) If there is exactly 5 characters remaining, use them as is.

Parameters:
in_string The string to initialize the SQLState with.
Returns:
The value described by the algorithm above.
bool IsSet (  )  const

Check whether this object is 'set'.

A SQLState is considered set when constructed with a SQLState string or from another 'set' SQLState. If Clear() is called on a SQLState, it will be considered to not have been set, until a 'set' SQLState is assigned to it.

Returns:
True if this SQLState is 'set', false otherwise.
bool operator< ( const SQLState in_other  )  const [inline]

Less-Than Operator.

Note: This function does not compare SQLStates lexicographically. It is only provided to be used by std::map and std::set.

Parameters:
in_other The SQLState to compare against.
Returns:
True if in_other 'less than' this object, false otherwise.
SQLState& operator= ( const SQLState in_other  )  [inline]

Assignment Operator.

Parameters:
in_other The SQLState to copy from.
bool operator== ( const SQLState in_other  )  const [inline]

Equality Operator.

Note: This function compares the 5-character string the SQLStates were initialized with. It does so in a case-sensitive manner.

Parameters:
in_other The SQLState to compare against.
Returns:
True if in_other represents the same SQLState as this object, false otherwise.
simba_char operator[] ( simba_size_t  in_index  )  const [inline]

Subscripting Operator.

Returns the character located at index in_index for this SQLState. Note: in_index MUST be between 0 and 4 inclusive.

Pre-Condition: IsSet() returns true. Otherwise the behaviour of this function is undefined.

Parameters:
in_index The index of the character of this SQLState to retrieve.
Returns:
The character located at index in_index for this SQLState.
simba_size_t size (  )  const [inline]

Get the size of this SQLState as a string (always 5).


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

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