Databaseconnectionclasses  0.5.3
hk_drivermanager.h
1 // ****************************************************************************
2 // copyright (c) 2000-2005 Horst Knorr <hk_classes@knoda.org>
3 // This file is part of the hk_classes library.
4 // This file may be distributed and/or modified under the terms of the
5 // GNU Library Public License version 2 as published by the Free Software
6 // Foundation and appearing in the file COPYING included in the
7 // packaging of this file.
8 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
9 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
10 // ****************************************************************************
11 #ifndef HK_DRIVERMANAGER_H
12 #define HK_DRIVERMANAGER_H
13 #include "hk_definitions.h"
14 #include <list>
15 #include <vector>
16 #include "hk_class.h"
17 #include "hk_url.h"
18 #include "hk_definitions.h"
19 #include "hk_string.h"
20 using namespace std;
21 
22 class hk_connection;
23 class hk_database;
25 typedef hk_string requestdialogtype(void);
26 
39 {
40  friend class hk_connection;
41  public:
45  hk_drivermanager(void);
46  hk_drivermanager(bool runtime);
47  virtual ~hk_drivermanager(void);
56  hk_connection* new_connection(const hk_string& drivername="",enum_interaction i=interactive);
60  hk_connection* find_existing_connection(const hk_string& drivername,const hk_string& host,unsigned int tcp_port,const hk_string& user);
61 
62  static vector<hk_string>* driverlist(void);
66  static void set_path(const hk_string& path);
67  static hk_string path(void);
72  static void set_driverselectdialog(requestdialogtype* dialog);
73  static hk_string show_driverselectdialog(void);
74  hk_database* open_connectionfile(const hk_url&connectionfile);
75  protected:
76 
77  private:
78  void init(bool runtime);
79  void load_preferences(void);
80  void set_preferences(xmlNodePtr preferences);
81 
82  void connection_remove(hk_connection* c);
83  static hk_string p_hk_classespath;
84  static vector<hk_string> p_driverlist;
85  static void scan_directory(void);
86  static requestdialogtype* p_driverselectdialog;
87  list<hk_connection*> p_connections;
88  hk_drivermanagerprivate* p_private;
89 };
90 
91 extern "C"
92 {
93  //void __attribute__((constructor)) hk_classes_init(void);
94 // void __attribute__((destructor)) hk_classes_finish(void);
95 
96 }
97 #endif
represents a particular database on the SQL Server
Definition: hk_database.h:48
basic class for all other defined classes.
Definition: hk_class.h:52
virtual hk_string drivername(void) const
Definition: hk_connection.cpp:677
connects to the SQL Server
Definition: hk_connection.h:31
enum_interaction
Definition: hk_class.h:60
Definition: hk_url.h:17
Definition: hk_drivermanager.cpp:55
Database Driver administration.
Definition: hk_drivermanager.h:38