Databaseconnectionclasses  0.5.3
hk_data.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_DATA
12 #define HK_DATA
13 #include "hk_class.h"
14 using namespace std;
15 const hk_string defaulttextdelimiter="'";
16 const hk_string defaultidentifierdelimiter="\"";
26 class hk_data: public hk_class
27 {
28  friend class hk_database;
29  public:
34  virtual hk_string name(void) const;
35  virtual void set_name(const hk_string& n);
41  enum enum_datasourcetypes {ds_table,ds_query,ds_actionquery,ds_view,ds_unknown};
42  virtual enum_datasourcetypes type(void) const;
43  hk_string identifierdelimiter(void) const {return p_identifierdelimiter;}
44  hk_string textdelimiter(void) const {return p_sqltextdelimiter;}
45  static bool print_sqlstatements(void) {return p_print_sqlstatements;}
46  static void set_print_sqlstatements(bool p);
47 
48  protected:
49  hk_data();
50  virtual ~hk_data();
51  virtual void before_source_vanishes(void);
52  virtual void before_connection_disconnects(void);
53  virtual void filelist_changes(listtype t);
54  virtual bool driver_specific_name(const hk_string& n);
55  hk_string p_name;
56  hk_string p_sqltextdelimiter;
57  hk_string p_identifierdelimiter;
58  static bool p_print_sqlstatements;//will be used to decide whether sql statements will be printed to cerr
59 
60  private:
61 //p_already_handled is used from hk_database in bulk operations to find out if this object has been already handled.
62  bool p_already_handled;
63 
64 };
65 #endif
virtual bool set_name(const hk_string &n)
Definition: hk_database.cpp:99
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
Base class for all kind of queries.
Definition: hk_data.h:26
enum_datasourcetypes
Definition: hk_data.h:41