LibreOffice Module connectivity (master) 1
ACatalog.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <ado/ACatalog.hxx>
21#include <ado/AConnection.hxx>
22#include <ado/AGroups.hxx>
23#include <ado/AUsers.hxx>
24#include <ado/ATables.hxx>
25#include <ado/AViews.hxx>
26#include <com/sun/star/sdbc/XRow.hpp>
27#include <com/sun/star/sdbc/XResultSet.hpp>
28
29
30using namespace connectivity;
31using namespace connectivity::ado;
32
33OCatalog::OCatalog(_ADOCatalog* _pCatalog,OConnection* _pCon) : connectivity::sdbcx::OCatalog(_pCon)
34 ,m_aCatalog(_pCatalog)
35 ,m_pConnection(_pCon)
36{
37}
38
40{
44}
45
47{
48 ::std::vector< OUString> aVector;
49
51 if ( aTables.IsValid() )
52 {
53 aTables.Refresh();
54 sal_Int32 nCount = aTables.GetItemCount();
55 aVector.reserve(nCount);
56 for(sal_Int32 i=0;i< nCount;++i)
57 {
58 WpADOTable aElement = aTables.GetItem(i);
59 if ( aElement.IsValid() )
60 {
61 OUString sTypeName = aElement.get_Type();
62 if ( !sTypeName.equalsIgnoreAsciiCase("SYSTEM TABLE")
63 && !sTypeName.equalsIgnoreAsciiCase("ACCESS TABLE") )
64 aVector.push_back(aElement.get_Name());
65 }
66 }
67 }
68
69 if(m_pTables)
70 m_pTables->reFill(aVector);
71 else
72 m_pTables.reset( new OTables(this,m_aMutex,aVector,aTables,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) );
73}
74
76{
77 ::std::vector< OUString> aVector;
78
80 aViews.fillElementNames(aVector);
81
82 if(m_pViews)
83 m_pViews->reFill(aVector);
84 else
85 m_pViews.reset( new OViews(this,m_aMutex,aVector,aViews,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) );
86}
87
89{
90 ::std::vector< OUString> aVector;
91
93 aGroups.fillElementNames(aVector);
94
95 if(m_pGroups)
96 m_pGroups->reFill(aVector);
97 else
98 m_pGroups.reset( new OGroups(this,m_aMutex,aVector,aGroups,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) );
99}
100
102{
103 ::std::vector< OUString> aVector;
104
106 aUsers.fillElementNames(aVector);
107
108 if(m_pUsers)
109 m_pUsers->reFill(aVector);
110 else
111 m_pUsers.reset( new OUsers(this,m_aMutex,aVector,aUsers,m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) );
112}
113
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void refreshTables() override
Definition: ACatalog.cxx:46
virtual void refreshGroups() override
Definition: ACatalog.cxx:88
virtual void refreshViews() override
Definition: ACatalog.cxx:75
OConnection * m_pConnection
Definition: ACatalog.hxx:31
virtual void refreshUsers() override
Definition: ACatalog.cxx:101
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
void putref_ActiveConnection(IDispatch *pCon)
Definition: Awrapado.cxx:1237
sal_Int32 GetItemCount() const
Definition: Aolewrap.hxx:96
void fillElementNames(::std::vector< OUString > &_rVector)
Definition: Aolewrap.hxx:129
WrapT GetItem(sal_Int32 index) const
Definition: Aolewrap.hxx:102
std::unique_ptr< OCollection > m_pTables
Definition: VCatalog.hxx:64
std::unique_ptr< OCollection > m_pGroups
Definition: VCatalog.hxx:66
std::unique_ptr< OCollection > m_pViews
Definition: VCatalog.hxx:65
std::unique_ptr< OCollection > m_pUsers
Definition: VCatalog.hxx:67
int nCount
OCollection OGroups
Definition: VUser.hxx:36
OCollection OUsers
Definition: VGroup.hxx:36
int i