Dv::Sql::Table::Column Class Reference
A Column contains information about a column in a table.
More...
#include <table.h>
List of all members.
Public Types |
enum | Type {
ALPHA,
BLOB,
INTEGER,
LONGINT,
REAL,
DATETIME,
TIMESTAMP
} |
| Simplified representation of "type" of column.
More...
|
typedef std::vector< const
Column * > | List |
| Type of list of columns.
|
typedef List::const_iterator | const_iterator |
Public Member Functions |
virtual | ~Column () |
std::string | str () const |
| A full description of a Column.
|
Static Public Member Functions |
static std::string | str (const Column::List &columns) |
| Generate info on a list of columns.
|
Public Attributes |
const std::string | name |
| The name of the column.
|
const Type | type |
| The type of the column data.
|
const bool | auto_inc |
| Is this an auto_increment column?
|
const bool | in_primary_key |
| Does this column belong to the table's primary key.
|
const bool | can_be_null |
| Can the column value be null?
|
const Table::Ref | table |
| The table of the column.
|
Private Member Functions |
| Column (const Table::Ref &table, const std::string &name, Type type, bool auto_inc, bool in_primary_key, bool null_possible, size_t index) |
| Constructor.
|
Friends |
class | Table |
Detailed Description
A Column contains information about a column in a table.
Since its constructor is private, Columns can only be created by Table objects. Moreover, all data members are constant.
- See also:
- Dv::Sql::Table
Definition at line 52 of file table.h.
Member Typedef Documentation
Type of list of columns.
Definition at line 58 of file table.h.
Member Enumeration Documentation
Simplified representation of "type" of column.
- Enumerator:
ALPHA |
|
BLOB |
|
INTEGER |
|
LONGINT |
|
REAL |
|
DATETIME |
|
TIMESTAMP |
|
Definition at line 56 of file table.h.
Constructor & Destructor Documentation
virtual Dv::Sql::Table::Column::~Column |
( |
|
) |
[inline, virtual] |
Dv::Sql::Table::Column::Column |
( |
const Table::Ref & |
table, |
|
|
const std::string & |
name, |
|
|
Type |
type, |
|
|
bool |
auto_inc, |
|
|
bool |
in_primary_key, |
|
|
bool |
null_possible, |
|
|
size_t |
index | |
|
) |
| | [private] |
Constructor.
- Parameters:
-
| table | of the column |
| name | of the column |
| type | of the column |
| auto_inc | if true, the column is auto_inc |
| in_primary_key | if true, the column is part of the table's primary key |
| null_possible | if true, the column may have value null |
| index | the position (0-based) of the column in the table. |
Member Function Documentation
std::string Dv::Sql::Table::Column::str |
( |
|
) |
const |
A full description of a Column.
- Returns:
- a full description of a column.
static std::string Dv::Sql::Table::Column::str |
( |
const Column::List & |
columns |
) |
[static] |
Generate info on a list of columns.
- Parameters:
-
| columns | the list of columns to generate info for |
- Returns:
- a string describing the list of columns
- See also:
- Dv::Sql::Table::Column::str
Friends And Related Function Documentation
friend class Table [friend] |
Member Data Documentation
The name of the column.
Definition at line 76 of file table.h.
The type of the column data.
Definition at line 78 of file table.h.
Is this an auto_increment column?
Definition at line 80 of file table.h.
Does this column belong to the table's primary key.
Definition at line 82 of file table.h.
Can the column value be null?
Definition at line 84 of file table.h.
The table of the column.
Definition at line 86 of file table.h.
The documentation for this class was generated from the following file: