Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site











SourceForge.net Logo

SqlCtrls

 

class SqlCtrls : public IdCtrls

This class extends IdCtrls class with SQL related operations.

 

Public Method List


 

SqlCtrls& operator()(SqlId id, Ctrl& ctrl)

Calls IdCtrls::Add(id, ctrl).

 


 

void Table(Ctrl& dlg, SqlId table)

Adds such widgets of dlg whose layout id (that is the same as the id of theirs member variable) matches any column name in table, based on database schema file (.sch). Widgets are added with uppercased layout id. Label and Button widget are excluded (tested using dynamic_cast)

 


 

SqlCtrls& operator()(Ctrl& dlg, SqlId table)

Same as Table(dlg, table).

 


 

SqlSet Set() const

Returns SqlSet of all ids of SqlCtrls.

 


 

operator SqlSet() const

Same as Set().

 


 

void Read(Sql& sql)

Assigns values of sql (which is supposed to contain some fetched line from SQL database) into widgets, based on match of widget ids and column names.

 


 

bool Fetch(Sql& sql)

Does sql.Fetch(). If that is false, returns false, otherwise performs Read(sql) and returns true. In other words, fetches the line from SQL database and assigns corresponding values to SqlCtrls widgets.

 


 

bool Load(Sql& sql, SqlSelect select)

Executes select statement on sql and then calls Fetch(sql) and returns its return value.

 


 

bool Load(Sql& sql, SqlId table, SqlBool where)

Similar to Load, but select statement is constructed based on ids of widgets, given table and where expression.

 


 

bool Fetch()

Same as Fetch(SQL).

 


 

bool Load(SqlSelect select)

Same as Load(SQL, select).

 


 

bool Load(SqlId table, SqlBool set)

Same as Load(SQL, table, set).

 


 

void Insert(SqlInsert& insertconst

Adds all id - widget value pairs to insert.

 


 

void Update(SqlUpdate& updateconst

Adds all id - widget value pairs to update.

 


 

void UpdateModified(SqlUpdate& updateconst

Adds all id - widget value pairs, where widgets have 'modified' flag set, to update .

 


 

SqlInsert Insert(SqlId tableconst

Constructs SqlInsert statement into table which contains all id - widget value pairs as inserted values.

 


 

SqlUpdate Update(SqlId tableconst

Constructs SqlUpdate statement of table which contains all id - widget value pairs as updated values.

 


 

SqlUpdate UpdateModified(SqlId tableconst

Constructs SqlUpdate statement of table which contains all id - widget value pairs, where widgets have 'modified' flag set, as updated values.

 


 

SqlId operator()(int iconst

SqlId GetKey(int iconst

Returns id of entry i.

 

Last edit by cxl on 12/02/2017. Do you want to contribute?. T++