Enable build with iniparser v 3.1
[platform/framework/native/appfw.git] / inc / FIoDataRow.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18 * @file         FIoDataRow.h
19 * @brief        This is the header file for the %DataRow class.
20 *
21 * This header file contains the declarations of the %DataRow class.
22 */
23
24 #ifndef _FIO_DATA_ROW_H_
25 #define _FIO_DATA_ROW_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseByteBuffer.h>
29 #include <FBaseDateTime.h>
30
31 namespace Tizen { namespace Io
32 {
33
34 /**
35 * @class                DataRow
36
37 * @brief                This class provides methods to create a row in in-memory table.
38 *
39 * @since                2.1
40 *
41 * @final                This class is not intended for extension.
42 *
43 * The %DataRow class provides methods to create a row in in-memory table.
44 *
45 * @see Tizen::Io::DataSet
46 */
47 class _OSP_EXPORT_ DataRow
48            : public Tizen::Base::Object
49 {
50
51 public:
52         /**
53         * This destructor overrides Tizen::Base::Object::~Object().
54         *
55         * @since                2.1
56         */
57         virtual ~DataRow(void);
58
59         /**
60         * Sets a Tizen::Base::ByteBuffer value to the column with the specified index.
61         *
62         * @since                2.1
63         *
64         * @return                       An error code
65         * @param[in]            columnIndex             The index of the column whose value is set @n
66         *                                                                       The column index starts from @c 0.
67         * @param[in]            pValue                  The value to set @n
68         *                                                                       The specified @c pValue is a pointer to user-provided Tizen::Base::ByteBuffer type buffer.
69         * @exception            E_SUCCESS               The method is successful.
70         * @exception            E_INVALID_ARG   Either of the following conditions has occurred:
71         *                                                                       - The specified @c columnIndex is out of range.
72         *                                                                       - The specified @c pValue is @c null.
73         * @exception            E_TYPE_MISMATCH The column type accessed by the method do not match.
74         * @remarks
75         *                                       - This method performs a shallow copy. It copies just the pointer and not the element itself.
76         *                                       - The platform will take the ownership of @c pValue after calling this method.
77         */
78         result SetBlobAt(int columnIndex, Tizen::Base::ByteBuffer* pValue);
79
80
81         /**
82         * Sets a Tizen::Base::DateTime value to the column with the specified index.
83         *
84         * @since                2.1
85         *
86         * @return               An error code
87         * @param[in]    columnIndex                     The index of the column whose value is set @n
88         *                                                                       The column index starts from 0.
89         * @param[in]    value                           The value to set
90         * @exception    E_SUCCESS                       The method is successful.
91         * @exception    E_INVALID_ARG           The specified @c columnIndex is out of range.
92         * @exception    E_TYPE_MISMATCH         The column type accessed by the method do not match.
93         * @remarks              Tizen::Io::DbColumnType of the specified @c value is ::DB_COLUMNTYPE_TEXT.
94         */
95         result SetDateTimeAt(int columnIndex, const Tizen::Base::DateTime& value);
96
97
98         /**
99         * Sets a @c double value to the column with the specified index.
100         *
101         * @since                        2.1
102         *
103         * @return                       An error code
104         * @param[in]            columnIndex                     The index of the column whose value is set @n
105         *                                                                               The column index starts from @c 0.
106         * @param[in]            value                           The value to set
107         * @exception            E_SUCCESS                       The method is successful.
108         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
109         * @exception            E_TYPE_MISMATCH         The column type accessed by the method do not match.
110         */
111         result SetDoubleAt(int columnIndex, double value);
112
113         /**
114         * Sets an @c int value to the column with the specified index.
115         *
116         * @since                        2.1
117         *
118         * @return                       An error code
119         * @param[in]            columnIndex                     The index of the column whose value is set @n
120         *                                                                               The column index starts from @c 0.
121         * @param[in]            value                           The value to set
122         * @exception            E_SUCCESS                       The method is successful.
123         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
124         * @exception            E_TYPE_MISMATCH         The column type accessed by the operation do not match.
125         */
126         result SetIntAt(int columnIndex, int value);
127
128         /**
129         * Sets a @c long @c long value to the column with the specified index.
130         *
131         * @since                        2.1
132         *
133         * @return                       An error code
134         * @param[in]            columnIndex                     The index of the column whose value is set @n
135         *                                                                               The column index starts from @c 0.
136         * @param[in]            value                           The value to set
137         * @exception            E_SUCCESS                       The method is successful.
138         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
139         * @exception            E_TYPE_MISMATCH         The column type accessed by the method do not match.
140         */
141         result SetInt64At(int columnIndex, long long value);
142
143         /**
144         * Sets a Tizen::Base::String value to the column with the specified index.
145         *
146         * @since                2.1
147         *
148         * @return               An error code
149         * @param[in]            columnIndex                     The index of the column whose value is set @n
150         *                                                                               The column index starts from @c 0.
151         * @param[in]            value                           The value to set
152         * @exception            E_SUCCESS                       The method is successful.
153         * @exception            E_INVALID_ARG           The specified @c columnIndex is out of range.
154         * @exception            E_TYPE_MISMATCH         The column type accessed by the method do not match.
155         */
156         result SetStringAt(int columnIndex, const Tizen::Base::String& value);
157
158 private:
159         //
160         // This default constructor is intentionally declared as private so that only the platform can create an instance.
161         //
162         // @since       2.1
163         //
164         DataRow(void);
165
166         //
167         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
168         //
169         // @since       2.1
170         //
171         DataRow(const DataRow& rhs);
172
173         //
174         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
175         //
176         // @since       2.1
177         //
178         DataRow& operator =(const DataRow& rhs);
179
180         class _DataRowImpl* __pDataRowImpl;
181         friend class _DataRowImpl;
182
183 }; // DataRow
184
185 }} // Tizen::Io
186
187 #endif // _FIO_DATA_ROW_H_