]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp
Fix email.
[stg.git] / projects / stargazer / plugins / store / postgresql / postgresql_store_corporations.cpp
index 6fa3fd500f74ca594bfe5246af74383c4fd21c52..379279248934138a4af5fd81af7b56918ecc11a1 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 /*
- *    Author : Maxim Mamontov <faust@stargazer.dp.ua>
+ *    Author : Maksym Mamontov <stg@madf.info>
  */
 
 /*
 #include <libpq-fe.h>
 
 #include "postgresql_store.h"
-#include "stg_locker.h"
+#include "stg/locker.h"
 
 //-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::GetCorpsList(vector<string> * corpsList) const
+int POSTGRESQL_STORE::GetCorpsList(std::vector<std::string> * corpsList) const
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (PQstatus(connection) != CONNECTION_OK)
     {
@@ -94,7 +94,7 @@ return 0;
 //-----------------------------------------------------------------------------
 int POSTGRESQL_STORE::SaveCorp(const CORP_CONF & cc) const
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (PQstatus(connection) != CONNECTION_OK)
     {
@@ -127,7 +127,7 @@ if (EscapeString(ename))
     return -1;
     }
 
-std::stringstream query;
+std::ostringstream query;
 query << "UPDATE tb_corporations SET "
           << "cash = " << cc.cash
       << "WHERE name = '" << ename << "'";
@@ -158,9 +158,9 @@ return 0;
 }
 
 //-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::RestoreCorp(CORP_CONF * cc, const string & name) const
+int POSTGRESQL_STORE::RestoreCorp(CORP_CONF * cc, const std::string & name) const
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (PQstatus(connection) != CONNECTION_OK)
     {
@@ -193,7 +193,7 @@ if (EscapeString(ename))
     return -1;
     }
 
-std::stringstream query;
+std::ostringstream query;
 query << "SELECT cash FROM tb_corporations WHERE name = '" << ename << "'";
 
 result = PQexec(connection, query.str().c_str());
@@ -241,9 +241,9 @@ return 0;
 }
 
 //-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::AddCorp(const string & name) const
+int POSTGRESQL_STORE::AddCorp(const std::string & name) const
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (PQstatus(connection) != CONNECTION_OK)
     {
@@ -276,7 +276,7 @@ if (EscapeString(ename))
     return -1;
     }
 
-std::stringstream query;
+std::ostringstream query;
 query << "INSERT INTO tb_corporations \
               (name, cash) \
           VALUES \
@@ -308,9 +308,9 @@ return 0;
 }
 
 //-----------------------------------------------------------------------------
-int POSTGRESQL_STORE::DelCorp(const string & name) const
+int POSTGRESQL_STORE::DelCorp(const std::string & name) const
 {
-STG_LOCKER lock(&mutex, __FILE__, __LINE__);
+STG_LOCKER lock(&mutex);
 
 if (PQstatus(connection) != CONNECTION_OK)
     {
@@ -343,7 +343,7 @@ if (EscapeString(ename))
     return -1;
     }
 
-std::stringstream query;
+std::ostringstream query;
 query << "DELETE FROM tb_corporations WHERE name = '" << ename << "'";
 
 result = PQexec(connection, query.str().c_str());