当前位置: 首页>>代码示例>>C++>>正文


C++ IPropertyTree::setProp方法代码示例

本文整理汇总了C++中IPropertyTree::setProp方法的典型用法代码示例。如果您正苦于以下问题:C++ IPropertyTree::setProp方法的具体用法?C++ IPropertyTree::setProp怎么用?C++ IPropertyTree::setProp使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPropertyTree的用法示例。


在下文中一共展示了IPropertyTree::setProp方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addWebServiceInfo

void ResourceManager::addWebServiceInfo(IPropertyTree *wsinfo)
{
    //convert legacy web service info to the new resource format
    if (wsinfo)
    {
        if (wsinfo->hasProp("SOAP"))
            ensureManifestInfo()->addProp("WS-PARAMS", wsinfo->queryProp("SOAP"));
        if (wsinfo->hasProp("HELP"))
        {
            const char *content = wsinfo->queryProp("HELP");
            addCompress("HELP", strlen(content)+1, content);
        }
        if (wsinfo->hasProp("INFO"))
        {
            const char *content = wsinfo->queryProp("INFO");
            addCompress("INFO", strlen(content)+1, content);
        }
        if (wsinfo->hasProp("OTX"))
        {
            const char *content = wsinfo->queryProp("OTX");
            addCompress("HYPER-LINK", strlen(content)+1, content);
        }
        if (wsinfo->hasProp("HTML"))
        {
            const char *content = wsinfo->queryProp("HTML");
            Owned<IPropertyTree> manifestEntry = createPTree("Resource");
            manifestEntry->setProp("@name", "Custom Form");
            addCompress("XSLT", strlen(content)+1, content, manifestEntry);
            IPropertyTree *view = ensurePTree(ensureManifestInfo(), "Views/XSLT/FORM");
            view->setProp("@resource", "Custom Form");
        }
        if (wsinfo->hasProp("HTMLD"))
        {
            const char *content = wsinfo->queryProp("HTMLD");
            Owned<IPropertyTree> manifestEntry = createPTree("Resource");
            manifestEntry->setProp("@name", "Custom HTML");
            addCompress("HTML", strlen(content)+1, content, manifestEntry);
            IPropertyTree *view = ensurePTree(ensureManifestInfo(), "Views/HTML/FORM");
            view->setProp("@resource", "Custom HTML");
        }
        if (wsinfo->hasProp("RESULT"))
        {
            const char *content = wsinfo->queryProp("RESULT");
            Owned<IPropertyTree> manifestEntry = createPTree("Resource");
            manifestEntry->setProp("@name", "Results");
            addCompress("XSLT", strlen(content)+1, content, manifestEntry);
            IPropertyTree *view = ensurePTree(ensureManifestInfo(), "Views/XSLT/RESULTS");
            view->setProp("@resource", "Results");
        }
        if (wsinfo->hasProp("ERROR"))
        {
            const char *content = wsinfo->queryProp("ERROR");
            Owned<IPropertyTree> manifestEntry = createPTree("Resource");
            manifestEntry->setProp("@name", "Error");
            addCompress("XSLT", strlen(content)+1, content, manifestEntry);
            IPropertyTree *view = ensurePTree(ensureManifestInfo(), "Views/XSLT/ERROR");
            view->setProp("@resource", "Error");
        }
    }
}
开发者ID:hhy5277,项目名称:HPCC-Platform,代码行数:60,代码来源:hqlres.cpp

示例2:

