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


C++ Owned::addProp方法代码示例

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


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

示例1: updateLog

bool CLoggingManager::updateLog(IEspContext* espContext, const char* option, IPropertyTree* userContext, IPropertyTree* userRequest,
    const char* backEndReq, const char* backEndResp, const char* userResp, const char* logDatasets, StringBuffer& status)
{
    if (!initialized)
        throw MakeStringException(-1,"LoggingManager not initialized");

    bool bRet = false;
    try
    {
        Owned<IPropertyTree> espContextTree;
        if (espContext)
        {
            espContextTree.setown(createPTree("ESPContext"));

            short port;
            StringBuffer sourceIP, peerStr;
            const char* esdlBindingID = espContext->queryESDLBindingID();
            espContext->getServAddress(sourceIP, port);
            espContextTree->addProp("SourceIP", sourceIP.str());
            espContext->getPeer(peerStr);
            espContextTree->addProp("Peer", peerStr.str());
            if (!isEmptyString(esdlBindingID))
                espContextTree->addProp("ESDLBindingID", esdlBindingID);
            //More information in espContext may be added to the espContextTree later.

            const char* userId = espContext->queryUserId();
            if (userId && *userId)
                espContextTree->addProp("UserName", userId);

            espContextTree->addProp("ResponseTime", VStringBuffer("%.4f", (msTick()-espContext->queryCreationTime())/1000.0));
        }
        Owned<IEspUpdateLogRequestWrap> req =  new CUpdateLogRequestWrap(nullptr, option, espContextTree.getClear(), LINK(userContext), LINK(userRequest),
            backEndReq, backEndResp, userResp, logDatasets);
        Owned<IEspUpdateLogResponse> resp =  createUpdateLogResponse();
        bRet = updateLog(espContext, *req, *resp, status);
    }
    catch (IException* e)
    {
        status.set("Failed to update log: ");
        e->errorMessage(status);
        ERRLOG("%s", status.str());
        e->Release();
    }
    return bRet;
}
开发者ID:Michael-Gardner,项目名称:HPCC-Platform,代码行数:45,代码来源:loggingmanager.cpp

示例2: createPart

    void createPart(const char *partname, const char *xml)
    {
        if (!partname || !*partname)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "No PackageMap Part name provided");
        if (!xml || !*xml)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "No PackageMap content provided");

        pmPart.setown(createPTreeFromXMLString(xml));
        if (!pmPart)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "Invalid PackageMap content");
        pmPart->addProp("@id", partname);

        StringBuffer lcPmid(pmid);
        pmid = lcPmid.toLowerCase().str();

        fixPackageMapFileIds(pmPart, checkFlag(PKGADD_PRELOAD_ALL));
    }
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:17,代码来源:ws_packageprocessService.cpp

示例3: createPart

    void createPart(const char *partname, const char *xml)
    {
        if (!partname || !*partname)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "No PackageMap Part name provided");
        if (!xml || !*xml)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "No PackageMap content provided");

        pmPart.setown(createPTreeFromXMLString(xml));
        if (!pmPart)
            throw MakeStringExceptionDirect(PKG_INFO_NOT_DEFINED, "Invalid PackageMap content");
        pmPart->addProp("@id", partname);

        StringBuffer lcPmid(pmid);
        pmid = lcPmid.toLowerCase().str();

        Owned<IPropertyTreeIterator> iter = pmPart->getElements("Package");
        ForEach(*iter)
        {
            IPropertyTree &item = iter->query();
            if (checkFlag(PKGADD_PRELOAD_ALL))
                item.setPropBool("@preload", true);
            Owned<IPropertyTreeIterator> superFiles = item.getElements("SuperFile");
            ForEach(*superFiles)
            {
                IPropertyTree &superFile = superFiles->query();
                StringBuffer lc(superFile.queryProp("@id"));
                const char *id = lc.toLowerCase().str();
                if (*id == '~')
                    id++;
                superFile.setProp("@id", id);

                Owned<IPropertyTreeIterator> subFiles = superFile.getElements("SubFile");
                ForEach(*subFiles)
                {
                    IPropertyTree &subFile = subFiles->query();
                    id = subFile.queryProp("@value");
                    if (id && *id == '~')
                    {
                        StringAttr value(id+1);
                        subFile.setProp("@value", value.get());
                    }
                }
            }
        }
    }
开发者ID:nurav,项目名称:HPCC-Platform,代码行数:45,代码来源:ws_packageprocessService.cpp

示例4: CWsEclBinding

ESP_FACTORY IEspRpcBinding * esp_binding_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
{
    if (strcmp(type, "ws_eclSoapBinding")==0)
    {
        StringBuffer xpath;
        xpath.appendf("Software/EspProcess[@name=\"%s\"]", process);
        Owned<IPropertyTree> bcfg = cfg->getPropTree(xpath.str());
        const char* cfgFile = cfg->queryProp("@config");
        if (cfgFile)
            bcfg->addProp("@config", cfgFile);
        return new CWsEclBinding(bcfg.get(), name, process);
    }
    else
    {
        throw MakeStringException(-1, "Unknown binding type %s", type);
    }

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

示例5: main

//-----------------------------------------------------
//
//-----------------------------------------------------
int main(int argc, char* argv[])
{
#ifdef _NO_LDAP
    fprintf(stderr, "System was built with _NO_LDAP\n");
    return -1;
#endif

    for (int x = 1; x < argc; x++)
    {
        if (0==strncmp("-h", argv[x], 2))
        {
            usage();
            exit(0);
        }
        else
        {
            fprintf(stderr, "\nERROR: Unrecognized parameter : '%s', enter 'initldap -h' for help\n", argv[x]);
            exit(1);
        }
    }

    InitModuleObjects();

    //execute configgen to query the LDAP Server configuration(s)
    StringBuffer cmd;
    cmd.appendf("%s%cconfiggen -env %s%c%s -listldapservers", ADMIN_DIR,PATHSEPCHAR,CONFIG_DIR, PATHSEPCHAR, ENV_XML_FILE);

    char * configBuffer = NULL;

    //acquire LDAP configuration by executing configgen and capturing output
    {
        StringBuffer configBuff;
        Owned<IPipeProcess> pipe = createPipeProcess();
        if (pipe->run("configgen", cmd.str(), ".", false, true, true, 0))
        {
            Owned<ISimpleReadStream> pipeReader = pipe->getOutputStream();
            const size32_t chunkSize = 8192;
            for (;;)
            {
                size32_t sizeRead = pipeReader->read(chunkSize, configBuff.reserve(chunkSize));
                if (sizeRead < chunkSize)
                {
                    configBuff.setLength(configBuff.length() - (chunkSize - sizeRead));
                    break;
                }
            }
            pipe->closeOutput();
        }
        int retcode = pipe->wait();
        if (retcode)
        {
            fprintf(stderr, "\nERROR %d: unable to execute %s", retcode, cmd.str());
            exit(1);
        }
        configBuffer = strdup(configBuff.str());
    }

    //Using the LDAP Server parms queried from configgen, build an
    //LDAPSecurity property tree for each LDAP Server and call the LDAP
    //Security Manager to create the needed entries
    Owned<IPropertyTree> ldapProps;
    char *saveptr;
    char * pLine = strtok_r(configBuffer, "\n", &saveptr);
    while (pLine)
    {
        if (pLine && 0==strcmp(pLine, "LDAPServerProcess"))
        {
            if (ldapProps)
                initLDAP(ldapProps);
            ldapProps.clear();
            ldapProps.setown(createPTree("ldapSecurity"));
        }
        else
        {
            char * sep = strchr(pLine, ',');
            if (sep)
            {
                *sep = (char)NULL;
                ldapProps->addProp(pLine, sep+1);
            }
        }
        pLine = strtok_r(NULL, "\n", &saveptr);
    }
    if (ldapProps)
        initLDAP(ldapProps);
    if (configBuffer)
        free(configBuffer);
    ldapProps.clear();

    releaseAtoms();
    return 0;
}
开发者ID:RogerDev,项目名称:HPCC-Platform,代码行数:95,代码来源:initldap.cpp

示例6: addRootReference

void WebServicesExtractor::addRootReference(const char * attribute)
{
    root->addProp("USES", attribute);
}
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:4,代码来源:hqlesp.cpp


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