1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include "MacabCatalog.hxx"
22 #include "MacabConnection.hxx"
23 #include "MacabTables.hxx"
24 #include <com/sun/star/sdbc/XRow.hpp>
26 using namespace connectivity::macab
;
27 using namespace ::com::sun::star::uno
;
28 using namespace ::com::sun::star::beans
;
29 using namespace ::com::sun::star::sdbcx
;
30 using namespace ::com::sun::star::sdbc
;
31 using namespace ::com::sun::star::container
;
32 using namespace ::com::sun::star::lang
;
33 using namespace ::cppu
;
36 MacabCatalog::MacabCatalog(MacabConnection
* _pCon
)
37 : connectivity::sdbcx::OCatalog(_pCon
),
42 void MacabCatalog::refreshTables()
44 ::std::vector
< OUString
> aVector
;
45 Sequence
< OUString
> aTypes
{ "%" };
46 Reference
< XResultSet
> xResult
= m_xMetaData
->getTables(
47 Any(), "%", "%", aTypes
);
51 Reference
< XRow
> xRow(xResult
,UNO_QUERY
);
53 // const OUString& sDot = MacabCatalog::getDot();
55 while (xResult
->next())
57 // aName = xRow->getString(2);
59 aName
= xRow
->getString(3);
60 aVector
.push_back(aName
);
64 m_pTables
->reFill(aVector
);
66 m_pTables
.reset( new MacabTables(m_xMetaData
,*this,m_aMutex
,aVector
) );
69 void MacabCatalog::refreshViews()
73 void MacabCatalog::refreshGroups()
77 void MacabCatalog::refreshUsers()
81 const OUString
& MacabCatalog::getDot()
83 static constexpr OUString sDot
= u
"."_ustr
;
89 Reference
< XNameAccess
> SAL_CALL
MacabCatalog::getTables( )
91 ::osl::MutexGuard
aGuard(m_aMutex
);
92 checkDisposed(rBHelper
.bDisposed
);
99 catch( const RuntimeException
& )
101 // allowed to leave this method
104 catch( const Exception
& )
109 return m_pTables
.get();
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */