Nemiver  0.3
nmv-i-connection-driver.h
Go to the documentation of this file.
1 /* -*- Mode: C++; indent-tabs-mode:nil; c-basic-offset: 4 -*- */
2 
3 /*
4  *This file is part of the Nemiver Project.
5  *
6  *Nemiver is free software; you can redistribute
7  *it and/or modify it under the terms of
8  *the GNU General Public License as published by the
9  *Free Software Foundation; either version 2,
10  *or (at your option) any later version.
11  *
12  *Nemiver is distributed in the hope that it will
13  *be useful, but WITHOUT ANY WARRANTY;
14  *without even the implied warranty of
15  *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *See the GNU General Public License for more details.
17  *
18  *You should have received a copy of the
19  *GNU General Public License along with Nemiver;
20  *see the file COPYING.
21  *If not, write to the Free Software Foundation,
22  *Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23  *
24  *See COPYRIGHT file copyright information.
25  */
26 #ifndef __NMV_I_CONNECTION_DRIVER_H__
27 #define __NMV_I_CONNECTION_DRIVER_H__
28 
29 #include <glib.h>
30 #include "nmv-object.h"
31 #include "nmv-safe-ptr-utils.h"
32 
33 namespace nemiver {
34 
35 namespace common {
36 class Buffer;
37 class UString;
38 }
39 
40 namespace common {
41 
42 enum ColumnType {
50  COLUMN_TYPE_UNKNOWN=1<<30// should be last
51 };
52 
53 class SQLStatement;
55 
56 public:
57 
58  virtual ~IConnectionDriver ()
59  {}
60 
61  virtual void close () = 0;
62 
63  virtual const char* get_last_error () const = 0;
64 
65  virtual bool start_transaction () = 0;
66 
67  virtual bool commit_transaction () = 0;
68 
69  virtual bool rollback_transaction () = 0;
70 
71  virtual bool execute_statement
72  (const SQLStatement &a_statement) = 0;
73 
74  virtual bool should_have_data () const = 0;
75 
76  virtual bool read_next_row () = 0;
77 
78  virtual unsigned int get_number_of_columns () const = 0;
79 
80  virtual bool get_column_type (gulong a_offset,
81  enum ColumnType &) const = 0;
82 
83  virtual bool get_column_name (gulong a_offset,
84  common::Buffer &a_name) const = 0;
85 
86  virtual bool get_column_content (gulong a_offset,
87  common::Buffer &a_column_content) const = 0;
88 
89  virtual bool get_column_content (gulong a_offset,
90  gint64 &a_column_content) const = 0;
91 
92  virtual bool get_column_content (gulong a_offset,
93  double& a_column_content) const = 0;
94 
95  virtual bool get_column_content (gulong a_offset,
96  common::UString& a_column_content) const = 0;
97 };//end IConnectionDriver
98 
102 }//end common
103 }//end nemiver
104 
105 #endif //__NMV_I_CONNECTION_DRIVER_H__
106 
nmv-safe-ptr-utils.h
nemiver::common::COLUMN_TYPE_STRING
@ COLUMN_TYPE_STRING
Definition: nmv-i-connection-driver.h:48
nemiver::common::Object
Definition: nmv-object.h:43
nemiver
Definition: nmv-address.h:31
nemiver::common::ObjectRef
Definition: nmv-safe-ptr-utils.h:45
NEMIVER_API
#define NEMIVER_API
Definition: nmv-api-macros.h:53
nemiver::common::ColumnType
ColumnType
Definition: nmv-i-connection-driver.h:42
nemiver::common::COLUMN_TYPE_DATETIME
@ COLUMN_TYPE_DATETIME
Definition: nmv-i-connection-driver.h:47
nemiver::common::IConnectionDriver::~IConnectionDriver
virtual ~IConnectionDriver()
Definition: nmv-i-connection-driver.h:58
nemiver::common::UString
Definition: nmv-ustring.h:45
nemiver::common::COLUMN_TYPE_DECIMAL
@ COLUMN_TYPE_DECIMAL
Definition: nmv-i-connection-driver.h:45
nemiver::common::COLUMN_TYPE_UNKNOWN
@ COLUMN_TYPE_UNKNOWN
Definition: nmv-i-connection-driver.h:50
nemiver::common::IConnectionDriver
Definition: nmv-i-connection-driver.h:54
nemiver::common::IConnectionDriverSafePtr
common::SafePtr< IConnectionDriver, common::ObjectRef, common::ObjectUnref > IConnectionDriverSafePtr
Definition: nmv-i-connection-driver.h:101
nemiver::common::COLUMN_TYPE_INT
@ COLUMN_TYPE_INT
Definition: nmv-i-connection-driver.h:43
nemiver::common::COLUMN_TYPE_DOUBLE
@ COLUMN_TYPE_DOUBLE
Definition: nmv-i-connection-driver.h:46
nemiver::common::SQLStatement
Definition: nmv-sql-statement.h:98
nemiver::common::ObjectUnref
Definition: nmv-safe-ptr-utils.h:55
nemiver::common::COLUMN_TYPE_BIG_INT
@ COLUMN_TYPE_BIG_INT
Definition: nmv-i-connection-driver.h:44
nemiver::common::Buffer
Definition: nmv-buffer.h:34
nmv-object.h
nemiver::common::COLUMN_TYPE_BLOB
@ COLUMN_TYPE_BLOB
Definition: nmv-i-connection-driver.h:49
nemiver::common::SafePtr
Definition: nmv-safe-ptr.h:71
common
Definition: nmv-proc-list-dialog.h:32