本文整理汇总了C++中IPropertyTree::setPropTree方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyTree::setPropTree方法的具体用法?C++ IPropertyTree::setPropTree怎么用?C++ IPropertyTree::setPropTree使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPropertyTree
的用法示例。
在下文中一共展示了IPropertyTree::setPropTree方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: done
virtual void done()
{
StringBuffer scopedName;
OwnedRoxieString outputName(helper->getOutputName());
queryThorFileManager().addScope(container.queryJob(), outputName, scopedName);
Owned<IWorkUnit> wu = &container.queryJob().queryWorkUnit().lock();
Owned<IWUResult> r = wu->updateResultBySequence(helper->getSequence());
r->setResultStatus(ResultStatusCalculated);
r->setResultLogicalName(scopedName.str());
r.clear();
wu.clear();
IPropertyTree &patchProps = patchDesc->queryProperties();
if (0 != (helper->getFlags() & KDPexpires))
setExpiryTime(patchProps, helper->getExpiryDays());
IPropertyTree &originalProps = originalDesc->queryProperties();;
if (originalProps.queryProp("ECL"))
patchProps.setProp("ECL", originalProps.queryProp("ECL"));
if (originalProps.getPropBool("@local"))
patchProps.setPropBool("@local", true);
container.queryTempHandler()->registerFile(outputName, container.queryOwner().queryGraphId(), 0, false, WUFileStandard, &clusters);
Owned<IDistributedFile> patchFile;
// set part sizes etc
queryThorFileManager().publish(container.queryJob(), outputName, false, *patchDesc, &patchFile, 0, false);
try { // set file size
if (patchFile) {
__int64 fs = patchFile->getFileSize(true,false);
if (fs!=-1)
patchFile->queryAttributes().setPropInt64("@size",fs);
}
}
catch (IException *e) {
EXCLOG(e,"keydiff setting file size");
e->Release();
}
// Add a new 'Patch' description to the secondary key.
DistributedFilePropertyLock lock(newIndexFile);
IPropertyTree &fileProps = lock.queryAttributes();
StringBuffer path("Patch[@name=\"");
path.append(scopedName.str()).append("\"]");
IPropertyTree *patch = fileProps.queryPropTree(path.str());
if (!patch) patch = fileProps.addPropTree("Patch", createPTree());
patch->setProp("@name", scopedName.str());
unsigned checkSum;
if (patchFile->getFileCheckSum(checkSum))
patch->setPropInt64("@checkSum", checkSum);
IPropertyTree *index = patch->setPropTree("Index", createPTree());
index->setProp("@name", originalIndexFile->queryLogicalName());
if (originalIndexFile->getFileCheckSum(checkSum))
index->setPropInt64("@checkSum", checkSum);
originalIndexFile->setAccessed();
newIndexFile->setAccessed();
}
示例2: doStuff
void doStuff()
{
Owned<IRemoteConnection> conn = querySDS().connect("/Orbit", myProcessSession(), RTM_LOCK_WRITE|RTM_CREATE_QUERY, DALI_TIMEOUT);
IPropertyTree *root = conn->queryRoot();
StringBuffer s;
if (root->getProp("TestBranch1",s)) {
printf("TestBranch1: read %s\n",s.str());
}
else {
// save as string
printf("TestBranch1: set (as string)\n",s.str());
root->setProp("TestBranch1",MyTestXML);
}
MemoryBuffer m;
if (root->getPropBin("TestBranch2",m)) {
m.append((byte)0); // add a NULL to returned data
const char *str = m.toByteArray();
printf("TestBranch2: read %s\n",str);
}
else {
// save as raw binary
printf("TestBranch2: set (as blob)\n",s.str());
root->setPropBin("TestBranch2",strlen(MyTestXML),MyTestXML); // include NULL
}
IPropertyTree *br3 = root->queryPropTree("TestBranch3");
if (br3) {
printf("read TestBranch3 as tree\n");
printf("Hello = %s\n",br3->queryProp("Hello"));
int n = br3->getPropInt("Bye/@num"); // update
printf("Bye num = %d\n",n);
br3->setPropInt("Bye/@num",n+1);
}
else {
// save as tree
printf("TestBranch3: set (as tree)\n",s.str());
br3 = createPTreeFromXMLString(MyTestXML); // parses and creates object tree
root->setPropTree("TestBranch3", br3);
}
}
示例3: loadXML
void CXmlScope::loadXML(const char * text, const char * element)
{
IPropertyTree * ptree = createPTreeFromXMLString(text, ipt_caseInsensitive);
root->setPropTree(element, ptree);
}