--- parser3/src/main/pa_sql_driver_manager.C 2003/01/29 12:02:24 1.69.2.7 +++ parser3/src/main/pa_sql_driver_manager.C 2003/01/31 12:34:37 1.69.2.9 @@ -1,11 +1,11 @@ /** @file Parser: sql driver manager implementation. - Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_SQL_DRIVER_MANAGER_C="$Date: 2003/01/29 12:02:24 $"; +static const char* IDENT_SQL_DRIVER_MANAGER_C="$Date: 2003/01/31 12:34:37 $"; #include "pa_sql_driver_manager.h" #include "ltdl.h" @@ -28,7 +28,7 @@ const time_t CHECK_EXPIRED_CONNECTIONS_S // helpers -ConstStringPtr SQL_Driver_services_impl::url_without_login() const { +StringPtr SQL_Driver_services_impl::url_without_login() const { StringPtr result(new String); *result << furl->mid(0, furl->pos(":")) << "://****"; @@ -58,7 +58,7 @@ static void expire_connections( SQL_Driver_manager::SQL_Driver_manager(): prev_expiration_pass_time(0) { - cache_managers.put(ConstStringPtr(new String("sql")), this); + cache_managers.put(StringPtr(new String("sql")), this); } SQL_Driver_manager::~SQL_Driver_manager() { @@ -66,8 +66,8 @@ SQL_Driver_manager::~SQL_Driver_manager( } /// @param aurl protocol://[driver-dependent] -SQL_ConnectionPtr SQL_Driver_manager::get_connection(Pool& apool, ConstStringPtr arequest_url, - ConstStringPtr aorigin, +SQL_ConnectionPtr SQL_Driver_manager::get_connection(Pool& apool, StringPtr arequest_url, + StringPtr aorigin, Table *protocol2driver_and_client) { // we have table for locating protocol's library if(!protocol2driver_and_client) @@ -109,8 +109,8 @@ SQL_ConnectionPtr SQL_Driver_manager::ge // first trying to get cached driver if(!(driver=get_driver_from_cache(global_protocol))) { // no cached - ConstStringPtr library(0); - ConstStringPtr dlopen_file_spec(0); + StringPtr library(0); + StringPtr dlopen_file_spec(0); if(protocol2driver_and_client->locate(0, global_protocol)) { if(!(library=protocol2driver_and_client->item(1)) || library->size()==0) throw Exception("parser.runtime", @@ -129,7 +129,7 @@ SQL_ConnectionPtr SQL_Driver_manager::ge library, "prepare to dynamic loading failed, %s", lt_dlerror()); - const char *filename=library->cstr(String::UL_FILE_SPEC); + const char* filename=library->cstr(String::UL_FILE_SPEC); lt_dlhandle handle=lt_dlopen(filename); if (!handle) throw Exception(0, @@ -158,7 +158,7 @@ SQL_ConnectionPtr SQL_Driver_manager::ge CharPtr dlopen_file_spec_cstr= dlopen_file_spec && dlopen_file_spec->size()? dlopen_file_spec->cstr(String::UL_AS_IS):CharPtrZero; - if(const char *error=driver->initialize( + if(const char* error=driver->initialize( dlopen_file_spec_cstr)) throw Exception(0, library, @@ -256,7 +256,7 @@ static void add_connection_to_status_cac row+=&url_without_login(pool, connection.get_url()); // time time_t time_used=connection.get_time_used(); - const char *unsafe_time_cstr=ctime(&time_used); + const char* unsafe_time_cstr=ctime(&time_used); int time_buf_size=strlen(unsafe_time_cstr); char *safe_time_buf=(char *)pool.malloc(time_buf_size); memcpy(safe_time_buf, unsafe_time_cstr, time_buf_size); @@ -272,7 +272,7 @@ static void add_connections_to_status_ca add_connection_to_status_cache_table(iter.next(), info); }*/ /// @todo convert to object_ptr -ValuePtr SQL_Driver_manager::get_status(Pool& pool, ConstStringPtr source) { +ValuePtr SQL_Driver_manager::get_status(Pool& pool, StringPtr source) { ValuePtr result(new VHash); /* // cache