aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2012-09-07 13:58:47 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2012-09-07 13:58:47 +0200
commit670ecc61d85bc800e75a41cfe7349de46f3acf59 (patch)
tree6680b67f7bca4f40f234fb13707f86e8ff8a2f55
parent62106fba0abbb890833778036406cac345d5ca20 (diff)
Add support for passing database name as std::wstring on Windows
-rw-r--r--NEWS6
-rw-r--r--doc/manual.xhtml18
2 files changed, 19 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 5dc913d..e33c5a0 100644
--- a/NEWS
+++ b/NEWS
@@ -53,8 +53,10 @@ Version 2.1.0
more information, refer to Section 20.1, "Basic Types" in the ODB manual
as well as the 'qt' example in the odb-examples package.
- * SQLite improvements: Ability to specify the virtual filesystem (vfs) module
- in the database constructor (Section 14.2, "SQLite Database Class").
+ * SQLite improvements: Ability to specify the virtual filesystem (vfs)
+ module in the database constructor (Section 14.2, "SQLite Database
+ Class"). Ability to pass database name as std::wstring on Windows
+ (Section 14.2, "SQLite Database Class").
* The id() pragma that was used to declare a persistent class without an
object id has been renamed to no_id.
diff --git a/doc/manual.xhtml b/doc/manual.xhtml
index 26d9d38..a9be249 100644
--- a/doc/manual.xhtml
+++ b/doc/manual.xhtml
@@ -13985,6 +13985,14 @@ namespace odb
const std::string&amp; vfs = "",
std::[auto|unique]_ptr&lt;connection_factory> = 0);
+#ifdef _WIN32
+ database (const std::wstring&amp; name,
+ int flags = SQLITE_OPEN_READWRITE,
+ bool foreign_keys = true,
+ const std::string&amp; vfs = "",
+ std::[auto|unique]_ptr&lt;connection_factory> = 0);
+#endif
+
database (int&amp; argc,
char* argv[],
bool erase = false,
@@ -14049,7 +14057,11 @@ auto_ptr&lt;odb::database> db (
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE));
</pre>
- <p>The second constructor extracts the database parameters from the
+ <p>The second constructor is the same as the first except that the database
+ name is passes as <code>std::wstring</code>. This constructor is only
+ available when compiling for Windows.</p>
+
+ <p>The third constructor extracts the database parameters from the
command line. The following options are recognized:</p>
<pre class="terminal">
@@ -14081,13 +14093,13 @@ auto_ptr&lt;odb::database> db (
the first constructor. Flags from the command line always override
the corresponding values specified with this argument.</p>
- <p>The second constructor throws the <code>odb::sqlite::cli_exception</code>
+ <p>The third constructor throws the <code>odb::sqlite::cli_exception</code>
exception if the SQLite option values are missing or invalid.
See <a href="#14.4">Section 14.4, "SQLite Exceptions"</a>
for more information on this exception.</p>
<p>The static <code>print_usage()</code> function prints the list of options
- with short descriptions that are recognized by the second constructor.</p>
+ with short descriptions that are recognized by the third constructor.</p>
<p>The last argument to all of the constructors is a pointer to the
connection factory. In C++98, it is <code>std::auto_ptr</code> while