From 4a250a49537bf223b3665c0f5a017944531b3dfe Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 18 Feb 2011 10:42:41 +0200 Subject: Add odb::core namespace to be used in using-directives Port all the examples and tests. --- libcommon/common/common.cxx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'libcommon/common') diff --git a/libcommon/common/common.cxx b/libcommon/common/common.cxx index d451c4b..bffc0fc 100644 --- a/libcommon/common/common.cxx +++ b/libcommon/common/common.cxx @@ -18,9 +18,12 @@ #include using namespace std; -using namespace odb; -auto_ptr +#if defined(DATABASE_MYSQL) +using namespace odb::mysql; +#endif + +auto_ptr create_database (int& argc, char* argv[], size_t max_connections) { if (argc > 1 && argv[1] == string ("--help")) @@ -28,19 +31,16 @@ create_database (int& argc, char* argv[], size_t max_connections) cerr << "Usage: " << argv[0] << " [options]" << endl << "Options:" << endl; -#if defined(DATABASE_MYSQL) - mysql::database::print_usage (cerr); -#endif - + database::print_usage (cerr); exit (0); } #if defined(DATABASE_MYSQL) - auto_ptr f; + auto_ptr f; if (max_connections != 0) - f.reset (new mysql::connection_pool_factory (max_connections)); + f.reset (new connection_pool_factory (max_connections)); - return auto_ptr (new mysql::database (argc, argv, false, 0, f)); + return auto_ptr (new database (argc, argv, false, 0, f)); #endif } -- cgit v1.1