IPropertyTree *CEspBinding::ensureNavLink(IPropertyTree &folder, const char *name, const char *path, const char *tooltip, const char *menuname, const char *navPath, unsigned relPosition, bool force)
{
    StringBuffer xpath;
    xpath.appendf("Link[@name=\"%s\"]", name);

    bool addNew = true;
    IPropertyTree *ret = folder.queryPropTree(xpath.str());
    if (ret)
    {
        bool forced = ret->getPropBool("@force");
        if (forced || !force)
            return ret;

        addNew = false;
    }

    if (addNew)
        ret=createPTree("Link");

    ret->setProp("@name", name);
    ret->setProp("@tooltip", tooltip);
    ret->setProp("@path", path);
    ret->setProp("@menu", menuname);
    ret->setProp("@navPath", navPath);
    ret->setPropInt("@relPosition", relPosition);
    ret->setPropBool("@force", force);

    if (addNew)
        folder.addPropTree("Link", ret);

    return ret;
}
开发者ID:AlexLuya,项目名称:HPCC-Platform,代码行数:32,代码来源:espprotocol.cpp

示例3: computerUpdated

void SWProcess::computerUpdated(IPropertyTree *computerNode, const char* oldName,
     const char* oldIp, const char* instanceXMLTagName)
{
   IPropertyTree *software = m_envHelper->getEnvTree()->queryPropTree("Software");
   Owned<IPropertyTreeIterator> compIter = software->getElements(m_processName);

   const char *instance = (instanceXMLTagName)? instanceXMLTagName: m_instanceElemName.str();

   synchronized block(mutex);
   ForEach (*compIter)
   {
      IPropertyTree *comp = &compIter->query();
      Owned<IPropertyTreeIterator> instanceIter = comp->getElements(instance);
      ForEach (*instanceIter)
      {
         IPropertyTree *instance = &instanceIter->query();
         if (instance->hasProp(XML_ATTR_NAME) && !stricmp(instance->queryProp(XML_ATTR_NAME), oldName))
         {
            if (stricmp(computerNode->queryProp(XML_ATTR_NAME), instance->queryProp(XML_ATTR_NAME)))
               instance->setProp(XML_ATTR_NAME, computerNode->queryProp(XML_ATTR_NAME));
            if (instance->hasProp(m_ipAttribute.str()) && stricmp(computerNode->queryProp(XML_ATTR_NETADDRESS), instance->queryProp(m_ipAttribute.str())))
               instance->setProp(m_ipAttribute.str(), computerNode->queryProp(XML_ATTR_NETADDRESS));
            if (instance->hasProp("@computer") && stricmp(computerNode->queryProp(XML_ATTR_NAME), instance->queryProp("@computer")))
               instance->setProp("@computer", computerNode->queryProp(XML_ATTR_NAME));
         }
         else if (instance->hasProp(m_ipAttribute.str()) && !stricmp(instance->queryProp(m_ipAttribute.str()), oldIp))
         {
            instance->setProp(m_ipAttribute.str(), computerNode->queryProp(XML_ATTR_NETADDRESS));
         }
      }
   }
}
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:32,代码来源:SWProcess.cpp

示例4: doCreate

    void doCreate(const char *partname, const char *xml, unsigned updateFlags, StringArray &filesNotFound)
    {
        createPart(partname, xml);

        if (pmExisting)
        {
            if (!checkFlag(PKGADD_MAP_REPLACE))
                throw MakeStringException(PKG_NAME_EXISTS, "PackageMap %s already exists, either delete it or specify overwrite", pmid.str());
        }

        cloneDfsInfo(updateFlags, filesNotFound);

        if (pmExisting)
            packageMaps->removeTree(pmExisting);

        Owned<IPropertyTree> pmTree = createPTree("PackageMap", ipt_ordered);
        pmTree->setProp("@id", pmid);
        pmTree->setPropBool("@multipart", true);
        pmTree->addPropTree("Part", pmPart.getClear());
        packageMaps->addPropTree("PackageMap", pmTree.getClear());

        VStringBuffer xpath("PackageMap[@id='%s'][@querySet='%s']", pmid.str(), target.get());
        Owned<IPropertyTree> pkgSet = getPkgSetRegistry(process, false);
        IPropertyTree *psEntry = pkgSet->queryPropTree(xpath);

        if (!psEntry)
        {
            psEntry = pkgSet->addPropTree("PackageMap", createPTree("PackageMap"));
            psEntry->setProp("@id", pmid);
            psEntry->setProp("@querySet", target);
        }
        makePackageActive(pkgSet, psEntry, target, checkFlag(PKGADD_MAP_ACTIVATE));
    }
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:33,代码来源:ws_packageprocessService.cpp

示例5: ForEachChild

 ForEachChild(i, record)
 {
     IHqlExpression * cur = record->queryChild(i);
     switch (cur->getOperator())
     {
     case no_record:
         //MORE: If this is a public symbol it should be expanded, otherwise it will be elsewhere.
         expandRecordSymbolsMeta(metaTree, cur);
         break;
     case no_field:
         {
             IPropertyTree * field = metaTree->addPropTree("Field");
             field->setProp("@name", str(cur->queryId()));
             StringBuffer ecltype;
             cur->queryType()->getECLType(ecltype);
             field->setProp("@type", ecltype);
             break;
         }
     case no_ifblock:
         {
             IPropertyTree * block = metaTree->addPropTree("IfBlock");
             expandRecordSymbolsMeta(block, cur->queryChild(1));
             break;
         }
     case no_attr:
     case no_attr_link:
     case no_attr_expr:
         {
             IPropertyTree * attr = metaTree->addPropTree("Attr");
             attr->setProp("@name", str(cur->queryName()));
             break;
         }
     }
 }
开发者ID:fnisswandt,项目名称:HPCC-Platform,代码行数:34,代码来源:hqldesc.cpp

示例6: updateManifestResourcePaths

void updateManifestResourcePaths(IPropertyTree &resource, const char *dir)
{
    StringBuffer filepath;
    makeAbsolutePath(resource.queryProp("@filename"), dir, filepath);
    resource.setProp("@originalFilename", filepath.str());

    StringBuffer respath;
    makePathUniversal(filepath.str(), respath);
    resource.setProp("@resourcePath", respath.str());
}
开发者ID:hhy5277,项目名称:HPCC-Platform,代码行数:10,代码来源:hqlres.cpp

示例7: 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();
    }
开发者ID:eagle518,项目名称:HPCC-Platform,代码行数:54,代码来源:thkeydiff.cpp

示例8: getNavigationData

    virtual void getNavigationData(IEspContext &context, IPropertyTree & data)
    {
        data.setProp("@appName", "EclWatch");
        data.setProp("@start_page", "/WsSMC/Activity");
        IPropertyTree *folder = ensureNavFolder(data, "Clusters", NULL, NULL, false, 1);
        ensureNavLink(*folder, "Activity", "/WsSMC/Activity", "Display Activity on all target clusters in an environment", NULL, NULL, 1);
        ensureNavLink(*folder, "Scheduler", "/WsWorkunits/WUShowScheduled", "Access the ECL Scheduler to view and manage scheduled workunits or events", NULL, NULL, 2);

        IPropertyTree *folderTools = ensureNavFolder(data, "Resources", NULL, NULL, false, 8);
        ensureNavLink(*folderTools, "Browse", "/WsSMC/BrowseResources", "Browse a list of resources available for download, such as the ECL IDE, documentation, examples, etc. These are only available if optional packages are installed on the ESP Server.", NULL, NULL, 1);
    }
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:11,代码来源:ws_smcService.hpp

示例9: appendDropZones

