WIP: remove the old database abstraction layer

remove such classes:
- DbBase
- DbConn
- DbTextStream
- Db

while here:
- remove: TextStream, SLog, TexTextStream
This commit is contained in:
2024-06-22 18:03:54 +02:00
parent 5d457f3d4b
commit 6aa100f12c
138 changed files with 6658 additions and 12402 deletions

View File

@@ -5,7 +5,7 @@
*/
/*
* Copyright (c) 2008-2023, Tomasz Sowa
* Copyright (c) 2008-2024, Tomasz Sowa
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -65,7 +65,6 @@ Plugin::Plugin()
{
current_plugin = -1;
db = nullptr;
cur = nullptr;
system = nullptr;
functions = nullptr;
@@ -83,12 +82,6 @@ Plugin::~Plugin()
}
void Plugin::SetDb(Db * pdb)
{
db = pdb;
}
void Plugin::SetSystem(System * psystem)
{
system = psystem;
@@ -145,14 +138,13 @@ void Plugin::Unlock()
bool Plugin::SetDependencyForPluginInfo(morm::ModelConnector * pmodel_connector, Log * plog, Cur * pcur, PluginInfo & info)
{
// for safety we call a plugin function only when all our pointers are not null
bool res = (pmodel_connector && plog && pcur && db && config && system && functions && templates && synchro && session_manager && winix_request);
bool res = (pmodel_connector && plog && pcur && config && system && functions && templates && synchro && session_manager && winix_request);
if( !res )
{
log << log1 << "Plugin: cannot call a function - some of the winix pointers are null" << logend;
}
info.db = db;
info.config = config;
info.cur = pcur;
info.system = system;
@@ -198,8 +190,8 @@ void * Plugin::LoadInitFun(const wchar_t * filename, Fun1 & fun_init)
{
char file[WINIX_OS_PATH_SIZE];
if( !wide_to_utf8(filename, file, WINIX_OS_PATH_SIZE) )
return 0;
if( !pt::wide_to_utf8(filename, (char*)file, WINIX_OS_PATH_SIZE) )
return nullptr;
void * p = dlopen(file, RTLD_NOW | RTLD_LOCAL);
@@ -207,7 +199,7 @@ char file[WINIX_OS_PATH_SIZE];
{
log << log1 << "Plugin: cannot load a plugin: \"" << filename << "\"" << logend;
log << log1 << "Plugin: dlerror: " << dlerror() << logend;
return 0;
return nullptr;
}
fun_init = (Fun1)dlsym(p, "Init");
@@ -218,14 +210,14 @@ char file[WINIX_OS_PATH_SIZE];
<< " (there is no Init() function)" << logend;
dlclose(p);
return 0;
return nullptr;
}
log << log2 << "Plugin: plugin loaded"
<< ", file: " << filename
<< ", index: " << plugins.size() << logend;
return p;
return p;
}