Esempio n. 1
0
ZTuple ZTBQueryNode_Combo::AsTuple()
	{
	ZTuple result;
	result.SetString("Kind", "Combo");

	if (!fSort.empty())
		{
		vector<ZTupleValue>& sortVector = result.SetMutableVector("Sort");
		for (vector<ZTBQuery::SortSpec>::iterator i = fSort.begin(); i != fSort.end(); ++i)
			{
			ZTuple theTuple;
			theTuple.SetString("PropName", (*i).fPropName.AsString());
			theTuple.SetBool("Ascending", (*i).fAscending);
			theTuple.SetInt32("Strength", (*i).fStrength);
			sortVector.push_back(theTuple);
			}
		}

	vector<ZTupleValue>& sectVector = result.SetMutableVector("Intersections");
	for (vector<Intersection>::iterator i = fIntersections.begin(); i != fIntersections.end(); ++i)
		sectVector.push_back((*i).AsTuple());

	return result;
	}