本文整理汇总了C++中ZTuple::AppendTuple方法的典型用法代码示例。如果您正苦于以下问题:C++ ZTuple::AppendTuple方法的具体用法?C++ ZTuple::AppendTuple怎么用?C++ ZTuple::AppendTuple使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZTuple
的用法示例。
在下文中一共展示了ZTuple::AppendTuple方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sHandle_PROPFIND_All
static void sHandle_PROPFIND_All(const ZTrail& iPrefix, const ZNode& iRoot, const ZNode& iNode, int iDepth, ZTuple& ioTuple)
{
vector<string> thePropNames;
thePropNames.push_back("D:resourcetype");
thePropNames.push_back("D:getcontenttype");
thePropNames.push_back("D:creationdate");
thePropNames.push_back("D:getlastmodified");
thePropNames.push_back("D:getcontentlength");
for (DAVIter i = DAVIter(iNode, iDepth); i; i.Advance())
{
ZNode theNode = i.Current();
if (theNode.Exists())
{
ZTuple goodT, badT;
sGetProperties(theNode, thePropNames, goodT, badT);
ZTuple responseT;
responseT.SetString("D:href", sMakeHREF(iPrefix, iRoot, theNode));
if (goodT)
{
goodT.SetString("D:status", "HTTP/1.1 200 OK");
responseT.AppendTuple("D:propstat", goodT);
}
ioTuple.AppendTuple("D:response", responseT);
}
}
}
示例2: sHandle_PROPFIND_Some
static void sHandle_PROPFIND_Some(const ZTrail& iPrefix, const ZNode& iRoot, const ZNode& iNode, int iDepth, const vector<string>& iPropNames, ZTuple& ioTuple)
{
for (DAVIter i = DAVIter(iNode, iDepth); i; i.Advance())
{
ZNode theNode = i.Current();
if (theNode.Exists())
{
ZTuple goodT, badT;
sGetProperties(theNode, iPropNames, goodT, badT);
ZTuple responseT;
responseT.SetString("D:href", sMakeHREF(iPrefix, iRoot, theNode));
if (goodT)
{
goodT.SetString("D:status", "HTTP/1.1 200 OK");
responseT.AppendTuple("D:propstat", goodT);
}
if (badT)
{
badT.SetString("D:status", "HTTP/1.1 404 Not Found");
responseT.AppendTuple("D:propstat", badT);
}
ioTuple.AppendTuple("D:response", responseT);
}
}
}
示例3: sGetProperties
static void sGetProperties(const ZNode& iNode, const vector<string>& iPropNames, ZTuple& oGoodT, ZTuple& oBadT)
{
for (vector<string>::const_iterator i = iPropNames.begin(); i != iPropNames.end(); ++i)
{
if (ZTuple propT = sGetProp(iNode, *i))
oGoodT.AppendTuple("D:prop", propT);
else
oBadT.AppendTuple("D:prop", ZTuple().SetNull(*i));
}
}
示例4: sDelete
static bool sDelete(const ZTrail& iPrefix, const ZNode& iRoot, const ZNode& iNode, ZTuple& ioT)
{
bool allOkay = true;
// Delete any descendants of iNode.
for (ZNodeIter i = iNode; i; i.Advance())
{
if (!sDelete(iPrefix, iRoot, i.Current(), ioT))
allOkay = false;
}
if (allOkay)
{
if (iNode.Delete())
return true;
ZTuple responseT;
responseT.SetString("D:href", sMakeHREF(iPrefix, iRoot, iNode));
responseT.SetString("D:status", "HTTP/1.1 404");
ioT.AppendTuple("D:response", responseT);
}
return false;
}