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


C++ IOOptions::addOption方法代码示例

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


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

示例1: merge

IOOptions PostgresqlFeatureConnector::merge(const IOOptions &first, const IOOptions &second) {

    IOOptions result;
    auto end = first.end();
    for (auto it = first.begin(); it != end; ++it)
    {
        result.addOption(  it.key(), it.value());
    }

    end = second.end();
    for (auto it = second.begin(); it != end; ++it)
    {
        result.addOption(  it.key(), it.value());
    }

    return result;
}
开发者ID:MartinSchouwenburg,项目名称:IlwisTest,代码行数:17,代码来源:postgresqlfeatureconnector.cpp

示例2: connectTo

void IlwisObject::connectTo(const QUrl& outurl, const QString& format, const QString& fnamespace, ConnectorMode cmode, const IOOptions& options) {

    Locker<> lock(_mutex);
    if ( (!(cmode == cmOUTPUT)) && isReadOnly())
        return throw ErrorObject(TR(QString("format %1 or data object is readonly").arg(format)));

    QUrl url(outurl);
    if (!url.isValid()){
        url = resource(cmode).url(true);
        if ( !url.isValid()){
            ERROR2(ERR_ILLEGAL_VALUE_2, "Url","");
            throw ErrorObject(TR(QString("illegal url %1 for format %2").arg(url.toString()).arg(format)));
        }
    }
    Resource res = resource();
    if ( !res.isValid()) {
        res = Resource(url,ilwisType(), false);
        res.setId(id());
    }
    if ( url != QUrl()) {
        QString currenturl = res.url().toString();
        // we dont replace the normalized urls for internal objects if the url is pointing to the (disk based) cache
        if ( !(currenturl.indexOf(INTERNAL_CATALOG) == 0 && !outurl.isValid())){
            res.setUrl(url);

        }
        if ( url.scheme() != "ilwis") // raw urls can never go to an ilwis scheme
            res.setUrl(url,true);
        else {
            // if we are going to the internalcatalog ensure that the physical path is good
            if ( url.toString().indexOf(INTERNAL_CATALOG) == 0){
                QString rawUrl = context()->persistentInternalCatalog().toString() + "/" + res.name();
                res.setUrl(rawUrl, true);
            }
        }
    }
    const Ilwis::ConnectorFactory *factory = kernel()->factory<Ilwis::ConnectorFactory>("ilwis::ConnectorFactory");
    if ( !factory)
        throw ErrorObject(TR(QString("couldnt find factory for %1").arg(format)));
    IOOptions opt = options;
    opt.addOption("format", format);
    Ilwis::ConnectorInterface *conn = factory->createFromFormat(res, format,fnamespace,opt);
    if (!conn){
        throw ErrorObject(TR(QString("couldnt connect to %1 datasource for %2").arg(format).arg(url.toString())));
    }
    setConnector(conn, cmode, options);
}
开发者ID:52North,项目名称:IlwisCore,代码行数:47,代码来源:ilwisobject.cpp

示例3: connectTo

void IlwisObject::connectTo(const QUrl& outurl, const QString& format, const QString& fnamespace, ConnectorMode cmode, const IOOptions& options) {

    Locker<> lock(_mutex);
    if ( isReadOnly())
        return throw ErrorObject(TR(QString("format %1 or data object is readonly").arg(format)));

    QUrl url(outurl);
    if (!url.isValid()){
        url = source(cmode).url(true);
        if ( !url.isValid()){
            ERROR2(ERR_ILLEGAL_VALUE_2, "Url","");
            throw ErrorObject(TR(QString("illegal url %1 for format %2").arg(url.toString()).arg(format)));
        }
    }



    Resource resource;
    resource = mastercatalog()->id2Resource(id());
    if ( !resource.isValid()) {
        resource = Resource(url,ilwisType(), false);
        resource.setId(id());
    }
    if ( url != QUrl()) {
        QString currenturl = resource.url().toString();
        // we dont replace the normalized urls for internal objects if the url is pointing to the (disk based) cache
        if ( !(currenturl.indexOf("ilwis://internalcatalog") == 0 && !outurl.isValid()))
            resource.setUrl(url);
        resource.setUrl(url,true);
    }
    const Ilwis::ConnectorFactory *factory = kernel()->factory<Ilwis::ConnectorFactory>("ilwis::ConnectorFactory");
    if ( !factory)
        throw ErrorObject(TR(QString("couldnt find factory for %1").arg(format)));
    IOOptions opt = options;
    opt.addOption("format", format);
    Ilwis::ConnectorInterface *conn = factory->createFromFormat(resource, format,fnamespace,opt);
    if (!conn){
        throw ErrorObject(TR(QString("couldnt connect to %1 datasource for %2").arg(format).arg(url.toString())));
    }
    setConnector(conn, cmode, options);
    if ( Identity::name() == sUNDEF)
        name(resource.name());

}
开发者ID:ridoo,项目名称:IlwisCore,代码行数:44,代码来源:ilwisobject.cpp


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