Databaseconnectionclasses  0.5.3
Public Member Functions | Static Public Member Functions | Friends | List of all members
hk_drivermanager Class Reference

Database Driver administration. More...

#include <hk_drivermanager.h>

Inheritance diagram for hk_drivermanager:
Inheritance graph
[legend]
Collaboration diagram for hk_drivermanager:
Collaboration graph
[legend]

Public Member Functions

 hk_drivermanager (void)
 
 hk_drivermanager (bool runtime)
 
hk_connectionnew_connection (const hk_string &drivername="", enum_interaction i=interactive)
 
hk_connectionfind_existing_connection (const hk_string &drivername, const hk_string &host, unsigned int tcp_port, const hk_string &user)
 
hk_databaseopen_connectionfile (const hk_url &connectionfile)
 
- Public Member Functions inherited from hk_class
void hkclassname (const hk_string &n)
 
hk_string hkclassname (void) const
 
void hkdebug (const hk_string &d) const
 
void hkdebug (const hk_string &d, const hk_string &e) const
 
void hkdebug (const hk_string &d, int i) const
 
void hkdebug (const hk_string &d, double i) const
 
void wanna_debug (bool d)
 
bool wanna_debug (void) const
 
bool generaldebug (void)
 
virtual void savedata (ostream &s)
 
virtual void loaddata (xmlNodePtr definition)
 

Static Public Member Functions

static vector< hk_string > * driverlist (void)
 
static void set_path (const hk_string &path)
 
static hk_string path (void)
 
static void set_driverselectdialog (requestdialogtype *dialog)
 
static hk_string show_driverselectdialog (void)
 
- Static Public Member Functions inherited from hk_class
static void set_generaldebug (bool d)
 
static hk_string hk_translate (const hk_string &t)
 
static void show_warningmessage (const hk_string &m)
 
static void set_warningmessage (messagewindowtype *m)
 
static bool show_yesnodialog (const hk_string &m, bool default_value)
 
static void set_yesnodialog (yesno_dialogtype *d)
 
static hk_string show_stringvaluedialog (const hk_string &t)
 
static void set_stringvaluedialog (stringvalue_dialogtype *t)
 
static void set_translatefunction (translatefunctiontype *t)
 
static void set_filedialog (file_dialogtype *f)
 
static hk_string show_filedialog (const hk_string &f="", enum_operationmode m=file_open)
 
static void set_directorydialog (stringvalue_dialogtype *f)
 
static hk_string show_directorydialog (const hk_string &f="")
 
static void set_showpedantic (bool s)
 
static bool showpedantic (void)
 
static void set_measuresystem (enum_measuresystem)
 
static enum_measuresystem measuresystem (void)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, hk_string &value, int position=1, enum_tagtype tagtype=normaltag)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, unsigned long &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, unsigned int &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, long &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, int &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr where, const hk_string &tag, bool &value, int position=1)
 
static xmlNodePtr get_tagvalue (xmlNodePtr &where, const hk_string &tag)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, const hk_string &value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, unsigned long value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, unsigned int value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, long value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, int value)
 
static void set_tagvalue (ostream &stream, const hk_string &tag, bool value)
 
static void start_mastertag (ostream &stream, const hk_string &tag)
 
static void end_mastertag (ostream &stream, const hk_string &tag)
 
static void set_defaultdatetimeformat (const hk_string &timeformat, const hk_string &dateformat, const hk_string &datetimeformat)
 
static hk_string defaultdateformat (void)
 
static hk_string defaulttimeformat (void)
 
static hk_string defaultdatetimeformat (void)
 
static void save_preferences (void)
 
static bool runtime_only (void)
 
static void set_locale (const hk_string &locale)
 
static hk_string locale (void)
 
static void set_defaultdriver (const hk_string &d)
 
static hk_string defaultdriver (void)
 
static void set_default_automatic_data_update (bool)
 
static bool default_automatic_data_update (void)
 

Friends

class hk_connection
 

Additional Inherited Members

- Public Types inherited from hk_class
enum  enum_interaction { noninteractive, interactive }
 
enum  enum_measuresystem { cm, inch }
 
enum  enum_tagtype { normaltag, mastertag }
 
- Protected Member Functions inherited from hk_class
hk_interpreternew_interpreter (const hk_string &interpreter, hk_presentation *)
 
- Static Protected Attributes inherited from hk_class
static hk_string p_defaulttimeformat ="h:m:s"
 
static hk_string p_defaultdateformat ="D.M.Y"
 
static hk_string p_defaultdatetimeformat ="D.M.Y h:m:s"
 
static bool p_runtime_only =false
 

Detailed Description

Database Driver administration.

Version
Revision:
1.23
Author
Horst Knorr (hk_cl.nosp@m.asse.nosp@m.s@kno.nosp@m.da.o.nosp@m.rg)

This class allows you to handle the database drivers. You can get a new connection to a database with new_connection.

Constructor & Destructor Documentation

hk_drivermanager::hk_drivermanager ( void  )
Parameters
runtimeif true the user has no possibility to change table and form structures or query statements

Member Function Documentation

hk_connection * hk_drivermanager::find_existing_connection ( const hk_string &  drivername,
const hk_string &  host,
unsigned int  tcp_port,
const hk_string &  user 
)

If an already created connection exists, it will be returned otherwise NULL

hk_connection * hk_drivermanager::new_connection ( const hk_string &  drivername = "",
enum_interaction  i = interactive 
)

with this method you can create a new connection to a database. If no driver is set a dialog appears which asks for the driver. You can set a GUI dependend driverdialog with set_driverselectdialog.

Parameters
drivernamename of the wished database driver (i.e. mysql)
iif i is set to 'interactive' warningmessages and dialog boxes will be shown
Returns
a driver specific version of hk_connection or NULL if no driver could be found.

References hk_class::hk_translate(), hk_class::hkdebug(), and hk_class::show_warningmessage().

void hk_drivermanager::set_driverselectdialog ( requestdialogtype *  dialog)
static

you can write your own GUI dependend function to show a driver select dialog by defining a function of requestdialogtype

void hk_drivermanager::set_path ( const hk_string &  path)
static

Path to the directory where the database drivers are stored.(default: /usr/lib/hk_classes/drivers)


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