本文整理汇总了C++中IResultSet::FetchRow方法的典型用法代码示例。如果您正苦于以下问题:C++ IResultSet::FetchRow方法的具体用法?C++ IResultSet::FetchRow怎么用?C++ IResultSet::FetchRow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IResultSet
的用法示例。
在下文中一共展示了IResultSet::FetchRow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClientConnectCallback
void CookieManager::ClientConnectCallback(int serial, IQuery *data)
{
int client;
/* Check validity of client */
if ((client = playerhelpers->GetClientFromSerial(serial)) == 0)
{
return;
}
statsPending[client] = false;
IResultSet *results;
/* Check validity of results */
if (data == NULL || (results = data->GetResultSet()) == NULL)
{
return;
}
CookieData *pData;
IResultRow *row;
unsigned int timestamp;
CookieAccess access;
while (results->MoreRows() && ((row = results->FetchRow()) != NULL))
{
const char *name = "";
row->GetString(0, &name, NULL);
const char *value = "";
row->GetString(1, &value, NULL);
pData = new CookieData(value);
pData->changed = false;
pData->timestamp = (row->GetInt(4, (int *)×tamp) == DBVal_Data) ? timestamp : 0;
Cookie *parent = FindCookie(name);
if (parent == NULL)
{
const char *desc = "";
row->GetString(2, &desc, NULL);
access = CookieAccess_Public;
row->GetInt(3, (int *)&access);
parent = CreateCookie(name, desc, access);
}
pData->parent = parent;
parent->data[client] = pData;
clientData[client].append(pData);
}
statsLoaded[client] = true;
cookieDataLoadedForward->PushCell(client);
cookieDataLoadedForward->Execute(NULL);
}
示例2: SelectIdCallback
void CookieManager::SelectIdCallback(Cookie *pCookie, IQuery *data)
{
IResultSet *results;
if (data == NULL || (results = data->GetResultSet()) == NULL)
{
return;
}
IResultRow *row = results->FetchRow();
if (row == NULL)
{
return;
}
row->GetInt(0, &pCookie->dbid);
}
示例3: SQL_FetchRow
static cell_t SQL_FetchRow(IPluginContext *pContext, const cell_t *params)
{
IQuery *query;
HandleError err;
if ((err = ReadQueryHndl(params[1], pContext, &query)) != HandleError_None)
{
return pContext->ThrowNativeError("Invalid query Handle %x (error: %d)", params[1], err);
}
IResultSet *rs = query->GetResultSet();
if (!rs)
{
return pContext->ThrowNativeError("No current result set");
}
return (rs->FetchRow() != NULL) ? true : false;
}
示例4: ClientConnectCallback
void CookieManager::ClientConnectCallback(int serial, IQuery *data)
{
int client;
IResultSet *results;
/* Check validity of client */
if ((client = playerhelpers->GetClientFromSerial(serial)) == 0)
{
return;
}
/* Check validity of results */
if (data == NULL || (results = data->GetResultSet()) == NULL)
{
return;
}
IResultRow *row;
do
{
if ((row = results->FetchRow()) == NULL)
{
break;
}
const char *name;
row->GetString(0, &name, NULL);
const char *value;
row->GetString(1, &value, NULL);
CookieData *pData = new CookieData(value);
pData->changed = false;
Cookie *parent = FindCookie(name);
if (parent == NULL)
{
const char *desc;
row->GetString(2, &desc, NULL);
CookieAccess access = CookieAccess_Public;
row->GetInt(3, (int *)&access);
parent = CreateCookie(name, desc, access);
cookieTrie.insert(name, parent);
cookieList.push_back(parent);
}
pData->parent = parent;
parent->data[client] = pData;
clientData[client].push_back(pData);
} while (results->MoreRows());
statsLoaded[client] = true;
cookieDataLoadedForward->PushCell(client);
cookieDataLoadedForward->Execute(NULL);
}