本文整理汇总了C++中ZTuple::SetString方法的典型用法代码示例。如果您正苦于以下问题:C++ ZTuple::SetString方法的具体用法?C++ ZTuple::SetString怎么用?C++ ZTuple::SetString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ZTuple
的用法示例。
在下文中一共展示了ZTuple::SetString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AsTuple
ZTuple ZTBQueryNode_First::AsTuple()
{
ZTuple theTuple;
theTuple.SetString("Kind", "First");
theTuple.SetString("PropName", fPropName.AsString());
if (fSourceNode)
theTuple.SetTuple("SourceNode", fSourceNode->AsTuple());
return theTuple;
}
示例2: sStringFromRel
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;
}
示例3: sGetProp
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;
}
示例4: 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);
}
}
}
示例5: 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);
}
}
}
示例6: InvalidateAllMenuBars
void ZApp::InvalidateAllMenuBars()
{
// We don't need to be locked to broadcast this message
ZTuple theTuple;
theTuple.SetString("what", "zoolib:InvalidateAllMenuBars");
ZMessage envelope;
envelope.SetString("what", "zoolib:Owner");
envelope.SetTuple("message", theTuple);
fOSApp->BroadcastMessageToAllWindows(envelope);
}
示例7: 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;
}
示例8: sAsTuple
ZTuple ZDragClip_Win_DataObject::sAsTuple(IDataObject* iIDataObject)
{
ZTuple theTuple;
ZDragClip_Win_DataObject* theDataObject;
if (SUCCEEDED(iIDataObject->QueryInterface(ZDragClip_Win_DataObject::sIID, (void**)&theDataObject)))
{
theTuple = *theDataObject->GetTuple();
theDataObject->Release();
}
else
{
vector<FORMATETC> filteredVector;
::sFilterNonHGLOBAL(iIDataObject, filteredVector);
for (vector<FORMATETC>::const_iterator i = filteredVector.begin();i != filteredVector.end(); ++i)
{
bool isString;
string thePropertyName;
if (ZDragClipManager::sGet()->LookupCLIPFORMAT((*i).cfFormat, thePropertyName, isString))
{
ZAssertStop(1, !thePropertyName.empty());
FORMATETC theFORMATETC = *i;
STGMEDIUM theSTGMEDIUM;
HRESULT theHRESULT = iIDataObject->GetData(&theFORMATETC, &theSTGMEDIUM);
if (SUCCEEDED(theHRESULT))
{
if (theSTGMEDIUM.tymed & TYMED_HGLOBAL)
{
void* globalPtr = ::GlobalLock(theSTGMEDIUM.hGlobal);
// Special case text, to find and ignore the zero terminator, and to store a string.
if (theFORMATETC.cfFormat == CF_TEXT)
theTuple.SetString(thePropertyName, string(reinterpret_cast<char*>(globalPtr)));
else
theTuple.SetRaw(thePropertyName, globalPtr, ::GlobalSize(theSTGMEDIUM.hGlobal));
::GlobalUnlock(theSTGMEDIUM.hGlobal);
}
::ReleaseStgMedium(&theSTGMEDIUM);
}
}
}
}
return theTuple;
}
示例9: GetTuple
ZTuple ZUITextEngine::GetTuple(size_t inOffset, size_t inLength)
{
ZTuple theTuple;
theTuple.SetString("text/plain", this->GetText(inOffset, inLength));
return theTuple;
}