-
Notifications
You must be signed in to change notification settings - Fork 20
/
value.hpp
57 lines (43 loc) · 972 Bytes
/
value.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// (c) 2013, 2014 Stephan Hohe
#if !defined(SQXX_VALUE_HPP_INCLUDED)
#define SQXX_VALUE_HPP_INCLUDED
#include "datatypes.hpp"
typedef struct Mem sqlite3_value;
namespace sqxx {
/** struct sqlite3_value */
class value {
private:
sqlite3_value *handle;
public:
value(sqlite3_value *handle_arg);
/**
* Checks if the value is NULL
*/
bool null() const;
/**
* Access the value as a certain type
*
* Wraps [`sqlite3_value_*()`](http://www.sqlite.org/c3ref/value_blob.html)
*/
template<typename T>
if_sqxx_db_type<T, T>
val() const;
/**
* Implicit conversions for the contained value.
*
* Like `val<>()`.
*/
operator int() const;
operator int64_t() const;
operator double() const;
operator const char*() const;
operator std::string() const;
operator blob() const;
/**
* Access to the underlying raw `sqlite3_value*`
*/
sqlite3_value* raw();
};
} // namespace sqxx
#include "value.impl.hpp"
#endif // SQXX_VALUE_HPP_INCLUDED