From cadf2251ea3fa4f651726223e5426703f9a94a62 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 31 Dec 2016 04:59:00 +0000 Subject: Do lots more work with compile time formatter instead runtime formatters --- libodbcpp/odbc-mock.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libodbcpp/odbc-mock.cpp') diff --git a/libodbcpp/odbc-mock.cpp b/libodbcpp/odbc-mock.cpp index 2799fb3..0ab6ee6 100644 --- a/libodbcpp/odbc-mock.cpp +++ b/libodbcpp/odbc-mock.cpp @@ -1,6 +1,6 @@ #include "odbc-connection.h" #include "odbc-mock.h" -#include +#include namespace ODBC { @@ -12,10 +12,11 @@ Mock::Mock(const std::string & b, const std::string & masterdb, const std::strin PlaySchemaScripts(ss); } +AdHocFormatter(MockConnStr, "%?;Database=%?"); DB::Connection * Mock::openConnection() const { - return new Connection(stringbf("%s;Database=%s", base, testDbName)); + return new Connection(MockConnStr::get(base, testDbName)); } Mock::~Mock() -- cgit v1.2.3