@@ -212,7 +212,7 @@ std::string WsjcppStorageChanges::getTableName() const {
212212// ---------------------------------------------------------------------
213213
214214WsjcppStorageChangesType WsjcppStorageChanges::getType () const {
215- return WsjcppStorageChangesType::NOPE ;
215+ return WSJCPP_STORAGE_CHANGES_TYPE_NOPE ;
216216}
217217
218218// ---------------------------------------------------------------------
@@ -248,7 +248,7 @@ WsjcppStorageCreateTable::WsjcppStorageCreateTable(const std::string &sTableName
248248// ---------------------------------------------------------------------
249249
250250WsjcppStorageChangesType WsjcppStorageCreateTable::getType () const {
251- return WsjcppStorageChangesType::CREATE_TABLE ;
251+ return WSJCPP_STORAGE_CHANGES_TYPE_CREATE_TABLE ;
252252};
253253
254254// ---------------------------------------------------------------------
@@ -303,7 +303,7 @@ WsjcppStorageModifyTable::WsjcppStorageModifyTable(const std::string &sTableName
303303// ---------------------------------------------------------------------
304304
305305WsjcppStorageChangesType WsjcppStorageModifyTable::getType () const {
306- return WsjcppStorageChangesType::MODIFY_TABLE ;
306+ return WSJCPP_STORAGE_CHANGES_TYPE_MODIFY_TABLE ;
307307};
308308
309309// ---------------------------------------------------------------------
@@ -417,7 +417,7 @@ WsjcppStorageDropTable::WsjcppStorageDropTable(const std::string &sTableName)
417417// ---------------------------------------------------------------------
418418
419419WsjcppStorageChangesType WsjcppStorageDropTable::getType () const {
420- return WsjcppStorageChangesType::DROP_TABLE ;
420+ return WSJCPP_STORAGE_CHANGES_TYPE_DROP_TABLE ;
421421};
422422
423423// ---------------------------------------------------------------------
@@ -512,7 +512,7 @@ WsjcppStorageInsert::WsjcppStorageInsert(const std::string &sTableName)
512512// ---------------------------------------------------------------------
513513
514514WsjcppStorageChangesType WsjcppStorageInsert::getType () const {
515- return WsjcppStorageChangesType::INSERT_ROW ;
515+ return WSJCPP_STORAGE_CHANGES_TYPE_INSERT_ROW ;
516516};
517517
518518// ---------------------------------------------------------------------
@@ -540,7 +540,7 @@ void WsjcppStorageInsert::bindValue(const std::string &sColumnName, const std::s
540540 WsjcppLog::throw_err (TAG, " Skip. Already defined " + m_sTableName + " ." + sColumnName );
541541 return ;
542542 }
543- WsjcppStorageColumnValue val (sColumnName , WsjcppStorageColumnType::STRING );
543+ WsjcppStorageColumnValue val (sColumnName , WSJCPP_STORAGE_COLUMN_TYPE_STRING );
544544 val.setValue (sValue );
545545 m_vValues.push_back (val);
546546}
@@ -552,7 +552,7 @@ void WsjcppStorageInsert::bindValue(const std::string &sColumnName, int nValue)
552552 WsjcppLog::throw_err (TAG, " Skip. Already defined " + m_sTableName + " ." + sColumnName );
553553 return ;
554554 }
555- WsjcppStorageColumnValue val (sColumnName , WsjcppStorageColumnType::NUMBER );
555+ WsjcppStorageColumnValue val (sColumnName , WSJCPP_STORAGE_COLUMN_TYPE_NUMBER );
556556 val.setValue (nValue);
557557 m_vValues.push_back (val);
558558}
@@ -564,7 +564,7 @@ void WsjcppStorageInsert::bindValue(const std::string &sColumnName, double nValu
564564 WsjcppLog::throw_err (TAG, " Skip. Already defined " + m_sTableName + " ." + sColumnName );
565565 return ;
566566 }
567- WsjcppStorageColumnValue val (sColumnName , WsjcppStorageColumnType::DOUBLE_NUMBER );
567+ WsjcppStorageColumnValue val (sColumnName , WSJCPP_STORAGE_COLUMN_TYPE_DOUBLE_NUMBER );
568568 val.setValue (nValue);
569569 m_vValues.push_back (val);
570570}
@@ -604,14 +604,14 @@ bool WsjcppStorageInsert::isValid(const WsjcppStorageTable &storageTable) const
604604 for (int y = 0 ; y < vColumns.size (); y++) {
605605 WsjcppStorageColumnDef st = vColumns[y];
606606 if (st.columnName () == val.getColumnName ()) {
607- if (val.getColumnType () == WsjcppStorageColumnType::STRING
607+ if (val.getColumnType () == WSJCPP_STORAGE_COLUMN_TYPE_STRING
608608 && (st.columnType () == " string" || st.columnType () == " datetime" || st.columnType () == " text" )) {
609609 bFound = true ;
610610 break ;
611- } else if (val.getColumnType () == WsjcppStorageColumnType::NUMBER && st.columnType () == " number" ) {
611+ } else if (val.getColumnType () == WSJCPP_STORAGE_COLUMN_TYPE_NUMBER && st.columnType () == " number" ) {
612612 bFound = true ;
613613 break ;
614- } else if (val.getColumnType () == WsjcppStorageColumnType::DOUBLE_NUMBER && st.columnType () == " doubleNumber" ) {
614+ } else if (val.getColumnType () == WSJCPP_STORAGE_COLUMN_TYPE_DOUBLE_NUMBER && st.columnType () == " doubleNumber" ) {
615615 bFound = true ;
616616 break ;
617617 } else {
@@ -800,25 +800,25 @@ bool WsjcppStorage::addStorageChanges(WsjcppStorageChanges &storageChanges) {
800800 std::string sTableName = storageChanges.getTableName ();
801801 std::map<std::string, WsjcppStorageTable>::iterator it = m_mapTables.find (sTableName );
802802
803- if (storageChanges.getType () == WsjcppStorageChangesType::CREATE_TABLE ) {
803+ if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_CREATE_TABLE ) {
804804 if (it != m_mapTables.end ()) {
805805 WsjcppLog::err (TAG, " Table '" + sTableName + " ' already defined" );
806806 WsjcppLog::warn (TAG, " TODO need drop table" );
807807 return false ;
808808 }
809809 WsjcppStorageTable tbl ((WsjcppStorageCreateTable &)storageChanges);
810810 m_mapTables.insert (std::pair<std::string,WsjcppStorageTable>(sTableName ,tbl) );
811- } else if (storageChanges.getType () == WsjcppStorageChangesType::DROP_TABLE ) {
811+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_DROP_TABLE ) {
812812 if (it == m_mapTables.end ()) {
813813 WsjcppLog::throw_err (TAG, " Not found table '" + sTableName + " '" );
814814 }
815815 m_mapTables.erase (sTableName );
816- } else if (storageChanges.getType () == WsjcppStorageChangesType::MODIFY_TABLE ) {
816+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_MODIFY_TABLE ) {
817817 if (it == m_mapTables.end ()) {
818818 WsjcppLog::throw_err (TAG, " Not found table '" + sTableName + " '" );
819819 }
820820 it->second .mergeWith ((WsjcppStorageModifyTable &)storageChanges);
821- } else if (storageChanges.getType () == WsjcppStorageChangesType::INSERT_ROW ) {
821+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_INSERT_ROW ) {
822822 // skip
823823 } else {
824824 WsjcppLog::throw_err (TAG, " addStorageChanges, Unknown operation with table" );
@@ -832,16 +832,16 @@ bool WsjcppStorage::executeStorageChanges(WsjcppStorageConnection *pConn, Wsjcpp
832832 std::string sTableName = storageChanges.getTableName ();
833833 std::vector<std::string> vQueries;
834834
835- if (storageChanges.getType () == WsjcppStorageChangesType::CREATE_TABLE ) {
835+ if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_CREATE_TABLE ) {
836836 WsjcppStorageCreateTable createTable = (WsjcppStorageCreateTable &)storageChanges;
837837 vQueries = this ->prepareSqlQueries (createTable);
838- } else if (storageChanges.getType () == WsjcppStorageChangesType::MODIFY_TABLE ) {
838+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_MODIFY_TABLE ) {
839839 WsjcppStorageModifyTable modifyTable = (WsjcppStorageModifyTable &)storageChanges;
840840 vQueries = this ->prepareSqlQueries (modifyTable);
841- } else if (storageChanges.getType () == WsjcppStorageChangesType::DROP_TABLE ) {
841+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_DROP_TABLE ) {
842842 WsjcppStorageDropTable dropTable = (WsjcppStorageDropTable &)storageChanges;
843843 vQueries = this ->prepareSqlQueries (dropTable);
844- } else if (storageChanges.getType () == WsjcppStorageChangesType::INSERT_ROW ) {
844+ } else if (storageChanges.getType () == WSJCPP_STORAGE_CHANGES_TYPE_INSERT_ROW ) {
845845 WsjcppStorageInsert insRow = (WsjcppStorageInsert &)storageChanges;
846846 WsjcppStorageTable tableDef = getTableDef (insRow.getTableName ());
847847 if (!insRow.isValid (tableDef)) {
@@ -1294,8 +1294,8 @@ void WsjcppStorageUpdates::applyAllStorageChanges(WsjcppStorage *pStorage, Wsjcp
12941294 std::vector<WsjcppStorageChanges *> vStorageChanges = pUpdate->getChanges ();
12951295 for (int i = 0 ; i < vStorageChanges.size (); i++) {
12961296 WsjcppStorageChanges *pChanges = vStorageChanges[i];
1297- if (pChanges->getType () == WsjcppStorageChangesType::NOPE ) {
1298- WsjcppLog::throw_err (TAG, " Not allowed use a WsjcppStorageChangesType::NOPE " );
1297+ if (pChanges->getType () == WSJCPP_STORAGE_CHANGES_TYPE_NOPE ) {
1298+ WsjcppLog::throw_err (TAG, " Not allowed use a WSJCPP_STORAGE_CHANGES_TYPE_NOPE " );
12991299 }
13001300
13011301 if (!pStorage->addStorageChanges (*pChanges)) {
@@ -1314,8 +1314,8 @@ void WsjcppStorageUpdates::executeAllStorageChanges(WsjcppStorage *pStorage, Wsj
13141314 std::vector<WsjcppStorageChanges *> vStorageChanges = pUpdate->getChanges ();
13151315 for (int i = 0 ; i < vStorageChanges.size (); i++) {
13161316 WsjcppStorageChanges *pChanges = vStorageChanges[i];
1317- if (pChanges->getType () == WsjcppStorageChangesType::NOPE ) {
1318- WsjcppLog::throw_err (TAG, " Not allowed use a WsjcppStorageChangesType::NOPE " );
1317+ if (pChanges->getType () == WSJCPP_STORAGE_CHANGES_TYPE_NOPE ) {
1318+ WsjcppLog::throw_err (TAG, " Not allowed use a WSJCPP_STORAGE_CHANGES_TYPE_NOPE " );
13191319 }
13201320 if (!pStorage->executeStorageChanges (pConn, *pChanges)) {
13211321 WsjcppLog::throw_err (TAG, " Problem with table '" + pChanges->getTableName () + " ' in version " + pUpdate->version ());
0 commit comments