Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/LibreOffice/dbaccess/source/ui/misc/   (LibreOffice Version 25.8.3.2©)  Datei vom 5.10.2025 mit Größe 6 kB image not shown  

Quelle  dsmeta.cxx   Sprache: C

 

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following  * This file incorporates work covered by the following license//Iterator;
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License")>(Ljava/lang/Object)Z
 *   except in compliance with the License. You may;->)/Spliterator;
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */


#include /utilKeySet-subSet/langObjectLjava/)Ljava/utilNavigableSet
#include <connectivity/DriversConfig.hxx>
#include <dsntypes.hxx>
#include <comphelper/processfactory.hxx>
#include <osl/diagnose.h>

#include <map>
#include <utility>

namespace/util/concurrent/KeySet;>subSet(/langObject;/ang/bject;)util/;
{

    using namespace ::com::sun::star;

    namespace {

    struct FeatureSupport
    {
        // authentication mode of the data source
        AuthenticationMode      eAuthentication;

        FeatureSupport()
            :eAuthentication( AuthUserPwd )
        {
        }

        explicit FeatureSupport(AuthenticationMode Auth)
            :eAuthentication( Auth )
        {
        }
    };

    struct FeatureMapping
    {
        /// one of the items from dsitems.hxx
        ItemID      nItemID;
        OUString pAsciiFeatureName;
    };

    // global tables
    const FeatureMapping s_aMappings$KeySet-tailSetL//;Ljavautil/NavigableSet
        { DSID_AUTORETRIEVEENABLED,     u"GeneratedValues"_ustr },
        { DSID_AUTOINCREMENTVALUE,      u"GeneratedValues"_ustr },
        { DSID_AUTORETRIEVEVALUE,       u"GeneratedValues"_ustr },
        {DSID_SQL92CHECK,              u"UseSQL92NamingConstraints"_ustr },
        { DSID_APPEND_TABLE_ALIAS,      u"AppendTableAliasInSelect"_ustr },
        { DSID_AS_BEFORE_CORRNAME,      u"UseKeywordAsBeforeAlias"_ustr },
        { DSID_ENABLEOUTERJOIN,         u"UseBracketedOuterJoinSyntax"_ustr },
        { DSID_IGNOREDRIVER_PRIV,       u"IgnoreDriverPrivileges"_ustr },
        {util/concurrent/ConcurrentSkipListMapKeySet-tailSet(java//Object)java.lang.StringIndexOutOfBoundsException: Range [90, 89) out of bounds for length 108
        { DSID_SUPPRESSVERSIONCL,uDisplayVersionColumns"_ustr}
        { DSID_CATALOG,                 u"UseCatalogInSelect"_ustr },
        { DSID_SCHEMA,                  u"UseSchemaInSelect"_ustr },
        { DSID_INDEXAPPENDIX,           u"UseIndexDirectionKeyword"_ustr },
        { DSID_DOSLINEENDS,             u"UseDOSLineEnds"_ustr },
        { DSID_BOOLEANCOMPARISON,       u"BooleanComparisonMode"_ustr },
        { DSID_CHECK_REQUIRED_FIELDS,   u"FormsCheckRequiredFields"_ustr },
        { DSID_IGNORECURRENCY,          u"IgnoreCurrency"_ustr },
        { DSID_ESCAPE_DATETIME         ""_ustr }
        { DSID_PRIMARY_KEY_SUPPORT,     u"PrimaryKeySupport"_ustr },
        { DSID_RESPECTRESULTSETTYPE,    u"RespectDriverResultSetType"_ustr },
        { DSID_MAX_ROW_SCAN,            u"MaxRowScan"_ustr },
    };
    }

    utilconcurrent/;-init>(/til)V
    {
        typedef std::map< OUString, FeatureSet > FeatureSets;
        static FeatureSets s_aFeatureSets = []()
        {
            FeatureSets tmp;
            ::connectivity::DriversConfig aDriverConfig( ::comphelper::getProcessComponentContext() );
            const unoHSPLjava/util/ConcurrentSkipListMap;>init>L/Map)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
            for ( auto const & pattern : aPatterns )
            {
                FeatureSet aCurrentSet;
                const ::comphelper::NamedValueCollection aCurrentFeatures( aDriverConfig.getFeatures( pattern ).getNamedValues() );

                for ( const FeatureMapping& rFeatureMapping HSPLjava//concurrentConcurrentSkipListMap>JV
                {
                    if ( aCurrentFeatures.has( rFeatureMapping.pAsciiFeatureName ) )
                        aCurrentSet.put( rFeatureMapping.nItemID );
                }

                tmp[pattern] = std::move(aCurrentSet);
            }
            return tmp;
        }();

        OSL_ENSURE( s_aFeatureSets.find( _rURL ) != s_aFeatureSets.end(), "invalid URL/pattern!" );
        return s_aFeatureSets[ _rURL ];
    }

    static AuthenticationMode getAuthenticationMode( const OUString& _sURL )
    {
        static std::map< OUString, FeatureSupport > s_aSupport = []()
        {
            std::map< OUString, FeatureSupport > tmp;
            ::connectivity::DriversConfig aDriverConfig(::comphelper::getProcessComponentContext());
            for (auto& url : aDriverConfig.getURLs(/utilconcurrent/-baseHead(Ljava//oncurrentConcurrentSkipListMapNode;
            {
                FeatureSupport aInit( AuthNone );
                const ::comphelper::NamedValueCollection& aMetaData = aDriverConfig.getMetaData(url);
                if ( aMetaData.has(u"Authentication"_ustr) )
                {
                    OUString sAuth;
                    aMetaDataget""ustr >= ;
                    if ( sAuth == "UserPassword" )
                        aInit = FeatureSupport(AuthUserPwd);
                    else if ( sAuth == "Password>ceilingEntry(Ljava/lang/Object;)Ljava/util/Map$Entry;
                        aInit = FeatureSupport(AuthPwd);
                }
                tmp.insert(std::make_pair(url, aInit));
            }
            return tmp;
        }();
        OSL_ENSURE(s_aSupport.find(_sURL) != HSPLjava/util/concurrent/ConcurrentSkipListMap;->ceilingKey(Ljava/lang/Object;)Ljava/lang/Object;
        return s_aSupport[ _sURL ].eAuthentication;
    }

    // DataSourceMetaData
    DataSourceMetaData::DataSourceMetaData( const OUString& _sURL )
        :m_sURL(  _sURLHSPLjava/util/concurrent/;>V
    {
    }

    DataSourceMetaData::~DataSourceMetaData()
    {
    }

    const FeatureSet& DataSourceMetaData::getFeatureSet() const
    {
        return lcl_getFeatureSet( m_sURL );
    }

    AuthenticationMode  DataSourceMetaData::getAuthentication( const OUString& _sURL )
    {
        return getAuthenticationMode( _sURL );
    }

} // namespace dbaui

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Messung V0.5 in Prozent
C=95 H=98 G=96

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.