//For every ECLWatchVisible dropzones, read: dropZoneName, directory, and, if available, computer.
//For every Servers/Server in ECLWatchVisible dropzones, read: directory,
// server name, and hostname(or IP). Create dropzone("@name", "@directory", "@computer",
// "@netAddress", "@linux", "@sourceNode") tree into pSoftware.
void CFileSpraySoapBindingEx::appendDropZones(double clientVersion, IConstEnvironment* env, const char* dfuwuidSourcePartIP, IPropertyTree* softwareTree)
{
    Owned<IConstDropZoneInfoIterator> dropZoneItr = env->getDropZoneIterator();
    ForEach(*dropZoneItr)
    {
        IConstDropZoneInfo& dropZoneInfo = dropZoneItr->query();
        if (!dropZoneInfo.isECLWatchVisible()) //This code is used by ECLWatch. So, skip the DZs not for ECLWatch.
            continue;

        SCMStringBuffer dropZoneName, directory, computerName;
        dropZoneInfo.getName(dropZoneName);
        dropZoneInfo.getDirectory(directory);
        if (!dropZoneName.length() || !directory.length())
            continue;

        bool isLinux = getPathSepChar(directory.str()) == '/' ? true : false;
        Owned<IConstDropZoneServerInfoIterator> dropZoneServerItr = dropZoneInfo.getServers();
        ForEach(*dropZoneServerItr)
        {
            IConstDropZoneServerInfo& dropZoneServer = dropZoneServerItr->query();

            StringBuffer name, server, networkAddress;
            dropZoneServer.getName(name);
            dropZoneServer.getServer(server);
            if (name.isEmpty() || server.isEmpty())
                continue;

            IPropertyTree* dropZone = softwareTree->addPropTree("DropZone", createPTree());
            dropZone->setProp("@name", dropZoneName.str());
            dropZone->setProp("@computer", name.str());
            dropZone->setProp("@directory", directory.str());
            if (isLinux)
                dropZone->setProp("@linux", "true");

            IpAddress ipAddr;
            ipAddr.ipset(server.str());
            ipAddr.getIpText(networkAddress);
            if (!ipAddr.isNull())
            {
                dropZone->addProp("@netAddress", networkAddress);

                if (!isEmptyString(dfuwuidSourcePartIP))
                {
                    IpAddress ip(dfuwuidSourcePartIP);
                    if (ip.ipequals(ipAddr))
                        dropZone->addProp("@sourceNode", "1");
                }
            }
        }
    }
}
开发者ID:richardkchapman,项目名称:HPCC-Platform,代码行数:55,代码来源:ws_fsBinding.cpp

示例10: getAttributeText

void WebServicesExtractor::getAttributeText(StringBuffer & text, const char* attributeName)
{
    const char * dot = strrchr(attributeName, '.');
    if(!dot || !dot[1])
        throw MakeStringException(3, "Please specify both module and attribute");

    OwnedHqlExpr symbol = getResolveAttributeFullPath(attributeName, LSFpublic, lookupCtx); 
    if (!symbol || !hasNamedSymbol(symbol) || !symbol->hasText()) 
    {
        StringBuffer txt;
        txt.append("Could not read attribute: ").append(attributeName);
        DBGLOG("%s", txt.str());
        throw MakeStringException(ERR_NO_ATTRIBUTE_TEXT, "%s", txt.str());
    }

    symbol->getTextBuf(text);

    /* MORE: It would be preferable if this was better integrated with hqlgram2.cpp.  It's a reasonable stopgap */
    if (archive)
    {
        StringAttr moduleName(attributeName, dot-attributeName);
        IPropertyTree * moduleTree = queryEnsureArchiveModule(archive, moduleName, NULL);
        IPropertyTree * attrTree = queryArchiveAttribute(moduleTree, dot+1);
        if (!attrTree)
        {
            attrTree = createArchiveAttribute(moduleTree, dot+1);

            const char * p = text.str();
            if (0 == strncmp(p, UTF8_BOM,3))
                p += 3;
            attrTree->setProp("", p);
        }
    }
}
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:34,代码来源:hqlesp.cpp

示例11: loadInclude

bool ResourceManifest::loadInclude(IPropertyTree &include, const char *dir)
{
    const char *filename = include.queryProp("@filename");
    StringBuffer includePath;
    makeAbsolutePath(filename, dir, includePath);

    VStringBuffer xpath("Include[@originalFilename='%s']", includePath.str());
    if (manifest->hasProp(xpath.str()))
        return false;

    include.setProp("@originalFilename", includePath.str());
    StringBuffer includeDir;
    splitDirTail(includePath, includeDir);

    Owned<IPropertyTree> manifestInclude = createPTreeFromXMLFile(includePath.str());
    Owned<IPropertyTreeIterator> it = manifestInclude->getElements("*");
    ForEach(*it)
    {
        IPropertyTree &item = it->query();
        if (streq(item.queryName(), "Resource"))
            updateResourcePaths(item, includeDir.str());
        else if (streq(item.queryName(), "Include"))
        {
            if (!loadInclude(item, includeDir.str()))
                continue;
        }
        manifest->addPropTree(item.queryName(), LINK(&item));
    }
    return true;
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:30,代码来源:hqlmanifest.cpp

示例12: createPTree

IPropertyTree *CEspBinding::addNavException(IPropertyTree &folder, const char *message/*=NULL*/, int code/*=0*/, const char *source/*=NULL*/)
{
    IPropertyTree *ret = folder.addPropTree("Exception", createPTree());
    ret->addProp("@message", message ? message : "Unknown exception");
    ret->setPropInt("@code", code);
    ret->setProp("@source", source);
    return ret;
}
开发者ID:AlexLuya,项目名称:HPCC-Platform,代码行数:8,代码来源:espprotocol.cpp

示例13: setAttributeValue

extern WORKUNIT_API void setAttributeValue(IPropertyTree & tgt, WuAttr kind, const char * value)
{
    const WuAttrInfo & info = attrInfo[kind-WANone];
    const char * path = info.graphPath;
    if (path[0] == '@')
        tgt.setProp(path, value);
    else
        addGraphAttribute(&tgt, info.childPath)->setProp("@value", value);
}
开发者ID:fnisswandt,项目名称:HPCC-Platform,代码行数:9,代码来源:wuattr.cpp

示例14: addComplexGraphEdge

void addComplexGraphEdge(IPropertyTree * graph, unsigned __int64 sourceGraph, unsigned __int64 targetGraph, unsigned __int64 sourceActivity, unsigned __int64 targetActivity, unsigned outputIndex, IAtom * kind, const char * label)
{
    StringBuffer idText;
    IPropertyTree *edge = createPTree();
    edge->setProp("@id", idText.clear().append(sourceGraph).append('_').append(targetGraph).append("_").append(outputIndex).str());
    edge->setPropInt64("@target", sourceGraph);
    edge->setPropInt64("@source", targetGraph);
    if (label)
        edge->setProp("@label", label);
    if (outputIndex)
        addGraphAttributeInt(edge, "_sourceIndex", outputIndex);

    if (kind == dependencyAtom)
        addGraphAttributeBool(edge, "_dependsOn", true);

    addGraphAttributeInt(edge, "_sourceActivity", sourceActivity);
    addGraphAttributeInt(edge, "_targetActivity", targetActivity);
    graph->addPropTree("edge", edge);
}
开发者ID:AlexLuya,项目名称:HPCC-Platform,代码行数:19,代码来源:hqlgraph.cpp

示例15: addIntraGraphEdge

IPropertyTree * addIntraGraphEdge(IPropertyTree * subGraph, unsigned __int64 source, unsigned __int64 target, unsigned outputIndex)
{
    IPropertyTree *edge = createPTree();
    edge->setPropInt64("@target", target);
    edge->setPropInt64("@source", source);

    StringBuffer s;
    edge->setProp("@id", s.append(source).append('_').append(outputIndex).str());
    return subGraph->addPropTree("edge", edge);
}
开发者ID:biddyweb,项目名称:HPCC-Platform,代码行数:10,代码来源:hqlgraph.cpp


注:本文中的IPropertyTree::setProp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。