Merge "Fix memory leaks in Locales" into tizen_2.1
[platform/framework/native/appfw.git] / src / io / inc / FIo_DbStatementImpl.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file        FIo_DbEnumeratorImpl.h
20  * @brief       This is the header file for the %_DbEnumeratorImpl class.
21  *
22  * This header file contains declarations of the %_DbEnumeratorImpl class.
23  */
24
25 #ifndef _FIO_INTERNAL_DBSTATEMENT_IMPL_H_
26 #define _FIO_INTERNAL_DBSTATEMENT_IMPL_H_
27
28 #include <FOspConfig.h>
29
30 #include <FIoDbStatement.h>
31
32 namespace Tizen { namespace Base
33 {
34 class String;
35 class ByteBuffer;
36 class DateTime;
37 }}
38
39 namespace Tizen { namespace Io
40 {
41
42 class _DatabaseImpl;
43
44 /**
45  * @enum        _DbStatementType
46  * Defines      types of statement.
47  * @since 2.1
48  */
49 enum _DbStatementType
50 {
51         DB_STATEMENT_TYPE_OTHER = 0,
52         DB_STATEMENT_TYPE_SELECT = 1
53 };
54
55 /**
56  * @class       _DbStatementImpl
57  * @brief       This class implements the DbStatement.
58  * @since 2.1
59  *
60  * @see Tizen::Io::DbStatement
61  */
62 class _OSP_EXPORT_ _DbStatementImpl
63         : public Tizen::Base::Object
64 {
65
66 public:
67         _DbStatementImpl(void);
68
69         virtual ~_DbStatementImpl(void);
70
71         result BindInt(int columnIndex, int value);
72
73         result BindInt64(int columnIndex, long long value);
74
75         result BindDouble(int columnIndex, double value);
76
77         result BindString(int columnIndex, const Tizen::Base::String& value);
78
79         result BindBlob(int columnIndex, const Tizen::Base::ByteBuffer& value);
80
81         result BindBlob(int columnIndex, const void* buffer, int size);
82
83         result BindDateTime(int columnIndex, const Tizen::Base::DateTime& value);
84
85         result BindNull(int columnIndex);
86
87         static _DbStatementImpl* GetInstance(DbStatement& dbStatement);
88
89         static const _DbStatementImpl* GetInstance(const DbStatement& dbStatement);
90
91         static DbStatement* CreateDbStatementInstanceN(void);
92 private:
93         bool __shouldReleaseResource;
94         _DbStatementType __stmtType;
95         void* __pStmt;
96         void* __pDatabase;
97
98         friend class _DatabaseImpl;
99
100 }; //_DbStatementImpl
101
102 }} // Tizen::Io
103
104 #endif  //_FIO_INTERNAL_DBSTATEMENT_IMPL_H_
105