当前位置: 首页>>代码示例>>C++>>正文


C++ CppSQLite3Query::getStringField方法代码示例

本文整理汇总了C++中CppSQLite3Query::getStringField方法的典型用法代码示例。如果您正苦于以下问题:C++ CppSQLite3Query::getStringField方法的具体用法?C++ CppSQLite3Query::getStringField怎么用?C++ CppSQLite3Query::getStringField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CppSQLite3Query的用法示例。


在下文中一共展示了CppSQLite3Query::getStringField方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SQLToBizUserDataArray

bool CWizIndexBase::SQLToBizUserDataArray(const QString& strSQL,
                                          CWizBizUserDataArray& arrayUser)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZBIZUSER data;
            data.bizGUID = query.getStringField(userBIZ_GUID);
            data.userId = query.getStringField(userUSER_ID);
            data.userGUID = query.getStringField(userUSER_GUID);
            data.alias = query.getStringField(userUSER_ALIAS);
            data.pinyin = query.getStringField(userUSER_PINYIN);

            arrayUser.push_back(data);
            query.nextRow();
        }

        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
开发者ID:flyfire,项目名称:WizQTClient,代码行数:26,代码来源:wizIndexBase.cpp

示例2: SQLToStyleDataArray

bool CWizIndexBase::SQLToStyleDataArray(const CString& strSQL, CWizStyleDataArray& arrayStyle)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZSTYLEDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(styleSTYLE_GUID);
            data.strName = query.getStringField(styleSTYLE_NAME);
            data.strDescription = query.getStringField(styleSTYLE_DESCRIPTION);
            data.crTextColor = query.getColorField(styleSTYLE_TEXT_COLOR);
            data.crBackColor = query.getColorField(styleSTYLE_BACK_COLOR);
            data.bTextBold = query.getBoolField(styleSTYLE_TEXT_BOLD);
            data.nFlagIndex = query.getIntField(styleSTYLE_FLAG_INDEX);
            data.tModified = query.getTimeField(styleDT_MODIFIED);
            data.nVersion = query.getInt64Field(styleVersion);

            arrayStyle.push_back(data);
            query.nextRow();
        }

        std::sort(arrayStyle.begin(), arrayStyle.end());
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
开发者ID:flyfire,项目名称:WizQTClient,代码行数:31,代码来源:wizIndexBase.cpp

示例3:

vector<lip> limitIP::GetIPList()
{
	vector<lip> lips;
	__try
	{

	CppSQLite3Query query = m_pDB.execQuery(_T("SELECT IP,Remark FROM IPfliter"));

	while (!query.eof())
	{
		lip l;
		l.szIP = query.getStringField(_T("IP"));
		l.remark = query.getStringField(_T("Remark"));
		lips.push_back(l);

		query.nextRow();
	}

	return lips;
	}
	__except (Global::MyUnhandledExceptionFilter(GetExceptionInformation()))
	{
		return lips;
	}
}
开发者ID:louzhenyu,项目名称:Mainline,代码行数:25,代码来源:limitIP.cpp

示例4: OnSelchangeLocationlist

void CTerminateNewLocationDialog::OnSelchangeLocationlist() 
{
    int iLocationID = m_ctlLocationList.GetItemData(m_ctlLocationList.GetCurSel());
    CString sSQL;
    sSQL.Format("SELECT Industries.id,Industries.name FROM Industries,Sidings WHERE Industries.Sidings_FK=Sidings.id AND Sidings.Locations_FK=%d",iLocationID);
    TRACE(sSQL);
    //
    CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB;
    CppSQLite3Query q = pDB->execQuery(sSQL);
    //
    while( m_ctlIndustryList.GetCount() > 0 )
        m_ctlIndustryList.DeleteString(0);
    //
    while (!q.eof())
    {
        int nIndex = m_ctlIndustryList.AddString(q.getStringField("name"));
        m_ctlIndustryList.SetItemData(nIndex,q.getIntField("id"));
        q.nextRow();
    }
    //
    sSQL.Format("SELECT id,name FROM Sidings WHERE Locations_FK=%d;",iLocationID);
    q = pDB->execQuery(sSQL);
    //
    while( m_ctlSidingList.GetCount() > 0 )
        m_ctlSidingList.DeleteString(0);
    //
    while (!q.eof())
    {
        int nIndex = m_ctlSidingList.AddString(q.getStringField("name"));
        m_ctlSidingList.SetItemData(nIndex,q.getIntField("id"));
        q.nextRow();
    }
    q.finalize();
}
开发者ID:ibrahimelhadeg,项目名称:trainops,代码行数:34,代码来源:TerminateNewLocationDialog.cpp

