Exemple #1
0
ZTuple ZTBSpec::Criterion::Rep::AsTuple() const
	{
	ZTuple result;
	result.SetString("PropName", fPropName.AsString());
	result.SetString("Rel", sStringFromRel(fComparator.fRel));
	if (fComparator.fStrength)
		result.SetInt32("Strength", fComparator.fStrength);
	if (fTupleValue)
		result.SetValue("Value", fTupleValue);
	return result;
	}
Exemple #2
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;
	}