*/
#include "firebird_store.h"
-#include "ibpp.h"
+
+#include "stg/ibpp.h"
+#include "stg/corp_conf.h"
+#include "stg/common.h"
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::GetCorpsList(vector<string> * corpsList) const
+int FIREBIRD_STORE::GetCorpsList(std::vector<std::string> * corpsList) const
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
-string name;
-
try
{
tr->Start();
st->Execute("select name from tb_corporations");
while (st->Fetch())
{
+ std::string name;
st->Get(1, name);
corpsList->push_back(name);
}
return 0;
}
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::SaveCorp(const CORP_CONF & cc) const
+int FIREBIRD_STORE::SaveCorp(const STG::CorpConf & cc) const
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
return 0;
}
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::RestoreCorp(CORP_CONF * cc, const string & name) const
+int FIREBIRD_STORE::RestoreCorp(STG::CorpConf * cc, const std::string & name) const
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amRead, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
return 0;
}
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::AddCorp(const string & name) const
+int FIREBIRD_STORE::AddCorp(const std::string & name) const
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);
return 0;
}
//-----------------------------------------------------------------------------
-int FIREBIRD_STORE::DelCorp(const string & name) const
+int FIREBIRD_STORE::DelCorp(const std::string & name) const
{
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
IBPP::Transaction tr = IBPP::TransactionFactory(db, IBPP::amWrite, til, tlr);
IBPP::Statement st = IBPP::StatementFactory(db, tr);