コード例 #1
0
ZTuple ZTBQueryNode_Difference::AsTuple()
	{
	ZTuple theTuple;
	theTuple.SetString("Kind", "Difference");
	if (fLeftNode)
		theTuple.SetTuple("LeftNode", fLeftNode->AsTuple());
	if (fRightNode)
		theTuple.SetTuple("RightNode", fRightNode->AsTuple());
	return theTuple;
	}
コード例 #2
0
ZTuple ZTBQueryNode_ID_FromSource::AsTuple()
	{
	ZTuple theTuple;
	theTuple.SetString("Kind", "ID_FromSource");
	theTuple.SetString("SourcePropName", fSourcePropName.AsString());
	if (fSourceNode)
		theTuple.SetTuple("SourceNode", fSourceNode->AsTuple());
	return theTuple;
	}
コード例 #3
0
ZTuple ZTBQueryNode_First::AsTuple()
	{
	ZTuple theTuple;
	theTuple.SetString("Kind", "First");
	theTuple.SetString("PropName", fPropName.AsString());
	if (fSourceNode)
		theTuple.SetTuple("SourceNode", fSourceNode->AsTuple());
	return theTuple;
	}
コード例 #4
0
ZTuple ZTBQueryNode_Combo::Intersection::AsTuple() const
	{
	ZTuple result;
	result.SetTuple("Filter", fFilter.AsTuple());
	vector<ZTupleValue>& destVec = result.SetMutableVector("Nodes");
	for (vector<ZRef<ZTBQueryNode> >::const_iterator i = fNodes.begin(); i != fNodes.end(); ++i)
		destVec.push_back(sTupleFromNode(*i));
	return result;
	}
コード例 #5
0
static ZTuple sGetProp(const ZNode& iNode, const string& iPropName)
 	{
 	ZTuple propT;

	if (iPropName == "D:resourcetype")
		{
		if (iNode.CanHaveChildren())
			propT.SetTuple(iPropName, ZTuple().SetNull("D:collection"));
		else
			propT.SetNull(iPropName);
		}
	else if (iPropName == "D:getcontenttype")
		{
		ZTupleValue theValue;
		if (iNode.GetProp("MIMEType", theValue))
			{
			string theMIMEType;
			if (theValue.GetString(theMIMEType))
				propT.SetString(iPropName, theMIMEType);
			}
		}
	else if (iPropName == "D:creationdate")
		{
		ZTupleValue theValue;
		if (iNode.GetProp("TimeCreated", theValue))
			{
			if (ZTime theTime = theValue.GetTime())
				propT.SetString(iPropName, sAsString_WebDAV(theTime));
			}
		}
	else if (iPropName == "D:getlastmodified")
		{
		ZTupleValue theValue;
		if (iNode.GetProp("TimeModified", theValue))
			{
			if (ZTime theTime = theValue.GetTime())
				propT.SetString(iPropName, sAsString_WebDAV(theTime));
			}
		}
	else if (iPropName == "D:getcontentlength")
		{
		ZTupleValue theValue;
		if (iNode.GetProp("ContentLength", theValue))
			{
			int64 theLength;
			if (theValue.GetInt64(theLength))
	 			propT.SetString(iPropName, ZString::sFromUInt64(theLength));
			}
		}

 	return propT;
 	}