Commit 314d9d3a authored by mercury233's avatar mercury233

don't read CardString

parent 6b06968c
...@@ -12,7 +12,7 @@ bool DataManager::LoadDB(const char* file) { ...@@ -12,7 +12,7 @@ bool DataManager::LoadDB(const char* file) {
if(sqlite3_open(file, &pDB) != SQLITE_OK) if(sqlite3_open(file, &pDB) != SQLITE_OK)
return Error(pDB); return Error(pDB);
sqlite3_stmt* pStmt; sqlite3_stmt* pStmt;
const char* sql = "select * from datas,texts where datas.id=texts.id"; const char* sql = "select * from datas";
if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK) if(sqlite3_prepare_v2(pDB, sql, -1, &pStmt, 0) != SQLITE_OK)
return Error(pDB); return Error(pDB);
CardDataC cd; CardDataC cd;
...@@ -39,6 +39,7 @@ bool DataManager::LoadDB(const char* file) { ...@@ -39,6 +39,7 @@ bool DataManager::LoadDB(const char* file) {
cd.attribute = sqlite3_column_int(pStmt, 9); cd.attribute = sqlite3_column_int(pStmt, 9);
cd.category = sqlite3_column_int(pStmt, 10); cd.category = sqlite3_column_int(pStmt, 10);
_datas.insert(std::make_pair(cd.code, cd)); _datas.insert(std::make_pair(cd.code, cd));
/*
len = BufferIO::DecodeUTF8((const char*)sqlite3_column_text(pStmt, 12), strBuffer); len = BufferIO::DecodeUTF8((const char*)sqlite3_column_text(pStmt, 12), strBuffer);
if(len) { if(len) {
cs.name = new wchar_t[len + 1]; cs.name = new wchar_t[len + 1];
...@@ -60,6 +61,7 @@ bool DataManager::LoadDB(const char* file) { ...@@ -60,6 +61,7 @@ bool DataManager::LoadDB(const char* file) {
} else cs.desc[i - 14] = 0; } else cs.desc[i - 14] = 0;
} }
_strings.insert(std::make_pair(cd.code, cs)); _strings.insert(std::make_pair(cd.code, cs));
*/
} }
} while(step != SQLITE_DONE); } while(step != SQLITE_DONE);
sqlite3_finalize(pStmt); sqlite3_finalize(pStmt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment