]> git.stg.codes - stg.git/blobdiff - projects/stargazer/plugins/store/postgresql/postgresql_store_corporations.cpp
Merge branch 'stg-2.409-radius'
[stg.git] / projects / stargazer / plugins / store / postgresql / postgresql_store_corporations.cpp
index 08848ea49cb26b0e946bbcead31569c1dcde59a8..84fab02b3ff2d0a7a015aa55fd3dada650a70904 100644 (file)
 #include <libpq-fe.h>
 
 #include "postgresql_store.h"
-#include "stg/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());