LibreOffice Module dbaccess (master) 1
|
#include <dsntypes.hxx>
Public Member Functions | |
ODsnTypeCollection (const css::uno::Reference< css::uno::XComponentContext > &_xContext) | |
~ODsnTypeCollection () | |
OUString | getTypeDisplayName (std::u16string_view _sURL) const |
get the datasource type display name from a DSN string More... | |
OUString | cutPrefix (std::u16string_view _sURL) const |
on a given string, cut the type prefix and return the result More... | |
OUString | getPrefix (std::u16string_view _sURL) const |
on a given string, return the type prefix More... | |
bool | hasDriver (const char *_pAsciiPattern) const |
determines whether there is a driver for the given URL prefix/pattern More... | |
OUString | getJavaDriverClass (std::u16string_view _sURL) const |
on a given string, return the Java Driver Class More... | |
OUString | getMediaType (std::u16string_view _sURL) const |
returns the media type of a file based database More... | |
OUString | getDatasourcePrefixFromMediaType (std::u16string_view _sMediaType, std::u16string_view _sExtension) |
returns the dsn prefix for a given media type More... | |
void | extractHostNamePort (const OUString &_rDsn, OUString &_sDatabaseName, OUString &_rHostname, sal_Int32 &_nPortNumber) const |
bool | supportsTableCreation (std::u16string_view _sURL) const |
check if the given data source allows creation of tables More... | |
bool | supportsColumnDescription (std::u16string_view _sURL) const |
check if the given data source allows to show column description. More... | |
bool | supportsBrowsing (std::u16string_view _sURL) const |
bool | supportsDBCreation (std::u16string_view _sURL) const |
bool | isFileSystemBased (std::u16string_view _sURL) const |
check if the given data source type is based on the file system - i.e. the URL is a prefix plus a file URL More... | |
bool | isConnectionUrlRequired (std::u16string_view _sURL) const |
css::uno::Sequence< css::beans::PropertyValue > | getDefaultDBSettings (std::u16string_view _sURL) const |
returns default settings for newly created databases of the given type. More... | |
TypeIterator | begin () const |
get access to the first element of the types collection More... | |
TypeIterator | end () const |
get access to the (last + 1st) element of the types collection More... | |
void | fillPageIds (std::u16string_view _sURL, std::vector< sal_Int16 > &_rOutPathIds) const |
DATASOURCE_TYPE | determineType (std::u16string_view _rDsn) const |
sal_Int32 | getIndexOf (std::u16string_view _sURL) const |
sal_Int32 | size () const |
OUString | getType (std::u16string_view _sURL) const |
TypeIterator (const TypeIterator &_rSource) | |
~TypeIterator () | |
OUString const & | getURLPrefix () const |
OUString const & | getDisplayName () const |
const TypeIterator & | operator++ () |
prefix increment More... | |
Static Public Member Functions | |
static bool | isEmbeddedDatabase (std::u16string_view _sURL) |
checks if the given data source type embeds its data into the database document More... | |
static OUString | getEmbeddedDatabase () |
static bool | isShowPropertiesEnabled (const OUString &_sURL) |
Protected Member Functions | |
TypeIterator (const ODsnTypeCollection *_pContainer, sal_Int32 _nInitialPos) | |
Protected Attributes | |
const ODsnTypeCollection * | m_pContainer |
sal_Int32 | m_nPosition |
Private Attributes | |
std::vector< OUString > | m_aDsnTypesDisplayNames |
std::vector< OUString > | m_aDsnPrefixes |
user readable names for the datasource types More... | |
::connectivity::DriversConfig | m_aDriverConfig |
DSN prefixes which determine the type of a datasource. More... | |
sal_Int32 | m_nLivingIterators |
Friends | |
class | ODsnTypeCollection::TypeIterator |
class | ODsnTypeCollection |
bool OOO_DLLPUBLIC_DBA | operator== (const TypeIterator &lhs, const TypeIterator &rhs) |
bool OOO_DLLPUBLIC_DBA | operator!= (const TypeIterator &lhs, const TypeIterator &rhs) |
Definition at line 104 of file dsntypes.hxx.
dbaccess::ODsnTypeCollection::ODsnTypeCollection | ( | const css::uno::Reference< css::uno::XComponentContext > & | _xContext | ) |
Definition at line 53 of file dsntypes.cxx.
References _xContext, connectivity::DriversConfig::getDriverTypeDisplayName(), connectivity::DriversConfig::getURLs(), if(), m_aDriverConfig, m_aDsnPrefixes, and m_aDsnTypesDisplayNames.
dbaccess::ODsnTypeCollection::~ODsnTypeCollection | ( | ) |
Definition at line 72 of file dsntypes.cxx.
References m_nLivingIterators.
dbaccess::ODsnTypeCollection::~TypeIterator | ( | ) |
|
inline |
get access to the first element of the types collection
Definition at line 216 of file dsntypes.hxx.
References TypeIterator().
Referenced by dbaui::OGeneralPageWizard::initializeEmbeddedDBList(), dbaui::OGeneralPage::initializeTypeList(), and dbaui::ODbTypeWizDialogSetup::ODbTypeWizDialogSetup().
OUString dbaccess::ODsnTypeCollection::cutPrefix | ( | std::u16string_view | _sURL | ) | const |
on a given string, cut the type prefix and return the result
Definition at line 84 of file dsntypes.cxx.
References m_aDsnPrefixes, o3tl::make_unsigned(), WildCard::Matches(), prefix, comphelper::string::stripEnd(), and comphelper::string::stripStart().
Referenced by dbaxml::ODBExport::exportConnectionData(), extractHostNamePort(), dbaui::ODbDataSourceAdministrationHelper::getConnectionURL(), dbaui::OApplicationController::GetState(), dbaui::OConnectionHelper::impl_setURL(), and dbaui::OConnectionURLEdit::SetText().
DATASOURCE_TYPE dbaccess::ODsnTypeCollection::determineType | ( | std::u16string_view | _rDsn | ) | const |
Definition at line 299 of file dsntypes.cxx.
References dbaccess::DST_ADO, dbaccess::DST_CALC, dbaccess::DST_DBASE, dbaccess::DST_EMBEDDED_FIREBIRD, dbaccess::DST_EMBEDDED_HSQLDB, dbaccess::DST_EMBEDDED_UNKNOWN, dbaccess::DST_EVOLUTION, dbaccess::DST_EVOLUTION_GROUPWISE, dbaccess::DST_EVOLUTION_LDAP, dbaccess::DST_FIREBIRD, dbaccess::DST_FLAT, dbaccess::DST_JDBC, dbaccess::DST_KAB, dbaccess::DST_LDAP, dbaccess::DST_MACAB, dbaccess::DST_MOZILLA, dbaccess::DST_MSACCESS, dbaccess::DST_MSACCESS_2007, dbaccess::DST_MYSQL_JDBC, dbaccess::DST_MYSQL_NATIVE, dbaccess::DST_MYSQL_NATIVE_DIRECT, dbaccess::DST_MYSQL_ODBC, dbaccess::DST_ODBC, dbaccess::DST_ORACLE_JDBC, dbaccess::DST_OUTLOOK, dbaccess::DST_OUTLOOKEXP, dbaccess::DST_POSTGRES, dbaccess::DST_THUNDERBIRD, dbaccess::DST_UNKNOWN, dbaccess::DST_WRITER, eType, match(), sPrefix, comphelper::string::stripEnd(), and u.
Referenced by dbaui::ODbTypeWizDialogSetup::activateDatabasePath(), dbaui::OGeneralPage::approveDatasourceType(), dbaui::OConnectionTabPage::checkTestConnection(), dbaui::OConnectionTabPageSetup::checkTestConnection(), dbaui::OConnectionHelper::commitURL(), dbaui::ODbDataSourceAdministrationHelper::convertUrl(), dbaui::ODbTypeWizDialog::determineNextState(), dbaxml::ODBExport::exportConnectionData(), dbaui::OConnectionTabPage::FillItemSet(), fillPageIds(), dbaui::ODbDataSourceAdministrationHelper::getConnectionURL(), dbaui::ODbAdminDialog::impl_resetPages(), dbaui::ODbAdminDialog::impl_selectDataSource(), dbaui::OConnectionHelper::implInitControls(), dbaui::OConnectionTabPage::implInitControls(), and dbaui::OConnectionTabPageSetup::implInitControls().
|
inline |
get access to the (last + 1st) element of the types collection
Definition at line 217 of file dsntypes.hxx.
References m_aDsnTypesDisplayNames, and TypeIterator().
Referenced by dbaui::OGeneralPageWizard::initializeEmbeddedDBList(), dbaui::OGeneralPage::initializeTypeList(), and dbaui::ODbTypeWizDialogSetup::ODbTypeWizDialogSetup().
void dbaccess::ODsnTypeCollection::extractHostNamePort | ( | const OUString & | _rDsn, |
OUString & | _sDatabaseName, | ||
OUString & | _rHostname, | ||
sal_Int32 & | _nPortNumber | ||
) | const |
Definition at line 202 of file dsntypes.cxx.
References cutPrefix(), and comphelper::string::getTokenCount().
Referenced by dbaui::ODbDataSourceAdministrationHelper::convertUrl(), dbaxml::ODBExport::exportConnectionData(), and dbaui::OApplicationController::GetState().
void dbaccess::ODsnTypeCollection::fillPageIds | ( | std::u16string_view | _sURL, |
std::vector< sal_Int16 > & | _rOutPathIds | ||
) | const |
Definition at line 413 of file dsntypes.cxx.
References determineType(), dbaccess::DST_ADO, dbaccess::DST_CALC, dbaccess::DST_DBASE, dbaccess::DST_EMBEDDED_FIREBIRD, dbaccess::DST_EMBEDDED_HSQLDB, dbaccess::DST_EMBEDDED_UNKNOWN, dbaccess::DST_EVOLUTION, dbaccess::DST_EVOLUTION_GROUPWISE, dbaccess::DST_EVOLUTION_LDAP, dbaccess::DST_FLAT, dbaccess::DST_JDBC, dbaccess::DST_KAB, dbaccess::DST_LDAP, dbaccess::DST_MACAB, dbaccess::DST_MOZILLA, dbaccess::DST_MSACCESS, dbaccess::DST_MSACCESS_2007, dbaccess::DST_MYSQL_JDBC, dbaccess::DST_MYSQL_NATIVE, dbaccess::DST_MYSQL_ODBC, dbaccess::DST_ODBC, dbaccess::DST_ORACLE_JDBC, dbaccess::DST_OUTLOOK, dbaccess::DST_OUTLOOKEXP, dbaccess::DST_POSTGRES, dbaccess::DST_THUNDERBIRD, dbaccess::DST_WRITER, eType, PAGE_DBSETUPWIZARD_ADO, PAGE_DBSETUPWIZARD_DBASE, PAGE_DBSETUPWIZARD_DOCUMENT_OR_SPREADSHEET, PAGE_DBSETUPWIZARD_JDBC, PAGE_DBSETUPWIZARD_LDAP, PAGE_DBSETUPWIZARD_MSACCESS, PAGE_DBSETUPWIZARD_MYSQL_INTRO, PAGE_DBSETUPWIZARD_MYSQL_JDBC, PAGE_DBSETUPWIZARD_MYSQL_NATIVE, PAGE_DBSETUPWIZARD_MYSQL_ODBC, PAGE_DBSETUPWIZARD_ODBC, PAGE_DBSETUPWIZARD_ORACLE, PAGE_DBSETUPWIZARD_POSTGRES, PAGE_DBSETUPWIZARD_TEXT, and PAGE_DBSETUPWIZARD_USERDEFINED.
Referenced by dbaui::ODbTypeWizDialogSetup::ODbTypeWizDialogSetup().
OUString dbaccess::ODsnTypeCollection::getDatasourcePrefixFromMediaType | ( | std::u16string_view | _sMediaType, |
std::u16string_view | _sExtension | ||
) |
returns the dsn prefix for a given media type
Definition at line 159 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), connectivity::DriversConfig::getURLs(), m_aDriverConfig, and comphelper::string::stripEnd().
Referenced by dbaxml::OXMLFileBasedDatabase::OXMLFileBasedDatabase().
Sequence< PropertyValue > dbaccess::ODsnTypeCollection::getDefaultDBSettings | ( | std::u16string_view | _sURL | ) | const |
returns default settings for newly created databases of the given type.
Definition at line 279 of file dsntypes.cxx.
References aProperties, connectivity::DriversConfig::getProperties(), and m_aDriverConfig.
Referenced by dbaui::ODbTypeWizDialogSetup::CreateDatabase().
OUString const & dbaccess::ODsnTypeCollection::getDisplayName | ( | ) | const |
|
static |
Definition at line 290 of file dsntypes.cxx.
Referenced by dbaui::OGeneralPageWizard::getEmbeddedDBName(), and dbaui::OGeneralPageWizard::OGeneralPageWizard().
sal_Int32 dbaccess::ODsnTypeCollection::getIndexOf | ( | std::u16string_view | _sURL | ) | const |
Definition at line 495 of file dsntypes.cxx.
References i, m_aDsnPrefixes, and WildCard::Matches().
Referenced by dbaui::ODbTypeWizDialogSetup::activateDatabasePath(), and dbaui::OGeneralPageWizard::OGeneralPageWizard().
OUString dbaccess::ODsnTypeCollection::getJavaDriverClass | ( | std::u16string_view | _sURL | ) | const |
on a given string, return the Java Driver Class
Definition at line 243 of file dsntypes.cxx.
References comphelper::NamedValueCollection::getOrDefault(), connectivity::DriversConfig::getProperties(), and m_aDriverConfig.
Referenced by dbaui::OConnectionTabPage::implInitControls(), and dbaui::OJDBCConnectionPageSetup::implInitControls().
OUString dbaccess::ODsnTypeCollection::getMediaType | ( | std::u16string_view | _sURL | ) | const |
returns the media type of a file based database
Definition at line 153 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaxml::ODBExport::exportConnectionData().
OUString dbaccess::ODsnTypeCollection::getPrefix | ( | std::u16string_view | _sURL | ) | const |
on a given string, return the type prefix
Definition at line 110 of file dsntypes.cxx.
References m_aDsnPrefixes, WildCard::Matches(), and comphelper::string::stripEnd().
Referenced by dbaui::ODbDataSourceAdministrationHelper::convertUrl(), dbaui::ODbTypeWizDialogSetup::createPage(), dbaxml::ODBExport::exportConnectionData(), dbaui::OLDAPConnectionPageSetup::FillItemSet(), dbaui::ODbDataSourceAdministrationHelper::getConnectionURL(), dbaui::OGeneralPage::getDatasourceName(), hasDriver(), dbaui::OConnectionHelper::impl_setURL(), and dbaui::OConnectionURLEdit::SetText().
OUString dbaccess::ODsnTypeCollection::getType | ( | std::u16string_view | _sURL | ) | const |
Definition at line 481 of file dsntypes.cxx.
References m_aDsnPrefixes, and WildCard::Matches().
Referenced by dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(), and dbaui::OApplicationController::GetState().
OUString dbaccess::ODsnTypeCollection::getTypeDisplayName | ( | std::u16string_view | _sURL | ) | const |
get the datasource type display name from a DSN string
Definition at line 79 of file dsntypes.cxx.
References connectivity::DriversConfig::getDriverTypeDisplayName(), and m_aDriverConfig.
Referenced by dbaui::OGeneralPage::getDatasourceName(), dbaui::OGeneralPageWizard::getDatasourceName(), dbaui::OGeneralPageWizard::getEmbeddedDBName(), dbaui::OApplicationController::GetState(), and dbaui::OGeneralPageDialog::setParentTitle().
OUString const & dbaccess::ODsnTypeCollection::getURLPrefix | ( | ) | const |
bool dbaccess::ODsnTypeCollection::hasDriver | ( | const char * | _pAsciiPattern | ) | const |
determines whether there is a driver for the given URL prefix/pattern
Definition at line 131 of file dsntypes.cxx.
References getPrefix(), and sPrefix.
Referenced by dbaui::OGeneralPage::approveDatasourceType(), and dbaui::OMySQLIntroPageSetup::implInitControls().
bool dbaccess::ODsnTypeCollection::isConnectionUrlRequired | ( | std::u16string_view | _sURL | ) | const |
Definition at line 137 of file dsntypes.cxx.
References m_aDsnPrefixes, and WildCard::Matches().
Referenced by dbaui::ODbTypeWizDialogSetup::updateTypeDependentStates().
|
static |
checks if the given data source type embeds its data into the database document
Definition at line 285 of file dsntypes.cxx.
References o3tl::starts_with(), and u.
Referenced by dbaui::ODbTypeWizDialogSetup::CreateDatabase(), dbaui::OGeneralPageWizard::getEmbeddedDBName(), dbaui::OApplicationController::GetState(), and dbaui::OGeneralPageWizard::initializeEmbeddedDBList().
bool dbaccess::ODsnTypeCollection::isFileSystemBased | ( | std::u16string_view | _sURL | ) | const |
check if the given data source type is based on the file system - i.e. the URL is a prefix plus a file URL
Definition at line 249 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaui::OConnectionHelper::commitURL(), dbaui::ODbTypeWizDialogSetup::CreateDatabase(), dbaxml::ODBExport::exportConnectionData(), dbaui::OApplicationController::GetState(), dbaui::OConnectionHelper::impl_getURL(), dbaui::OConnectionHelper::impl_setURL(), and dbaui::OConnectionHelper::implUpdateURLDependentStates().
|
static |
Definition at line 188 of file dsntypes.cxx.
Referenced by dbaui::OApplicationController::GetState().
const TypeIterator & dbaccess::ODsnTypeCollection::operator++ | ( | ) |
prefix increment
sal_Int32 dbaccess::ODsnTypeCollection::size | ( | ) | const |
Definition at line 514 of file dsntypes.cxx.
References m_aDsnPrefixes.
Referenced by dbaui::ODbTypeWizDialogSetup::activateDatabasePath(), and dbaui::ODbTypeWizDialogSetup::ODbTypeWizDialogSetup().
bool dbaccess::ODsnTypeCollection::supportsBrowsing | ( | std::u16string_view | _sURL | ) | const |
Definition at line 267 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaui::OConnectionHelper::implInitControls().
bool dbaccess::ODsnTypeCollection::supportsColumnDescription | ( | std::u16string_view | _sURL | ) | const |
check if the given data source allows to show column description.
Definition at line 261 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaui::OTableEditorCtrl::Init().
bool dbaccess::ODsnTypeCollection::supportsDBCreation | ( | std::u16string_view | _sURL | ) | const |
Definition at line 273 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaui::OConnectionHelper::checkPathExistence(), and dbaui::OConnectionHelper::implInitControls().
bool dbaccess::ODsnTypeCollection::supportsTableCreation | ( | std::u16string_view | _sURL | ) | const |
check if the given data source allows creation of tables
Definition at line 255 of file dsntypes.cxx.
References connectivity::DriversConfig::getMetaData(), comphelper::NamedValueCollection::getOrDefault(), and m_aDriverConfig.
Referenced by dbaui::ODbTypeWizDialogSetup::enterState().
|
protected |
dbaccess::ODsnTypeCollection::TypeIterator | ( | const TypeIterator & | _rSource | ) |
|
friend |
Definition at line 192 of file dsntypes.hxx.
|
friend |
Definition at line 117 of file dsntypes.hxx.
|
friend |
Definition at line 195 of file dsntypes.hxx.
|
friend |
|
private |
DSN prefixes which determine the type of a datasource.
Definition at line 109 of file dsntypes.hxx.
Referenced by getDatasourcePrefixFromMediaType(), getDefaultDBSettings(), getJavaDriverClass(), getMediaType(), getTypeDisplayName(), isFileSystemBased(), ODsnTypeCollection(), supportsBrowsing(), supportsColumnDescription(), supportsDBCreation(), and supportsTableCreation().
|
private |
user readable names for the datasource types
Definition at line 108 of file dsntypes.hxx.
Referenced by cutPrefix(), getIndexOf(), getPrefix(), getType(), isConnectionUrlRequired(), ODsnTypeCollection(), and size().
|
private |
Definition at line 107 of file dsntypes.hxx.
Referenced by end(), and ODsnTypeCollection().
|
private |
Definition at line 112 of file dsntypes.hxx.
Referenced by ~ODsnTypeCollection().
|
protected |
Definition at line 199 of file dsntypes.hxx.
|
protected |
Definition at line 198 of file dsntypes.hxx.