o2on svn commit
o2on-****@lists*****
2008年 7月 26日 (土) 17:46:46 JST
Revision: 109 http://svn.sourceforge.jp/cgi-bin/viewcvs.cgi?root=o2on&view=rev&rev=109 Author: k-uehara Date: 2008-07-26 17:46:46 +0900 (Sat, 26 Jul 2008) Log Message: ----------- CLEAN UP: 未使用メソッドを削除 Modified Paths: -------------- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:29:15 UTC (rev 108) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.cpp 2008-07-26 08:46:46 UTC (rev 109) @@ -1086,114 +1086,6 @@ -#if 0 -bool -O2DatDB:: -update(O2DatRec &in, bool is_origurl) -{ - sqlite3 *db = NULL; - sqlite3_stmt* stmt; - O2DatRec org; - - int err = sqlite3_open16(dbfilename.c_str(), &db); - if (err != SQLITE_OK) - goto error; - sqlite3_busy_timeout(db, 5000); - - if (select(org, in.hash)) { - wchar_t *sql = - L"update or replace dat" - L" set size = ?" - L" , disksize = ?" - L" , url = ?" - L" , res = ?" - L" , lastupdate = ?" - L" , lastpublish = 0" - L" where hash = ?;"; - - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!is_origurl) - in.url = org.url; - if (!bind(db, stmt, 1, in.size)) - goto error; - if (!bind(db, stmt, 2, in.disksize)) - goto error; - if (!bind(db, stmt, 3, in.url)) - goto error; - if (!bind(db, stmt, 4, in.res)) - goto error; - if (!bind(db, stmt, 5, time(NULL))) - goto error; - if (!bind(db, stmt, 6, in.hash)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - sqlite3_finalize(stmt); - stmt = NULL; - } - else { - wchar_t *sql = - L"insert or replace into dat (" - COLUMNS - L") values (" - L"?,?,?,?,?,?,?,?,?,?,?" - L");"; - - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!bind(db, stmt, 1, in.hash)) - goto error; - if (!bind(db, stmt, 2, in.domain)) - goto error; - if (!bind(db, stmt, 3, in.bbsname)) - goto error; - if (!bind(db, stmt, 4, in.datname)) - goto error; - if (!bind(db, stmt, 5, in.size)) - goto error; - if (!bind(db, stmt, 6, in.disksize)) - goto error; - if (!bind(db, stmt, 7, in.url)) - goto error; - if (!bind(db, stmt, 8, in.title)) - goto error; - if (!bind(db, stmt, 9, in.res)) - goto error; - if (!bind(db, stmt, 10, time(NULL))) - goto error; - if (!bind(db, stmt, 11, (uint64)0)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - sqlite3_finalize(stmt); - stmt = NULL; - } - - err = sqlite3_close(db); - if (err != SQLITE_OK) - goto error; - - return true; - -error: - log(db); - if (stmt) sqlite3_finalize(stmt); - if (db) sqlite3_close(db); - return false; -} -#endif - - - void O2DatDB:: update(O2DatRecList &in) @@ -1339,56 +1231,6 @@ -#if 0 -bool -O2DatDB:: -update_lastpublish(const hashT &hash) -{ - sqlite3 *db = NULL; - int err = sqlite3_open16(dbfilename.c_str(), &db); - if (err != SQLITE_OK) - goto error; - sqlite3_busy_timeout(db, 5000); - - wchar_t *sql = - L"update or replace dat" - L" set lastpublish = ?" - L" where hash = ?;"; - - sqlite3_stmt *stmt = NULL; - err = sqlite3_prepare16_v2(db, sql, wcslen(sql)*2, &stmt, NULL); - if (err != SQLITE_OK) - goto error; - - if (!bind(db, stmt, 1, time(NULL))) - goto error; - if (!bind(db, stmt, 2, hash)) - goto error; - - err = sqlite3_step(stmt); - if (err != SQLITE_ROW && err != SQLITE_DONE) - goto error; - - sqlite3_finalize(stmt); - stmt = NULL; - - err = sqlite3_close(db); - if (err != SQLITE_OK) - goto error; - - return true; - -error: - log(db); - if (stmt) sqlite3_finalize(stmt); - if (db) sqlite3_close(db); - return false; -} -#endif - - - - void O2DatDB:: divide_update(O2DatRecList &in) Modified: branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h =================================================================== --- branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-26 08:29:15 UTC (rev 108) +++ branches/BRANCH_0043/o2on/src.o2on/O2DatDB.h 2008-07-26 08:46:46 UTC (rev 109) @@ -102,9 +102,7 @@ void insert(O2DatRecList &in, bool to_rebuild); -// bool update(O2DatRec &in, bool is_origurl); void update(O2DatRecList &in); -// bool update_lastpublish(const hashT &hash); void divide_update(O2DatRecList &in); bool remove(const hashT &hash);