本文整理汇总了C++中CppSQLite3DB::isOpen方法的典型用法代码示例。如果您正苦于以下问题:C++ CppSQLite3DB::isOpen方法的具体用法?C++ CppSQLite3DB::isOpen怎么用?C++ CppSQLite3DB::isOpen使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CppSQLite3DB
的用法示例。
在下文中一共展示了CppSQLite3DB::isOpen方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dlg
extern "C" BOOL WINAPI EXPORT _Run(HINSTANCE hInst,
HWND hwndParent,
LPBYTE *buffer,
LONG *size)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
CWnd *pWnd = CWnd::FromHandle(hwndParent);
CModParam param;
VERIFY(param.SetBuffer(*buffer, *size));
CWnd *pWnd1 = CWnd::FromHandle(GetTopWindow(NULL));
if(param.GetValue(L"contrato").IsEmpty())
{
STLOG_WRITE(L"Tag contrato esta vazia");
return FALSE;
}
CppSQLite3DB *pDB = CppSQLite3DB::getInstance();
if(!pDB->isOpen())
{
pDB = NULL;
STLOG_WRITE(L"_Run1: Database pointer is null.");
return FALSE;
}
CString sCodigo = param.GetValue(L"codigo");
CSincroDlg::m_wnd = CMsgWindow::getInstance();
CSincroDlg::m_wnd->Create(pWnd1);
CSincroDlg::m_wnd->Show(L"");
CSincroDlg dlg(pDB, sCodigo, pWnd);
dlg.m_params = ¶m;
//dlg.m_sServer = param.GetValue(L"server");
//dlg.m_sContrato = param.GetValue(L"contrato");
dlg.DoModal();
// Se nao retorna parametro... OK...
return FALSE;
}
示例2: init
bool PlayerInfoDataManager::init(){
string path = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("config/luckycat.sqlite");
CppSQLite3DB db;
db.open(path.c_str());
if (!db.isOpen())
{
return false;
}
CppSQLite3Query q = db.execQuery("select * from dict_equipment;");
while(!q.eof())
{
stActorUserEquipInfo tempInfo;
tempInfo.userEquipId = q.getIntField("id");
tempInfo.userEquipType = q.getIntField("class");
tempInfo.userPutOn = false;
stActorEquipInfo equipInfo;// = new stActorEquipInfo();
equipInfo.equipName = q.getStringField("name");
equipInfo.equipImageId = q.getIntField("image_id");
equipInfo.equipLife = q.getIntField("life");
equipInfo.equipLevelLimit = q.getIntField("level_limit");
equipInfo.equipAttack = q.getIntField("attack");
equipInfo.equipDefence = q.getIntField("defence");
equipInfo.equipSpeed = q.getIntField("speed");
equipInfo.equipDescription = q.getStringField("description");
tempInfo.equipInfo = &equipInfo;
m_vecUserEquipInfos.push_back(tempInfo);
q.nextRow();
}
return true;
}
示例3: readDB
void EventDataManager::readDB()
{
string strFullPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("config/luckycat.sqlite");
CppSQLite3DB db;
db.open(strFullPath.c_str());
if (!db.isOpen())
{
return;
}
// CppSQLite3Query result = db.execQuery("select * from dict_event;");
//
// std::vector<stEvent *> tEventVector;
// while(!result.eof())
// {
// stEvent *tEvent = new stEvent();
// tEvent->id = result.getIntField("id");
// tEvent->type = (LEventType)result.getIntField("type");
// tEvent->targetId = atoi(result.getStringField("target"));
// std::string strBonus = result.getStringField("bonus");
// std::vector<int> tmpBonusList = separateStringToNumberVector(strBonus, ",");
//
// if (tmpBonusList.size() > 0)
// CCAssert( tmpBonusList[0]*2 == tmpBonusList.size()-1, "Something error in sql field\n");
// for (int i = 1; tmpBonusList[0] != 0 && i+1 < tmpBonusList.size(); i+=2) {
// stGood _good;
// _good.id = tmpBonusList[i];
// _good.count = tmpBonusList[i+1];
// tEvent->bonus.push_back(_good);
// }
//
// tEvent->bonusRepeat = result.getIntField("bonus_repeat");
// tEvent->nextEventId = result.getIntField("next_event_id");
// tEvent->box_id = result.getIntField("box_id");
//
// tEventVector.push_back(tEvent);
//
// result.nextRow();
// }
//
// this->setEventMap(tEventVector);
CppSQLite3Query result_1 = db.execQuery("select * from dict_npc_talk;");
std::vector<stTalk *> tTalkVector;
while(!result_1.eof())
{
stTalk *tTalk = new stTalk();
tTalk->id = result_1.getIntField("id");
tTalk->eventId = result_1.getIntField("event_id");
std::string _dialog= result_1.getStringField("content");
tTalk->dialogList = separateString(_dialog,"||");
tTalk->npcId = result_1.getIntField("npc_id");
tTalk->npcName = result_1.getStringField("npc_name");
tTalkVector.push_back(tTalk);
result_1.nextRow();
}
this->setTalkMap(tTalkVector);
db.close();
}