|
15 | 15 |
|
16 | 16 | #include <string> |
17 | 17 | #include <map> |
18 | | -#include <climits> // For INT_MAX |
19 | 18 |
|
20 | 19 | // Forward declarations to avoid inclusion of <sqlite3.h> in a header |
21 | 20 | struct sqlite3; |
@@ -128,34 +127,15 @@ class Statement |
128 | 127 | /** |
129 | 128 | * @brief Bind an int value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
130 | 129 | */ |
131 | | - void bind(const int aIndex, const int aValue); |
| 130 | + void bind(const int aIndex, const int32_t aValue); |
132 | 131 | /** |
133 | 132 | * @brief Bind a 32bits unsigned int value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
134 | 133 | */ |
135 | | - void bind(const int aIndex, const unsigned aValue); |
136 | | - |
137 | | -#if (LONG_MAX == INT_MAX) // 4 bytes "long" type means the data model is ILP32 or LLP64 (Win64 Visual C++ and MinGW) |
138 | | - /** |
139 | | - * @brief Bind a 32bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
140 | | - */ |
141 | | - void bind(const int aIndex, const long aValue) |
142 | | - { |
143 | | - bind(aIndex, static_cast<int>(aValue)); |
144 | | - } |
145 | | -#else // 8 bytes "long" type means the data model is LP64 (Most Unix-like, Windows when using Cygwin; z/OS) |
146 | | - /** |
147 | | - * @brief Bind a 64bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
148 | | - */ |
149 | | - void bind(const int aIndex, const long aValue) |
150 | | - { |
151 | | - bind(aIndex, static_cast<long long>(aValue)); |
152 | | - } |
153 | | -#endif |
154 | | - |
| 134 | + void bind(const int aIndex, const uint32_t aValue); |
155 | 135 | /** |
156 | 136 | * @brief Bind a 64bits int value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
157 | 137 | */ |
158 | | - void bind(const int aIndex, const long long aValue); |
| 138 | + void bind(const int aIndex, const int64_t aValue); |
159 | 139 | /** |
160 | 140 | * @brief Bind a double (64bits float) value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
161 | 141 | */ |
@@ -210,39 +190,21 @@ class Statement |
210 | 190 | /** |
211 | 191 | * @brief Bind an int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
212 | 192 | */ |
213 | | - void bind(const char* apName, const int aValue) |
| 193 | + void bind(const char* apName, const int32_t aValue) |
214 | 194 | { |
215 | 195 | bind(getIndex(apName), aValue); |
216 | 196 | } |
217 | 197 | /** |
218 | 198 | * @brief Bind a 32bits unsigned int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
219 | 199 | */ |
220 | | - void bind(const char* apName, const unsigned aValue) |
| 200 | + void bind(const char* apName, const uint32_t aValue) |
221 | 201 | { |
222 | 202 | bind(getIndex(apName), aValue); |
223 | 203 | } |
224 | | - |
225 | | -#if (LONG_MAX == INT_MAX) // 4 bytes "long" type means the data model is ILP32 or LLP64 (Win64 Visual C++ and MinGW) |
226 | | - /** |
227 | | - * @brief Bind a 32bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
228 | | - */ |
229 | | - void bind(const char* apName, const long aValue) |
230 | | - { |
231 | | - bind(apName, static_cast<int>(aValue)); |
232 | | - } |
233 | | -#else // 8 bytes "long" type means the data model is LP64 (Most Unix-like, Windows when using Cygwin; z/OS) |
234 | | - /** |
235 | | - * @brief Bind a 64bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
236 | | - */ |
237 | | - void bind(const char* apName, const long aValue) |
238 | | - { |
239 | | - bind(apName, static_cast<long long>(aValue)); |
240 | | - } |
241 | | -#endif |
242 | 204 | /** |
243 | 205 | * @brief Bind a 64bits int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
244 | 206 | */ |
245 | | - void bind(const char* apName, const long long aValue) |
| 207 | + void bind(const char* apName, const int64_t aValue) |
246 | 208 | { |
247 | 209 | bind(getIndex(apName), aValue); |
248 | 210 | } |
@@ -325,46 +287,28 @@ class Statement |
325 | 287 | /** |
326 | 288 | * @brief Bind an int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
327 | 289 | */ |
328 | | - void bind(const std::string& aName, const int aValue) |
| 290 | + void bind(const std::string& aName, const int32_t aValue) |
329 | 291 | { |
330 | 292 | bind(aName.c_str(), aValue); |
331 | 293 | } |
332 | 294 | /** |
333 | 295 | * @brief Bind a 32bits unsigned int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
334 | 296 | */ |
335 | | - void bind(const std::string& aName, const unsigned aValue) |
| 297 | + void bind(const std::string& aName, const uint32_t aValue) |
336 | 298 | { |
337 | 299 | bind(aName.c_str(), aValue); |
338 | 300 | } |
339 | | - |
340 | | -#if (LONG_MAX == INT_MAX) // 4 bytes "long" type means the data model is ILP32 or LLP64 (Win64 Visual C++ and MinGW) |
341 | | - /** |
342 | | - * @brief Bind a 32bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
343 | | - */ |
344 | | - void bind(const std::string& aName, const long aValue) |
345 | | - { |
346 | | - bind(aName.c_str(), static_cast<int>(aValue)); |
347 | | - } |
348 | | -#else // 8 bytes "long" type means the data model is LP64 (Most Unix-like, Windows when using Cygwin; z/OS) |
349 | | - /** |
350 | | - * @brief Bind a 64bits long value to a parameter "?", "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
351 | | - */ |
352 | | - void bind(const std::string& aName, const long aValue) |
353 | | - { |
354 | | - bind(aName.c_str(), static_cast<long long>(aValue)); |
355 | | - } |
356 | | -#endif |
357 | 301 | /** |
358 | 302 | * @brief Bind a 64bits int value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
359 | 303 | */ |
360 | | - void bind(const std::string& aName, const long long aValue) |
| 304 | + void bind(const std::string& aName, const int64_t aValue) |
361 | 305 | { |
362 | 306 | bind(aName.c_str(), aValue); |
363 | 307 | } |
364 | 308 | /** |
365 | 309 | * @brief Bind a double (64bits float) value to a named parameter "?NNN", ":VVV", "@VVV" or "$VVV" in the SQL prepared statement (aIndex >= 1) |
366 | 310 | */ |
367 | | - void bind(const std::string& aName, const double aValue) |
| 311 | + void bind(const std::string& aName, const double aValue) |
368 | 312 | { |
369 | 313 | bind(aName.c_str(), aValue); |
370 | 314 | } |
|
0 commit comments