コード例 #1
0
StatusCode QueryOperatorImpl::GetChildCollections(QueryNodeImpl* target)
{
	return WINI_ERROR;
#if 0
	StatusCode status = srbGetDataDirInfo(m_conn, 0, m_qval, m_selval, &m_result, MAX_ROWS);

	if(0 != status)
	{
		if(-3005 == status)
			status = 0;

		return status;
	}

	filterDeleted(&m_result);

	INode* baby;

	CollectionOperatorImpl* cOp;

	char* original = getFromResultStruct(&m_result,dcs_tname[DATA_GRP_NAME], dcs_aname[DATA_GRP_NAME]);
	char* pathstring;

	for(int i = 0; i < m_result.row_count; i++)
	{
		pathstring = original + (i*MAX_DATA_SIZE);
		pathstring = pathstring + strlen(m_binding->GetPath());
		
		//highly inefficient but for right now it works...
blah:
		if(pathstring)
		{
			status = ((CollectionNodeImpl*)m_binding)->GetChild(pathstring, &baby);
				
			switch(status.GetCode())
			{
			case WINI_OK:
				target->AddChild(baby);
				break;
			case WINI_ERROR_NOT_FILLED:
				cOp = new CollectionOperatorImpl(m_session);
				cOp->GetChildren((CollectionNodeImpl*)baby);
				goto blah;
					break;
			default:
				return WINI_GENERAL_ERROR;
			}
		}else
		{
			target->AddChild(m_binding);
		}
	}

	//while(m_result.continuation_index >= 0)
	//{
		//add code for this later	
	//}

	return WINI_OK;
#endif
}
コード例 #2
0
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
}