示例5: getFirstFile

int CDBObject::getFirstFile(char* name)
{
	try
	{
		if(name != NULL)
		{
			char szSql[]= {"SELECT * from Record"};
			CppSQLite3DB database;
			database.open(g_szFile);
			CppSQLite3Query query = database.execQuery(szSql);
			if(!query.eof())
			{
				string path = query.getStringField(8);
				string file= query.getStringField(7);
				sprintf(name, "%s\\%s", UTF_82ASCII(path).c_str(), UTF_82ASCII(file).c_str());
				return query.getIntField(0);
			}
		}
	}
	catch(...)
	{
		g_pLog->WriteLog("数据库查询异常 getFirstFile\n");
	}
	return -1;
}
开发者ID:curious-boy,项目名称:RMS,代码行数:25,代码来源:DBObject.cpp

示例6: OnInitDialog

BOOL CLocationDetailDialog::OnInitDialog()
{
    CDialog::OnInitDialog();

    if( m_iLocationID == -1 )
        m_ctlOK.EnableWindow(FALSE);
    else
    {
        CString sSQL;
        sSQL.Format("SELECT name,notes FROM Locations WHERE id=%d;",m_iLocationID);
        CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB;
        CppSQLite3Query q = pDB->execQuery(sSQL);
        //
        if (!q.eof())
        {
            m_sLocationName = q.getStringField("name");
            m_sLocalInstructions = q.getStringField("notes");
        }
        q.finalize();
        UpdateData(FALSE);
    }

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:ibrahimelhadeg,项目名称:trainops,代码行数:25,代码来源:LocationDetailDialog.cpp

示例7: OnInitDialog

BOOL CCarTypesDetailDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here

    if( m_iCarTypeFK != -1 )
    {
        CppSQLite3DB* pDB = &((CTrainOpsApp*)AfxGetApp())->m_pDB;
        CString sSQL;
        sSQL.Format("SELECT * FROM CarTypes WHERE id=%d",m_iCarTypeFK);
        CppSQLite3Query q = pDB->execQuery((LPCTSTR)sSQL);
        if( !q.eof() )
        {
            m_sCarTypeDescription = q.getStringField("description");
            m_sCarTypeID = q.getStringField("type_id");
            m_bPassenger = q.getIntField("passenger")==1?TRUE:FALSE;
        }
        q.finalize();
    }


    UpdateData(FALSE);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
开发者ID:ibrahimelhadeg,项目名称:trainops,代码行数:27,代码来源:CarTypesDetailDialog.cpp

示例8: SQLToTagDataArray

bool CWizIndexBase::SQLToTagDataArray(const CString& strSQL, CWizTagDataArray& arrayTag)
{
    try
    {
        CppSQLite3Query query = m_db.execQuery(strSQL);
        while (!query.eof())
        {
            WIZTAGDATA data;
            data.strKbGUID = kbGUID();
            data.strGUID = query.getStringField(tagTAG_GUID);
            data.strParentGUID = query.getStringField(tagTAG_GROUP_GUID);
            data.strName = query.getStringField(tagTAG_NAME);
            data.strDescription = query.getStringField(tagTAG_DESCRIPTION);
            data.tModified = query.getTimeField(tagDT_MODIFIED);
            data.nVersion = query.getInt64Field(tagVersion);

            arrayTag.push_back(data);
            query.nextRow();
        }

        std::sort(arrayTag.begin(), arrayTag.end());
        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        return LogSQLException(e, strSQL);
    }
}
开发者ID:flyfire,项目名称:WizQTClient,代码行数:28,代码来源:wizIndexBase.cpp

示例9: Load

bool CSpace::Load(int64 ParentID,int64 ChildID){
	m_ID = ParentID;
	
	char     ParentName[30], ChildName[30]; 
	int64toa(ParentID,ParentName);
	int64toa(ChildID,ChildName);
	
	CppSQLite3Buffer SQL;
	SQL.format("select * from \"%s\" where %s = \"%s\" ",
		ParentName,
		ITEM_ID,
		ChildName  
	);

	CppSQLite3Query Result = GetWorldDB().execQuery(SQL);
	if(Result.eof()){
		return false;
	}
	assert(Size()>5);
	assert(GetDataType(0) == TYPE_INT);
	int64& OldID = *(int64*)GetData(0);
	OldID = ChildID;

	AnsiString AnsiName = Result.getStringField(1,"");	
	tstring Name = UTF8toWS(AnsiName);
	SetName(Name);

	SPACETYPE Type = (SPACETYPE)Result.getIntField(2);
	SetSpaceType(Type);

	AnsiString Fingerprint = Result.getStringField(3);
	tstring Fingerprint1 = UTF8toWS(Fingerprint);
    SetFingerprint(Fingerprint1);
	
	AnsiString AnsiProperty = Result.getStringField(4,"");     	
	ePipeline Property;
	uint32 pos =0;
	bool ret = Property.FromString(AnsiProperty,pos);
	if(!ret){
		return false;
	}
    SetProerty(Property);

	AnsiString AnsiOwner = Result.getStringField(5,"");
	ePipeline OwnerInfo;

	pos=0;
	ret = OwnerInfo.FromString(AnsiOwner,pos);
	if(!ret){
		return false;
	}  
	SetOwnerInfo(OwnerInfo);

	return true;
}
开发者ID:GMIS,项目名称:GMIS,代码行数:55,代码来源:Space.cpp

示例10: init

bool RPGMapSceneLayer::init(float showObjectTime)
{
    if(RPGBaseSceneLayer::init())
    {        
        CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("joystick.plist");
        CCSpriteFrameCache::sharedSpriteFrameCache()->addSpriteFramesWithFile("main.plist");
        
        //加载语言文件
        string languageFile = CCFileUtils::sharedFileUtils()->fullPathForFilename("scene_map_cns.plist");
        this->m_stringList = CCDictionary::createWithContentsOfFileThreadSafe(languageFile.c_str());
        this->m_stringList->retain();
        
        //数据库部分,读取进度记录
        CppSQLite3Query query = this->m_db.execQuery(SAVEDATA_MAP_QUERY);
        this->m_mapData.mapId = query.getIntField("map_id");
        this->m_mapData.mapName = query.getStringField("map_name");
        this->m_mapData.hasEnemy = query.getIntField("has_enemy") == 1 ? true : false;
        this->m_mapData.bgAudio = query.getStringField("bg_audio");
        this->m_mapData.playerToX = query.getFloatField("player_to_x");
        this->m_mapData.playerToY = query.getFloatField("player_to_y");
        this->m_mapData.playerDirection = query.getStringField("player_direction");
        this->m_mapData.location = query.getStringField("location_cns");
        this->m_mapData.gold = query.getIntField("gold");
        query.finalize();
        
        CCTMXTiledMap *bgMap = CCTMXTiledMap::create(this->m_mapData.mapName.c_str());
        bgMap->setTag(kRPGMapSceneLayerTagBgMap);
        bgMap->setPosition(ccp((CCDirector::sharedDirector()->getWinSize().width - bgMap->getContentSize().width) / 2.0, (CCDirector::sharedDirector()->getWinSize().height - bgMap->getContentSize().height) / 2.0));
        this->addChild(bgMap);
        
        //背景音乐
        if(SimpleAudioEngine::sharedEngine()->isBackgroundMusicPlaying())
        {
            SimpleAudioEngine::sharedEngine()->stopBackgroundMusic(true);
            SimpleAudioEngine::sharedEngine()->playBackgroundMusic(this->m_mapData.bgAudio.c_str(), true);
        }
        
        this->m_playerMoveAct = NULL;
        this->m_playerMoveSpeed = GAME_PLAYER_MOVESPEED;
        this->m_touchedDialogNPC = NULL;
        this->m_dialogDirection = kRPGMapSceneLayerDialogDirectionNone;
        
        this->m_hasEnemy = this->m_mapData.hasEnemy; //是否会遇敌
        this->m_releaseTexture = false; //是否在释构方法里面释放占用纹理
        
        this->scheduleOnce(schedule_selector(RPGMapSceneLayer::startPlay), showObjectTime);
        
//        CCTextureCache::sharedTextureCache()->dumpCachedTextureInfo();
        return true;
    }
    return false;
}
开发者ID:ChinaiOS,项目名称:OzgGameRPG,代码行数:52,代码来源:RPGMapSceneLayer.cpp

示例11: ERROR

EXPORT_C gint32 CContactDb::GetRecentContacts(GPtrArray ** pContacts)
	{
	char sql[64] = {0};
	char times[20] = {0};
//	time_t t;
	
//	time(&t); 
	*pContacts = NULL;
	*pContacts = g_ptr_array_new();
	if (*pContacts == NULL)
		{
		return ERROR(ESide_Client, EModule_Db, ECode_No_Memory);
		}
	
	OpenDatabase();
	strcpy(sql, "select * from recent_contact;");
	CppSQLite3Query query = m_dbBeluga.execQuery(sql);
	while (!query.eof())
		{
		stRecentContact * recentContact = (stRecentContact*)g_malloc0(sizeof(stRecentContact));
		if (recentContact == NULL)
			{
			CloseDatabase();
			return ERROR(ESide_Client, EModule_Db, ECode_No_Memory);
			}
		
		recentContact->nContactId = query.getIntField(1);
		recentContact->event = (EContactEvent)query.getIntField(2);
		strcpy(recentContact->eventCommInfo, query.getStringField(3));
		strcpy(times, query.getStringField(4));  /* exp: 2009-6-30 21:51:23 */
 		//recentContact->time = localtime(&t); 
		GetLocalTime(&recentContact->time);
		char * tmp = strrchr(times, '-');
		recentContact->time.tm_mon = atoi(tmp+1);
		tmp = strrchr(tmp, '-');
		recentContact->time.tm_mday = atoi(tmp+1);
		tmp = strrchr(tmp, ' ');
		recentContact->time.tm_hour = atoi(tmp+1);
		tmp = strrchr(tmp, ':');
		recentContact->time.tm_min = atoi(tmp+1);
		tmp = strrchr(tmp, ':');
		recentContact->time.tm_sec = atoi(tmp+1);
		
		g_ptr_array_add(*pContacts, recentContact);
		query.nextRow();
		}
	
	CloseDatabase();
	return 0;
	}
开发者ID:north0808,项目名称:haina,代码行数:50,代码来源:CContactDb.cpp

示例12: GetValue

bool DBSetting::GetValue(long lKey,std::string &strValue)
{
	//打开数据库
	CppSQLite3DB dbTask;
	dbTask.open(m_strDB.c_str());
	CheckCreateSettingTable(dbTask);
	CppSQLite3Buffer strSql;

	try{
		strSql.format("select value from T_Setting where key=%d;",lKey);
		CppSQLite3Query q = dbTask.execQuery(strSql);
		if (q.eof())
		{
			return false;
		}
		strValue = q.getStringField(0);
	}
	catch(CppSQLite3Exception &exp)
	{
		exp;
		ATLTRACE("error:%s\n",exp.errorMessage());
		ATLASSERT(FALSE);
		return false;
	}
	return true;
}
开发者ID:blog2i2j,项目名称:greentimer,代码行数:26,代码来源:DBSetting.cpp

示例13: GetGrupos

//Método que monta as tab do Tab Control
void CRcGen::GetGrupos(WPARAM wParam, CStringArray& arrayGrp)
{
	CStringA sQuery;

	sQuery.Format("select distinct res.grupo, resgrupo.descricao from res, resgrupo where res.grupo = resgrupo.grupo and res.pagina between %d and %d", LOWORD(wParam), HIWORD(wParam));

	try
	{
		CppSQLite3Query q = CppSQLite3DB::getInstance()->execQuery(sQuery);

		if(!q.eof())
		{
			m_nGrupo = q.getIntField(0);
			m_nGrupoInicial = m_nGrupo;
		}

		while(!q.eof())
		{
			arrayGrp.Add(CString(q.getStringField(1)));
			q.nextRow();
		}
	}
	catch(CppSQLite3Exception e)
	{
	
	}
}
开发者ID:MFDonadeli,项目名称:PMA,代码行数:28,代码来源:RCGen.cpp

示例14: loadItemsData

//private
void RPGMapItemsMenuLayer::loadItemsData()
{
    //道具数据
    this->m_itemsList->removeAllObjects();
    
    CppSQLite3Query query = this->m_db->execQuery(ITEMS_EXISTING_QUERY);
    while(!query.eof())
    {
        RPGExistingItems *itemsData = RPGExistingItems::create();
        itemsData->m_dataId = query.getIntField("id");
        itemsData->m_name = query.getStringField("name_cns");
        itemsData->m_buy = query.getIntField("buy");
        itemsData->m_sell = query.getIntField("sell");
        itemsData->m_type = query.getIntField("type");
        itemsData->m_attack = query.getFloatField("attack");
        itemsData->m_defense = query.getFloatField("defense");
        itemsData->m_speed = query.getFloatField("speed");
        itemsData->m_skillAttack = query.getFloatField("skill_attack");
        itemsData->m_skillDefense = query.getFloatField("skill_defense");
        itemsData->m_total = query.getIntField("total");
        this->m_itemsList->addObject(itemsData);
        
        query.nextRow();
    }
    query.finalize();
    
    CCTableView *tableView = (CCTableView*)this->getChildByTag(kRPGMapItemsMenuLayerTagItemListTable);
    tableView->reloadData();
}
开发者ID:ChinaiOS,项目名称:OzgGameRPG,代码行数:30,代码来源:RPGMapItemsMenuLayer.cpp

示例15: getcache

bool mtn_cms_page_builder::getcache(const std::string& page, mtn_cms_cache_item* cache_item)
{
  std::string _q = "SELECT * FROM `page_cache` WHERE page = \'" + page + "\';"; 
try
  {
  CppSQLite3Query q = _db->execQuery(_q.c_str());


  while (!q.eof())
    {
      int len;
      cache_item->data = q.getStringField("data");
      cache_item->created = q.getIntField("created");
      cache_item->ttl = q.getIntField("ttl");
      cache_item->valid = true;
      q.nextRow();
    } 
  }
 catch (CppSQLite3Exception ex)
   {
     cache_item->valid = false;
   }

  return cache_item->valid;
}
开发者ID:DivineLawnmower,项目名称:mountain-cms,代码行数:25,代码来源:pb.cpp


注:本文中的CppSQLite3Query::getStringField方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。