本文整理汇总了C++中StatusCode::isOk方法的典型用法代码示例。如果您正苦于以下问题:C++ StatusCode::isOk方法的具体用法?C++ StatusCode::isOk怎么用?C++ StatusCode::isOk使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StatusCode
的用法示例。
在下文中一共展示了StatusCode::isOk方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FetchCollections
StatusCode QueryOperatorImpl::FetchCollections(QueryNodeImpl* target)
{
return WINI_ERROR;
#if 0
sprintf(m_qval[DATA_GRP_NAME]," = '%s'", m_binding->GetPath());
StatusCode status = GetFirstChildCollection(target);
if(status.isOk())
{
clearSqlResult(&m_result);
sprintf(m_qval[DATA_GRP_NAME]," like '%s/%%'", m_binding->GetPath());
status = GetChildCollections(target);
}
return status;
#endif
}
示例2: GetChildDatasets
StatusCode QueryOperatorImpl::GetChildDatasets(QueryNodeImpl* target)
{
return WINI_ERROR;
#if 0
StatusCode status = srbGetDataDirInfo(m_conn, 0, m_qval, m_selval, &m_result, MAX_ROWS);
if(!status.isOk())
return status;
filterDeleted(&m_result);
char* szCollection = getFromResultStruct(&m_result,dcs_tname[DATA_GRP_NAME], dcs_aname[DATA_GRP_NAME]);
char* szDataset = getFromResultStruct(&m_result,dcs_tname[DATA_NAME], dcs_aname[DATA_NAME]);
char *szCPtr, *szDPtr;
const char* path = m_binding->GetPath();
int path_len = strlen(path);
INode* parent = m_binding;
INode *child, *dataset;
for(int i = 0; i < m_result.row_count; i++)
{
szCPtr = szCollection;
szDPtr = szDataset;
szCPtr += i * MAX_DATA_SIZE;
szDPtr += i * MAX_DATA_SIZE;
szCPtr += path_len;
//dataset?
if(NULL == *szCPtr)
{
status = parent->GetChild(szDPtr, &dataset);
if(!status.isOk())
return WINI_ERROR;
target->AddChild(dataset);
continue;
}
start: status = ((CollectionNodeImpl*)parent)->GetChild(szCPtr, &child);
CollectionOperatorImpl* collection_op = (CollectionOperatorImpl*)m_session->GetOperator(WINI_COLLECTION);
switch(status.GetCode())
{
case WINI_OK:
//dataset is in a child collection of the binding
//child collection has been found
//now locate the dataset
startd: status = child->GetChild(szDPtr, &dataset);
switch(status.GetCode())
{
case WINI_OK:
target->AddChild(dataset);
break;
case WINI_ERROR_NOT_FILLED:
collection_op->GetChildren((CollectionNodeImpl*)child);
goto startd;
break;
default:
return WINI_ERROR;
break;
}
break;
case WINI_ERROR_NOT_FILLED:
//child is not opened yet
//open the child and begin again
collection_op->GetChildren((CollectionNodeImpl*)parent);
goto start;
break;
default:
return WINI_ERROR;
break;
}
}
//while(m_result.continuation_index >= 0)
//{
//add code for this later
//}
return WINI_OK;
#endif
}
示例3:
StatusCode QueryOperatorImpl::LoadCollectionQuery2(IMetadataNode* ptr, int& count)
{
return WINI_ERROR;
#if 0
if(NULL == ptr)
return WINI_ERROR_INVALID_PARAMETER;
MetadataNodeImpl* child;
StatusCode status;
switch(ptr->GetOperation())
{
case WINI_MD_AND:
child = (MetadataNodeImpl*)ptr->GetChild(0); //left hand child
status = LoadCollectionQuery2(child, count);
if(!status.isOk())
return status;
child = (MetadataNodeImpl*)ptr->GetChild(1); //right hand child
status = LoadCollectionQuery2(child, count);
if(!status.isOk())
return status;
break;
case WINI_MD_EQUAL:
case WINI_MD_NOT_EQUAL:
case WINI_MD_GREATER_THAN:
case WINI_MD_LESS_THAN:
case WINI_MD_GREATER_OR_EQUAL:
case WINI_MD_LESS_OR_EQUAL:
case WINI_MD_BETWEEN:
case WINI_MD_NOT_BETWEEN:
case WINI_MD_LIKE:
case WINI_MD_NOT_LIKE:
case WINI_MD_SOUNDS_LIKE:
case WINI_MD_SOUNDS_NOT_LIKE:
switch(++count)
{
case 1:
sprintf(m_qval[UDSMD_COLL0]," = '%s'", ptr->GetAttribute());
sprintf(m_qval[UDSMD_COLL1]," %s '%s'", ptr->GetOperationString(), ptr->GetValue());
break;
case 2:
sprintf(m_qval[UDSMD_COLL0_1]," = '%s'", ptr->GetAttribute());
sprintf(m_qval[UDSMD_COLL1_1]," %s '%s'", ptr->GetOperationString(), ptr->GetValue());
break;
case 3:
sprintf(m_qval[UDSMD_COLL0_2]," = '%s'", ptr->GetAttribute());
sprintf(m_qval[UDSMD_COLL1_2]," %s '%s'", ptr->GetOperationString(), ptr->GetValue());
break;
case 4:
sprintf(m_qval[UDSMD_COLL0_3]," = '%s'", ptr->GetAttribute());
sprintf(m_qval[UDSMD_COLL1_3]," %s '%s'", ptr->GetOperationString(), ptr->GetValue());
break;
case 5:
sprintf(m_qval[UDSMD_COLL0_4]," = '%s'", ptr->GetAttribute());
sprintf(m_qval[UDSMD_COLL1_4]," %s '%s'", ptr->GetOperationString(), ptr->GetValue());
//could also put a ptr->GetValue(); here to reset a static int
break;
default:
break;
}
return WINI_OK;
default:
return WINI_ERROR_INVALID_PARAMETER;
}
return status;
#endif
}
示例4: GetChild
StatusCode CollectionNodeImpl::GetChild(const char* name, INode** result)
{
if((NULL == name)||(NULL == result))
return WINI_ERROR_INVALID_PARAMETER;
INode* child;
char *szname;
int j;
StatusCode status;
if('/' == name[0])
{
szname = strdup(name);
int len = strlen(name);
for(j = 1; j < len; j++)
{
if('/' == szname[j])
{
szname[j] = 0;
break;
}
}
status = GetChild(&szname[1], &child);
szname[j] = '/';
if(!status.isOk())
{
free(szname);
*result = child;
return status;
}
if(j < len)
{
status = child->GetChild(&szname[j], &child);
}
free(szname);
*result = child;
return status;
}
if(m_children)
{
for(int i = 0; i < m_children->size(); i++)
{
child = m_children->at(i);
if(0 == strcmp(name, child->GetName()))
{
*result = child;
return WINI_OK;
}
}
}else
{
*result = this;
return WINI_ERROR_NOT_FILLED;
}
*result = NULL;
return WINI_ERROR_CHILD_NOT_FOUND;
}
示例5: GetChild
StatusCode UserNodeImpl::GetChild(const char* name, INode** result)
{
if(NULL == name)
return NULL;
if(NULL == result)
return NULL;
INode* child;
char *szname;
int j;
StatusCode status;
if('/' == name[0])
{
szname = strdup(name);
int len = strlen(name);
for(j = 1; j < len; j++)
{
if('/' == szname[j])
{
szname[j] = 0;
break;
}
}
status = GetChild(&szname[1], &child);
if(!status.isOk())
{
free(szname);
*result = child;
return status;
}
if(j < len)
{
status = child->GetChild(&szname[j+1], &child);
}
free(szname);
*result = child;
return status;
}else
{
if(m_children)
{
for(int i = 0; i < m_children->size(); i++)
{
child = m_children->at(i);
if(0 == strcmp(name, child->GetName()))
{
*result = child;
return WINI_OK;
}
}
}else
{
*result = this;
return WINI_ERROR_NOT_FILLED;
}
}
//should never reach here
*result = NULL;
return WINI_ERROR;
}