diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-10 12:12:06 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2012-09-10 12:12:06 +0200 |
commit | 32fcd732e2535090174142dd15b8b74fc444a9c2 (patch) | |
tree | 0d869cf45f1282cc1ac04e0d8171410d59d16a1f /sqlite/types/driver.cxx | |
parent | 4e7f517a711d9b6e95512cad1891710bcd591034 (diff) |
Add support for alternative UTF-16 image for TEXT in SQLite
Use it to handle QString and support std::wstring on Windows.
Diffstat (limited to 'sqlite/types/driver.cxx')
-rw-r--r-- | sqlite/types/driver.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/sqlite/types/driver.cxx b/sqlite/types/driver.cxx index 1214d18..ac8c8d4 100644 --- a/sqlite/types/driver.cxx +++ b/sqlite/types/driver.cxx @@ -39,6 +39,9 @@ main (int argc, char* argv[]) string long_str (2040, 'l'); o.text_ = long_str; +#ifdef _WIN32 + o.wtext_ = L"t\x00C8st string"; +#endif o.blob_.assign (long_str.c_str (), long_str.c_str () + long_str.size ()); { @@ -47,8 +50,6 @@ main (int argc, char* argv[]) t.commit (); } - // - // { transaction t (db->begin ()); auto_ptr<object> o1 (db->load<object> (1)); @@ -56,6 +57,18 @@ main (int argc, char* argv[]) assert (o == *o1); } + + typedef odb::query<object> query; + typedef odb::result<object> result; + +#ifdef _WIN32 + { + transaction t (db->begin ()); + result r (db->query<object> (query::wtext == L"t\x00C8st string")); + assert (!r.empty ()); + t.commit (); + } +#endif } catch (const odb::exception& e) { |