Wexus2 0.20
|
#include <ActiveClass.h>
Classes | |
class | ActiveField |
class | ActiveFieldType |
Public Types | |
enum | { keyStyle = 1, varStyle, fKeyStyle } |
typedef QVector < std::shared_ptr< ActiveField > > | FieldVec |
typedef QMap< QString, std::shared_ptr< ActiveField > > | FieldMap |
Public Member Functions | |
ActiveClass (const QString &_className) | |
ctor | |
const QString & | className (void) const |
const QString & | tableName (void) const |
const QString & | fieldsAsList (void) const |
const QString & | fieldsAsListSansTable (void) const |
const QString & | questionsAsList (void) const |
int | keyColumn (void) const |
std::shared_ptr< ActiveField > | keyField (void) const |
void | createTable (void) const |
creates the table in the database | |
FieldVec & | fieldsVec (void) |
const FieldVec & | fieldsVec (void) const |
FieldMap & | fieldsMap (void) |
const FieldMap & | fieldsMap (void) const |
Static Public Member Functions | |
static QString | toSqlType (const QString &t) |
Protected Member Functions | |
template<class RECT , class DATT > | |
void | addField (int style, const QString &fieldName, const QString &fieldType, const ValidationExpr &valexpr, const QVariant &initVal, typename ActiveFieldType< RECT, DATT >::MemberPtr memberptr) |
field adder | |
void | doneConstruction (void) |
called by descendants construtors |
Represents a wexus::ActiveRecord type. Every wexus::ActiveRecord has a link to one of these.
anonymous enum |
Field "styles".
various "styles" of keys. I really want to call these "types", but that would conflict with fieldType() already.
const QString& wexus::ActiveClass::className | ( | void | ) | const [inline] |
The C++ class name of this type.
const QString& wexus::ActiveClass::fieldsAsList | ( | void | ) | const [inline] |
Returns all the field names as one string, seperated by commas. Each field name will be prefixed by tableName().
const QString& wexus::ActiveClass::fieldsAsListSansTable | ( | void | ) | const [inline] |
Returns all the field names as one string, seperated by commas.
const FieldMap& wexus::ActiveClass::fieldsMap | ( | void | ) | const [inline] |
Returns all the fields as a map keyed by their field names.
FieldMap& wexus::ActiveClass::fieldsMap | ( | void | ) | [inline] |
Returns all the fields as a map keyed by their field names.
const FieldVec& wexus::ActiveClass::fieldsVec | ( | void | ) | const [inline] |
Returns all the fields as a vector.
FieldVec& wexus::ActiveClass::fieldsVec | ( | void | ) | [inline] |
Returns all the fields as a vector.
int wexus::ActiveClass::keyColumn | ( | void | ) | const |
Returns the index of the key column. There can only be one (for now.. anyways)
Never fails.
std::shared_ptr<ActiveField> wexus::ActiveClass::keyField | ( | void | ) | const [inline] |
Return the ActiveField referenced by keyColumn()
const QString& wexus::ActiveClass::questionsAsList | ( | void | ) | const [inline] |
Returns a list of question marks, each seperated by a comma. There will be as many question marks as their are fields in this class.
const QString& wexus::ActiveClass::tableName | ( | void | ) | const [inline] |
The C++ class converted to a SQL-comptabile string (mostly :: removed)
static QString wexus::ActiveClass::toSqlType | ( | const QString & | t | ) | [static] |
Converts C++ types (int QString) to SQL types.