-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathblob.hpp
45 lines (32 loc) · 1.01 KB
/
blob.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
// (c) 2013 Stephan Hohe
#if !defined(SQXX_BLOB_HPP_INCLUDED)
#define SQXX_BLOB_HPP_INCLUDED
#include <iosfwd>
#include <boost/iostreams/traits.hpp>
#include <boost/iostreams/categories.hpp>
#include <boost/iostreams/positioning.hpp>
struct sqlite3_blob;
namespace sqxx {
/** A boost iostreams source for blobs */
class blob_source {
private:
sqlite3_blob *handle;
int pos;
int len;
blob_source(sqlite3_blob *handle_arg);
friend class connection;
public:
blob_source(const blob_source&) = delete;
blob_source& operator=(const blob_source&) = delete;
blob_source(blob_source&&) = default;
blob_source& operator=(blob_source&&) = default;
typedef char char_type;
struct category : boost::iostreams::seekable, boost::iostreams::closable_tag {
};
std::streamsize read(char *s, std::streamsize n);
std::streamsize write(const char *s, std::streamsize n);
std::streampos seek(boost::iostreams::stream_offset off, std::ios_base::seekdir way);
void close();
};
} // namespace sqxx
#endif // SQXX_BLOB_HPP_INCLUDED