Software and Services, Portable Libraries
2019.Mar.01
A library for managing digital certificates
|
An object that represents a char or chars. More...
#include <SaS/Sql/SQLCHAR.hpp>
Public Member Functions | |
SQLCHAR () | |
SQLCHAR - Default Constructor. More... | |
SQLCHAR (size_t TheSize) | |
SQLCHAR - Constructor. More... | |
SQLCHAR (const SQLCHAR &CopyFrom) | |
SQLCHAR - Copy Constructor. More... | |
SQLCHAR (const char *Val) | |
SQLCHAR - Constructor. More... | |
virtual | ~SQLCHAR () |
SQLCHAR - Destructor. More... | |
std::vector< int32_t > * | Array () const |
Get the array information. More... | |
const char * | ArraySpecs (const char *Format=NULL) const |
Print the array specifications, or NONE when they do not exist. More... | |
void | Attributes (SqlColumnAttributes *Attrs) |
Set the column attributes. More... | |
virtual const char * | BaseType () const |
Get the C++ base type name. More... | |
virtual DataTypeBase * | Copy () const |
Copy this object. More... | |
virtual InstanceCount_t | decInstance () const |
Decrement the instance. More... | |
bool | Default (const char *&DefVal) const |
Get its default value as a (char*). More... | |
bool | Default (long double &DefVal) const |
Get its default value as a (long double). More... | |
bool | Default (bool &DefVal) const |
Get its default value as a (bool). More... | |
void | Dim (uint32_t Dim, int32_t DimSize) |
Set the maximum dimension (may grow). More... | |
SqlColumnForeignKey * | ForeignKey () const |
void | ForeignKey (SqlColumnForeignKey *Fk) |
Set any ForeignKey data for this column. More... | |
virtual bool | fromString (const char *TheValue) |
Convert the object value from a string. More... | |
bool | fromString (const String &TheValue) |
Convert the object value from a string. More... | |
bool | fromString (const std::string &TheValue) |
Convert the object value from a string. More... | |
virtual InstanceCount_t | getInstance () const |
bool | HasDefault () const |
Determine if this column has any default value. More... | |
bool | HasForeignKey () const |
bool | HasSequence () const |
virtual InstanceCount_t | incInstance () const |
Increment the instance. More... | |
bool | IsNull () const |
bool | IsPrimary () const |
void | IsPrimary (bool SetPrimary) |
Set if this column is the primary key for the table. More... | |
void | IsSequence (bool SetSeq, const char *SeqName) |
Set if this column is an auto-increment value. More... | |
bool | IsSequence (const char *&SeqName) const |
bool | IsUnique () const |
void | IsUnique (bool SetUnique) |
Set if this column data is unique in the table. More... | |
size_t | Len () const |
void | Length (uint64_t Len) |
Set the length of the data. More... | |
uint64_t | Length () const |
bool | MayBeNull () const |
void | MayBeNull (bool SetNullOk) |
Set if this column may be set to null. More... | |
void | Name (const char *NewName) |
Set the name of the column. More... | |
const char * | Name () const |
void | operator delete (void *ToFree) |
bool | operator!= (const SQLCHAR &CompareTo) const |
Compare this object to CompareTo. More... | |
bool | operator!= (const SqlColumn &Other) |
Compare Operator. More... | |
SQLCHAR & | operator= (const SQLCHAR &CopyFrom) |
Copy the chars, return (*this) updated. More... | |
bool | operator== (const SQLCHAR &CompareTo) const |
Compare this object to CompareTo. More... | |
bool | operator== (const SqlColumn &Other) |
Compare Operator. More... | |
void | Size (size_t NChars) |
Allocate and set the number of chars. More... | |
size_t | Size () const |
virtual const char * | toString () const |
Convert the object value to a string. More... | |
SQL::SqlDataType_e | Type () const |
void | Type (SQL::SqlDataType_e Dt) |
Set the SqlDataType_e for this object. More... | |
Static Public Member Functions | |
static void | CreateCpp () |
Create the C++ code for all SQL FUNCTION objects. More... | |
static void | FromVector (std::vector< SQLCHAR *> &Vector, String &Results) |
Convert an array of values, into a form suitable for an insert. More... | |
static bool | GenExtractUtcTime_t (const char *ColName, String &Results) |
Generate an SQL statement that will extract a TIMESTAMP to UTC, as a time_t value as a (char*). More... | |
static bool | ToSqlTime (time_t TheTimeT, String &Results) |
Convert a time_t in UTC, to a value acceptable to SQL as a timestamp. More... | |
static void | ToVector (const char *OneString, std::vector< SQLCHAR *> &Results) |
Convert an SQL array result to an array of SqlColumn values. More... | |
Protected Member Functions | |
void | CopyColumnData (const SqlColumn &Other) |
Copy just the SqlColumn Data only. More... | |
Protected Attributes | |
std::vector< int32_t > * | _ArrayInfo |
When an array, this pointer will be NON-NULL. More... | |
SQL::SqlDataType_e | _Dt |
The data type. More... | |
char * | _ToStringCache |
When non-NULL, the object value as a (char*). More... | |
An object that represents a char or chars.
Definition at line 46 of file SQLCHAR.hpp.
SoftwareAndServices::Library::Database::SQLCHAR::SQLCHAR | ( | ) |
SQLCHAR - Default Constructor.
SoftwareAndServices::Library::Database::SQLCHAR::SQLCHAR | ( | size_t | TheSize | ) |
SQLCHAR - Constructor.
TheSize | The initial size. |
SoftwareAndServices::Library::Database::SQLCHAR::SQLCHAR | ( | const SQLCHAR & | CopyFrom | ) |
SoftwareAndServices::Library::Database::SQLCHAR::SQLCHAR | ( | const char * | Val | ) |
SQLCHAR - Constructor.
Val | The initial data. |
|
virtual |
SQLCHAR - Destructor.
|
inherited |
Get the array information.
|
inherited |
Print the array specifications, or NONE when they do not exist.
([][], [3][10], ...)
Format | When non-NULL, format using snprintf. When non-NULL a single 's' will be replaced with the results. |
Example, Called with "SQLBIGINTs' could return with: SQLBIGINT[][], SQLBIGINT[3][10], or when there are no dimensions SQLBIGINT.
|
inherited |
Set the column attributes.
Used by YACC to set what it found.
Attrs | The attributes. |
|
virtual |
Get the C++ base type name.
(int32_t, SQLTIMESTAMP, double, (char*), ...)
Implements SoftwareAndServices::Library::Database::DataTypeBase.
|
virtual |
Copy this object.
Implements SoftwareAndServices::Library::Database::DataTypeBase.
|
protectedinherited |
|
staticinherited |
Create the C++ code for all SQL FUNCTION objects.
|
inlinevirtualinherited |
Decrement the instance.
Definition at line 129 of file instance.hpp.
|
inherited |
Get its default value as a (char*).
[out] | DefVal | The default value as a (char*). |
|
inherited |
Get its default value as a (long double).
[out] | DefVal | The default value as a double. |
|
inherited |
Get its default value as a (bool).
[out] | DefVal | The default value as a bool. |
|
inherited |
Set the maximum dimension (may grow).
DimNumber | The number of dimensions. When DimNumber is greater than the current number of dimensions, it is incremented. When less, only the size is set. |
DimSize | The size of dimension DimNumber. |
|
inherited |
|
inherited |
Set any ForeignKey data for this column.
Fk | The foreign key data. |
|
virtual |
Convert the object value from a string.
TheValue | The value to convert to the data type. |
Implements SoftwareAndServices::Library::Database::DataTypeBase.
|
inherited |
Convert the object value from a string.
TheValue | The value to convert to the data type. |
|
inherited |
Convert the object value from a string.
TheValue | The value to convert to the data type. |
|
static |
Convert an array of values, into a form suitable for an insert.
Vector | The array of values to convert to a SQL INSERT string. | |
[out] | Results | Where the results are stored. |
|
staticinherited |
Generate an SQL statement that will extract a TIMESTAMP to UTC, as a time_t value as a (char*).
This does not fetch the column value, it generates the SQL SELECT string.
Called with ColName set to created, it will produce the string:
extract(epoch from created at time zone utc)
The results can be used in place of a column name in a SQL SELECT command.
ColName | The SQL table column name. | |
[out] | Results | Where the results will be stored. The results will be appended to any existing value in Results. |
|
inlinevirtualinherited |
Definition at line 118 of file instance.hpp.
|
inherited |
Determine if this column has any default value.
|
inherited |
|
inherited |
|
inlinevirtualinherited |
Increment the instance.
Definition at line 109 of file instance.hpp.
|
inherited |
|
inherited |
|
inherited |
Set if this column is the primary key for the table.
SetPrimary | When true, this columb is the primary key for the table. |
|
inherited |
Set if this column is an auto-increment value.
SetSeq | When true, this column value is an auto increment value. |
SeqName | Optional, some SQL databases name the sequence. |
|
inherited |
[out] | SeqName | A (char*) that will be updated when the sequence has a name. |
|
inherited |
|
inherited |
Set if this column data is unique in the table.
SetUnique When true, the column value is unique in the table.
size_t SoftwareAndServices::Library::Database::SQLCHAR::Len | ( | ) | const |
|
inherited |
Set the length of the data.
Len | The length, or zero (0) for unspecified. |
|
inherited |
|
inherited |
|
inherited |
Set if this column may be set to null.
SetNullOk | When true, this columns value may be set to null. |
|
inherited |
Set the name of the column.
NewName | the name of the column. |
|
inherited |
bool SoftwareAndServices::Library::Database::SQLCHAR::operator!= | ( | const SQLCHAR & | CompareTo | ) | const |
Compare this object to CompareTo.
CompareTo | The SQLCHAR obejct to compare to. |
|
inherited |
Compare Operator.
Other | The other object to compare to. |
Copy the chars, return (*this) updated.
CopyFrom | the SQLCHAR object to copy from. |
bool SoftwareAndServices::Library::Database::SQLCHAR::operator== | ( | const SQLCHAR & | CompareTo | ) | const |
Compare this object to CompareTo.
CompareTo | The SQLCHAR obejct to compare to. |
|
inherited |
Compare Operator.
Other | The other object to compare to. |
void SoftwareAndServices::Library::Database::SQLCHAR::Size | ( | size_t | NChars | ) |
Allocate and set the number of chars.
NChars | The number of chars in this set. |
size_t SoftwareAndServices::Library::Database::SQLCHAR::Size | ( | ) | const |
|
staticinherited |
Convert a time_t in UTC, to a value acceptable to SQL as a timestamp.
TheTimeT | The time_t value. |
Results | Where the results will be appended. |
|
virtual |
Convert the object value to a string.
Implements SoftwareAndServices::Library::Database::DataTypeBase.
|
static |
Convert an SQL array result to an array of SqlColumn values.
Example: A PostgreSQL table column is an array of integer (measured integer[]). It is returned from a SELECT as: "{1, 5, 7}"
This method converts the SELECT results into separate (SQLINTEGER*) values.
OneString | The string returned from SELECT. | |
[out] | Results | Were the results will be stored. The contents of Results will be cleared before filling in the results. |
|
inherited |
|
inherited |
Set the SqlDataType_e for this object.
Dt | The data type. |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |