• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ MakeStringException函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中MakeStringException函数的典型用法代码示例。如果您正苦于以下问题:C++ MakeStringException函数的具体用法?C++ MakeStringException怎么用?C++ MakeStringException使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: esp_service_factory

//when we aren't loading dynamically
// Change the function names when we stick with dynamic loading.
ESP_FACTORY IEspService * esp_service_factory(const char *name, const char* type, IPropertyTree *cfg, const char *process)
{
    if (strcmp(type, "ws_ecl")==0)
    {
        CWsEclService* service = new CWsEclService;
        service->init(name, type, cfg, process);
        return service;
    }
    else
    {
        throw MakeStringException(-1, "Unknown service type %s", type);
    }
    
    return NULL;
}
开发者ID:AlexLuya,项目名称:HPCC-Platform,代码行数:17,代码来源:ws_ecl_plugin.cpp


示例2: LZMALZDecompressToBuffer

void LZMALZDecompressToBuffer(MemoryAttr & out, MemoryBuffer & in)
{
    size32_t expsz;
    size32_t cmpsz;
    in.read(expsz).read(cmpsz);
    void *o = out.allocate(expsz);
    if (cmpsz!=expsz) {
        CLZMA lzma;
        size32_t written = lzma.expand(in.readDirect(cmpsz),cmpsz,o,expsz);
        if (written!=expsz)
            throw MakeStringException(0, "fastLZDecompressToBuffer - corrupt data(4) %d %d",written,expsz);
    }
    else
        memcpy(o,in.readDirect(cmpsz),expsz);
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:15,代码来源:jlzma.cpp


示例3: MakeStringException

void CWsPackageProcessEx::getPkgInfoById(const char *packageMapId, IPropertyTree* tree)
{
    if (!packageMapId || !*packageMapId)
        return;

    Owned<IPropertyTree> packageMaps = packageMapAndSet.getPackageMaps();
    if (!packageMaps)
        throw MakeStringException(PKG_DALI_LOOKUP_ERROR, "Unable to retrieve information about package maps from dali server");

    StringBuffer xpath;
    xpath.append("PackageMap[@id='").append(packageMapId).append("']");
    IPropertyTree *mapTree = packageMaps->queryPropTree(xpath);
    if (mapTree)
        mergePTree(tree, mapTree);
}
开发者ID:ruidafu,项目名称:HPCC-Platform,代码行数:15,代码来源:ws_packageprocessService.cpp


示例4: MakeStringException

IClientWsEclResp* CClientWsEclService::sendHttpRequest(IClientWsEclRequest* request, const char* method, const char* URL, 
                                                                                    const char *user, const char *pw, const char *realm,
                                                                                    const char* httpPostVariableName, bool encodeHttpPostBody)
{
    if(strlen(URL) == 0)
        throw MakeStringException(-1, "url not set");

    CClientWsEclRequest* eclrequest = dynamic_cast<CClientWsEclRequest*>(request);
    Owned<CClientWsEclResponse> eclresponse = new CClientWsEclResponse;
    eclresponse->setRequestId(m_reqId);
    m_reqId++;

    eclrequest->sendHttpRequest(*eclresponse, method, URL, user, pw, realm, httpPostVariableName, encodeHttpPostBody);
    return eclresponse.getClear();
}
开发者ID:HPCCSmoketest,项目名称:HPCC-Platform,代码行数:15,代码来源:ws_ecl_client.cpp


示例5: LZMADecompressToAttr

void LZMADecompressToAttr(MemoryAttr & out, const void * src)
{
    size32_t *sz = (size32_t *)src;
    size32_t expsz = *(sz++);
    size32_t cmpsz = *(sz++);
    void *o = out.allocate(expsz);
    if (cmpsz!=expsz) {
        CLZMA lzma;
        size32_t written = lzma.expand(sz,cmpsz,o,expsz);
        if (written!=expsz)
            throw MakeStringException(0, "fastLZDecompressToBuffer - corrupt data(2) %d %d",written,expsz);
    }
    else
        memcpy(o,sz,expsz);
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:15,代码来源:jlzma.cpp


示例6: getWorkunitFactory

static IWorkUnitFactory * getWorkunitFactory(ICodeContext * ctx)
{
    IEngineContext *engineCtx = ctx->queryEngineContext();
    if (engineCtx && !engineCtx->allowDaliAccess())
    {
        Owned<IException> e = MakeStringException(-1, "workunitservices cannot access Dali in this context - this normally means it is being called from a thor slave");
        EXCLOG(e, NULL);
        throw e.getClear();
    }

    //MORE: These should really be set up correctly - probably should be returned from IEngineContext
    ISecManager *secmgr = NULL;
    ISecUser *secuser = NULL;
    return getWorkUnitFactory(secmgr, secuser);
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:15,代码来源:workunitservices.cpp


示例7: xpath

bool CWsLoggingServiceEx::init(const char* service, const char* type, IPropertyTree* cfg, const char* process)
{
    VStringBuffer xpath("Software/EspProcess[@name=\"%s\"]/EspService[@name=\"%s\"]", process, service);
    Owned<IPropertyTree> pServiceNode = cfg->getPropTree(xpath.str());
    if (!pServiceNode)
        throw MakeStringException(-1, "No settings found for service %s", service);

    Owned<IPropertyTreeIterator> logAgents = pServiceNode->getElements("LogAgent");
    if (!logAgents)
        throw MakeStringException(-1, "No logAgent is defined for service %s", service);

    ForEach(*logAgents)
    {
        IPropertyTree& ptree = logAgents->query();
        const char* agentName = ptree.queryProp("@name");
        const char* agentType = ptree.queryProp("@type");
        const char* agentPlugin = ptree.queryProp("@plugin");
        if (!agentName || !*agentName || !agentPlugin || !*agentPlugin)
            continue;

        IEspLogAgent* logAgent = loadLoggingAgent(agentName, agentPlugin);
        if (!logAgent)
        {
            ERRLOG(-1, "Failed to create logging agent for %s", agentName);
            continue;
        }
        logAgent->init(agentName, agentType, &ptree, process);
        IUpdateLogThread* logThread = createUpdateLogThread(&ptree, service, agentName, logAgent);
        if(!logThread)
            throw MakeStringException(-1, "Failed to create update log thread for %s", agentName);

        loggingAgentThreads.push_back(logThread);
    }

    return true;
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:36,代码来源:loggingservice.cpp


示例8: MakeStringException

/**************************************************************************
 *  CSecureHttpProtocol Implementation                                    *
 **************************************************************************/
CSecureHttpProtocol::CSecureHttpProtocol(IPropertyTree* cfg)
{
    m_maxConcurrentThreads = 0;

    if(cfg != NULL)
    {
        m_config.setown(cfg);

        //ensure keys are specified. Passphrase is optional
        StringBuffer sb;
        cfg->getProp("certificate", sb);
        if(sb.length() == 0)
        {
            throw MakeStringException(-1, "certificate file not specified in config file");
        }

        cfg->getProp("privatekey", sb.clear());
        if(sb.length() == 0)
        {
            throw MakeStringException(-1, "private key file not specified in config file");
        }

        createSecureSocketContextEx2_t xproc = NULL;
        IEspPlugin *pplg = loadPlugin(SSLIB);
        if (pplg)
            xproc = (createSecureSocketContextEx2_t) pplg->getProcAddress("createSecureSocketContextEx2");
        else
            throw MakeStringException(-1, "dll/shared-object %s can't be loaded", SSLIB);


        if (xproc)
            m_ssctx.setown(xproc(cfg, ServerSocket));
        else
            throw MakeStringException(-1, "procedure createSecureSocketContextEx2 can't be loaded");
    }
}
开发者ID:AttilaVamos,项目名称:HPCC-Platform,代码行数:39,代码来源:httpprot.cpp


示例9: createEclPlusHelper

IEclPlusHelper * createEclPlusHelper(IProperties * globals)
{
    // Check to see what kind of helper to return !
    IFormatType * format = createFormatter(globals);
    IEclPlusHelper * helper = NULL;
    if(globals->hasProp("action"))
    {
        const char * action = globals->queryProp("action");
        if(!stricmp(action, "list"))
        {
            helper = new ListHelper(LINK(globals), format);
        }
        // Now re-enable delete
        else if(!stricmp(action, "delete"))
        {
            helper = new DeleteHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "dump"))
        {
            helper = new DumpHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "graph"))
        {
            helper = new GraphHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "view"))
        {
            helper = new ViewHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "query"))
        {
            helper = new QueryHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "abort"))
        {
            helper = new AbortHelper(LINK(globals), format);
        }
        else if(!stricmp(action, "rerun"))
        {
            helper = new RerunHelper(LINK(globals), format);
        }
        else
        {
            throw MakeStringException(-1, "unknown action");
        }
    }
    return helper;
}
开发者ID:AlexLuya,项目名称:HPCC-Platform,代码行数:48,代码来源:eclplus.cpp


示例10: finalizeOptions

    bool finalizeOptions(IProperties *globals)
    {
        if (optInput.length())
        {
            const char *in = optInput.get();
            while (*in && isspace(*in)) in++;
            if (*in!='<')
            {
                StringBuffer content;
                content.loadFile(in);
                optInput.set(content.str());
            }
        }

        if (!optVersionStr.isEmpty())
        {
            optVersion = atof( optVersionStr.get() );
            if( optVersion <= 0 )
            {
                throw MakeStringException( 0, "Version option must be followed by a real number > 0" );
            }
        }
        else
            throw MakeStringException( 0, "ESDL service definition version must be provided!" );

        if(optTargetESPProcName.isEmpty())
            throw MakeStringException( 0, "Name of Target ESP process must be provided" );

        if (optService.isEmpty())
            throw MakeStringException( 0, "Name of ESDL based service must be provided" );

        if (optWSProcAddress.isEmpty())
            throw MakeStringException( 0, "Server address of ESDL process server must be provided" );

        if (optWSProcPort.isEmpty())
            throw MakeStringException( 0, "Port on which ESDL process is listening must be provided" );

        if (optMethod.isEmpty())
            throw MakeStringException( 0, "Name of ESDL based method must be provided" );

        if (optBindingName.isEmpty())
            throw MakeStringException( 0, "Name of ESP binding must be provided" );

        return true;
    }
开发者ID:SAB2012,项目名称:HPCC-Platform,代码行数:45,代码来源:esdl-publish.cpp


示例11: b

NamedMutex::NamedMutex(const char *name)
{
    {
        CriticalBlock b(lockPrefixCS);
        if (0 == lockPrefix.length())
        {
            if (!getConfigurationDirectory(NULL, "lock", NULL, NULL, lockPrefix))
                throw MakeStringException(0, "Failed to get lock directory from environment");
        }
        addPathSepChar(lockPrefix);
        lockPrefix.append("JLIBMUTEX_");
    }
    StringBuffer tmp(lockPrefix);
    tmp.append("JLIBMUTEX_").append(name);
    mutexfname = tmp.detach();
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:16,代码来源:jmutex.cpp


示例12: MakeStringException

IClientWsEclResp* CClientWsEclService::search(IClientWsEclRequest* request)
{
    if(strlen(m_url) == 0)
    {
        throw MakeStringException(-1, "url not set");
    }

    CClientWsEclRequest* eclrequest = dynamic_cast<CClientWsEclRequest*>(request);
    Owned<CClientWsEclResponse> eclresponse = new CClientWsEclResponse;
    eclresponse->setRequestId(m_reqId);
    
    m_reqId++;
    
    eclrequest->post(m_url, *eclresponse);

    return eclresponse.getClear();
}
开发者ID:EwokVillage,项目名称:HPCC-Platform,代码行数:17,代码来源:ws_ecl_client.cpp


示例13: appendException

void ParseErrorHandler::handleSAXParserException(const SAXParseException& e, const char* errorType)
{
    char systemId[256], publicId[256];

    XMLString::transcode(e.getSystemId(),systemId,255);
    XMLString::transcode(e.getPublicId(),publicId,255);
    char* message = XMLString::transcode(e.getMessage());

    StringBuffer msg, line,col;
    line.appendlong(e.getLineNumber());
    col.appendlong(e.getColumnNumber());
    msg.appendf("%s at \"%s\", line %s, char %s:  %s", errorType,
                (publicId&&publicId[0]) ? publicId : systemId, line.str(), col.str(), message);
    appendException(MakeStringException(-1,"%s", msg.str()));

    XMLString::release(&message);
}
开发者ID:rclakmal,项目名称:HPCC-Platform,代码行数:17,代码来源:xerces_validator.cpp


示例14: MakeStringException

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


示例15: CassandraClusterSession

void CCassandraLogAgent::initKeySpace()
{
    //Initialize Cassandra Cluster Session
    cassSession.setown(new CassandraClusterSession(cass_cluster_new()));
    if (!cassSession)
        throw MakeStringException(-1,"Unable to create cassandra cassSession session");

    setSessionOptions(NULL);

    //ensure defaultDB
    ensureDefaultKeySpace();

    //ensure transSeed tables
    ensureTransSeedTable();

    //Read logging transaction seed
    queryTransactionSeed(loggingTransactionApp.get(), loggingTransactionSeed);
}
开发者ID:Michael-Gardner,项目名称:HPCC-Platform,代码行数:18,代码来源:cassandralogagent.cpp


示例16: queryDistributedFileDirectory

void LogicFileWrapper::FindClusterName(const char* logicalName, StringBuffer& returnCluster, IUserDescriptor* udesc)
{
    try {
        Owned<IDistributedFile> df = queryDistributedFileDirectory().lookup(logicalName, udesc) ;
        if(!df)
            throw MakeStringException(-1,"Could not find logical file");
        df->getClusterName(0,returnCluster);    // ** TBD other cluster
    }
    catch(IException* e){   
      StringBuffer msg;
      e->errorMessage(msg);
        WARNLOG("%s", msg.str());
        e->Release();
    }
    catch(...){
        WARNLOG("Unknown Exception thrown within LogicFileWrapper::FindClusterName");
    }
}
开发者ID:AsherBond,项目名称:HPCC-Platform,代码行数:18,代码来源:LogicFileWrapper.cpp


示例17: MakeStringException

bool Cws_machineEx::onStartStop( IEspContext &context, IEspStartStopRequest &req, 
                                         IEspStartStopResponse &resp)
{
    try
    {
        if (!context.validateFeatureAccess(EXEC_FEATURE_URL, SecAccess_Full, false))
            throw MakeStringException(ECLWATCH_EXECUTION_ACCESS_DENIED, "Permission denied.");

        char* userName = (char*) m_sTestStr1.str();
        char* password = (char*) m_sTestStr2.str();
        doStartStop(context, req.getAddresses(), userName, password, req.getStop(), resp);
    }
    catch(IException* e)
    {   
        FORWARDEXCEPTION(context, e,  ECLWATCH_INTERNAL_ERROR);
    }
    return true;
}
开发者ID:hszander,项目名称:HPCC-Platform,代码行数:18,代码来源:ws_machineServiceRexec.cpp


示例18: loadSecManager

    static ISecManager* loadSecManager(const char* model_name, const char* servicename, IPropertyTree* cfg)
    {
        if(model_name && stricmp(model_name, "LdapSecurity") == 0)
        {
            HINSTANCE ldapseclib = LoadSharedObject(LDAPSECLIB, true, false);
            if(ldapseclib == NULL)
                throw MakeStringException(-1, "can't load library %s", LDAPSECLIB);
            
            newSecManager_t_ xproc = NULL;
            xproc = (newSecManager_t_)GetSharedProcedure(ldapseclib, "newLdapSecManager");

            if (xproc)
                return xproc(servicename, *cfg);
            else
                throw MakeStringException(-1, "procedure newLdapSecManager of %s can't be loaded", LDAPSECLIB);
        }
        else if(model_name && stricmp(model_name, "Local") == 0)
        {
            HINSTANCE ldapseclib = LoadSharedObject(LDAPSECLIB, true, false);
            if(ldapseclib == NULL)
                throw MakeStringException(-1, "can't load library %s", LDAPSECLIB);
            
            newSecManager_t_ xproc = NULL;
            xproc = (newSecManager_t_)GetSharedProcedure(ldapseclib, "newLocalSecManager");

            if (xproc)
                return xproc(servicename, *cfg);
            else
                throw MakeStringException(-1, "procedure newLocalSecManager of %s can't be loaded", LDAPSECLIB);
        }
        else if(model_name && stricmp(model_name, "Default") == 0)
        {
            HINSTANCE ldapseclib = LoadSharedObject(LDAPSECLIB, true, false);
            if(ldapseclib == NULL)
                throw MakeStringException(-1, "can't load library %s", LDAPSECLIB);
            
            newSecManager_t_ xproc = NULL;
            xproc = (newSecManager_t_)GetSharedProcedure(ldapseclib, "newDefaultSecManager");

            if (xproc)
                return xproc(servicename, *cfg);
            else
                throw MakeStringException(-1, "procedure newDefaultSecManager of %s can't be loaded", LDAPSECLIB);
        }
        else
            throw MakeStringException(-1, "Security model %s not supported", model_name?model_name:"UNKNOWN");
    }   
开发者ID:afishbeck,项目名称:HPCC-Platform,代码行数:47,代码来源:secloader.hpp


示例19: getBuiltIn

void CEspConfig::loadService(srv_cfg &xcfg)
{
    esp_service_factory_t xproc = NULL;
    builtin *pdirect = getBuiltIn(xcfg.plugin.str());
    if (pdirect)
        xproc = pdirect->serv;
    else
    {
        Owned<IEspPlugin> pplg = getPlugin(xcfg.plugin.str());
        if (pplg)
            xproc = (esp_service_factory_t) pplg->getProcAddress("esp_service_factory");
    }

    if (xproc)
        xcfg.srv.setown(xproc(xcfg.name.str(), xcfg.type.str(), m_envpt.get(), m_process.str()));
    else
        throw MakeStringException(-1, "procedure esp_service_factory can't be loaded");
}
开发者ID:Josh-Googler,项目名称:HPCC-Platform,代码行数:18,代码来源:espcfg.cpp


示例20: createFormatter

IFormatType * createFormatter(IProperties * globals)
{
    // Create a formatter
    IFormatType * format;
    if(globals->hasProp("format"))
    {
        const char * fmt = globals->queryProp("format");
        
        if(!fmt || !*fmt || !stricmp(fmt, "default"))
        {
            format = new DefaultFormatType();
        }
        else if(!stricmp(fmt, "csvh"))
        {
            format = new CSVHFormatType();
        }
        else if(!stricmp(fmt, "csv"))
        {
            format = new CSVFormatType();
        }
        else if(!stricmp(fmt, "runecl"))
        {
            format = new RuneclFormatType();
        }
        else if(!stricmp(fmt, "xml"))
        {
            format = new XmlFormatType();
        }
        else if(!stricmp(fmt, "bin") || !stricmp(fmt, "binary"))
        {
            format = new BinFormatType;
        }
        else
        {
            throw MakeStringException(-1, "format %s not supported", fmt);
        }
    }
    else
    {
        format = new DefaultFormatType();
    }
    return format;
}
开发者ID:AsherBond,项目名称:HPCC-Platform,代码行数:43,代码来源:eclplus.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ MakeTransactionRef函数代码示例发布时间:2022-05-30
下一篇:
C++ MakeString函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap