From 670ecc61d85bc800e75a41cfe7349de46f3acf59 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 7 Sep 2012 13:58:47 +0200 Subject: Add support for passing database name as std::wstring on Windows --- doc/manual.xhtml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'doc') 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& vfs = "", std::[auto|unique]_ptr<connection_factory> = 0); +#ifdef _WIN32 + database (const std::wstring& name, + int flags = SQLITE_OPEN_READWRITE, + bool foreign_keys = true, + const std::string& vfs = "", + std::[auto|unique]_ptr<connection_factory> = 0); +#endif + database (int& argc, char* argv[], bool erase = false, @@ -14049,7 +14057,11 @@ auto_ptr<odb::database> db ( SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE)); -

The second constructor extracts the database parameters from the +

The second constructor is the same as the first except that the database + name is passes as std::wstring. This constructor is only + available when compiling for Windows.

+ +

The third constructor extracts the database parameters from the command line. The following options are recognized:

@@ -14081,13 +14093,13 @@ auto_ptr<odb::database> db (
      the first constructor. Flags from the command line always override
      the corresponding values specified with this argument.

-

The second constructor throws the odb::sqlite::cli_exception +

The third constructor throws the odb::sqlite::cli_exception exception if the SQLite option values are missing or invalid. See Section 14.4, "SQLite Exceptions" for more information on this exception.

The static print_usage() function prints the list of options - with short descriptions that are recognized by the second constructor.

+ with short descriptions that are recognized by the third constructor.

The last argument to all of the constructors is a pointer to the connection factory. In C++98, it is std::auto_ptr while -- cgit v1.1