Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
6b184f63
Kaydet (Commit)
6b184f63
authored
Agu 19, 2013
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Add skeleton sdbcx Users/User implementation. (firebird-sdbc)
Change-Id: I8a64f9776a618691fa61aa0e71067a0eb6176811
üst
b71c3521
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
268 additions
and
0 deletions
+268
-0
Library_firebird_sdbc.mk
connectivity/Library_firebird_sdbc.mk
+2
-0
User.cxx
connectivity/source/drivers/firebird/User.cxx
+39
-0
User.hxx
connectivity/source/drivers/firebird/User.hxx
+50
-0
Users.cxx
connectivity/source/drivers/firebird/Users.cxx
+111
-0
Users.hxx
connectivity/source/drivers/firebird/Users.hxx
+66
-0
No files found.
connectivity/Library_firebird_sdbc.mk
Dosyayı görüntüle @
6b184f63
...
@@ -51,6 +51,8 @@ $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\
...
@@ -51,6 +51,8 @@ $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\
connectivity/source/drivers/firebird/StatementCommonBase \
connectivity/source/drivers/firebird/StatementCommonBase \
connectivity/source/drivers/firebird/Table \
connectivity/source/drivers/firebird/Table \
connectivity/source/drivers/firebird/Tables \
connectivity/source/drivers/firebird/Tables \
connectivity/source/drivers/firebird/User \
connectivity/source/drivers/firebird/Users \
connectivity/source/drivers/firebird/Util \
connectivity/source/drivers/firebird/Util \
))
))
...
...
connectivity/source/drivers/firebird/User.cxx
0 → 100644
Dosyayı görüntüle @
6b184f63
/* -*- 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/.
*/
#include "User.hxx"
using
namespace
::
connectivity
;
using
namespace
::
connectivity
::
firebird
;
using
namespace
::
connectivity
::
sdbcx
;
using
namespace
::
rtl
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
sdbc
;
User
::
User
(
const
uno
::
Reference
<
XConnection
>&
rConnection
)
:
OUser
(
sal_True
)
// Case Sensitive
{
(
void
)
rConnection
;
}
User
::
User
(
const
uno
::
Reference
<
XConnection
>&
rConnection
,
const
OUString
&
rName
)
:
OUser
(
rName
,
sal_True
)
// Case Sensitive
{
(
void
)
rConnection
;
}
//----- IRefreshableGroups ----------------------------------------------------
void
User
::
refreshGroups
()
{
// TODO: implement.
}
\ No newline at end of file
connectivity/source/drivers/firebird/User.hxx
0 → 100644
Dosyayı görüntüle @
6b184f63
/* -*- 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/.
*/
#ifndef CONNECTIVITY_FIREBIRD_USER_HXX
#define CONNECTIVITY_FIREBIRD_USER_HXX
#include <connectivity/sdbcx/VUser.hxx>
#include <com/sun/star/sdbc/XConnection.hpp>
namespace
connectivity
{
namespace
firebird
{
/**
* This implements com.sun.star.sdbcx.Container.
*/
class
User
:
public
::
connectivity
::
sdbcx
::
OUser
{
public
:
/**
* Create a "new" descriptor, which isn't yet in the database.
*/
User
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XConnection
>&
rConnection
);
/**
* For a user that already exists in the db.
*/
User
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XConnection
>&
rConnection
,
const
::
rtl
::
OUString
&
rName
);
// IRefreshableGroups::
virtual
void
refreshGroups
();
};
}
// namespace firebird
}
// namespace connectivity
#endif // CONNECTIVITY_FIREBIRD_USER_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
connectivity/source/drivers/firebird/Users.cxx
0 → 100644
Dosyayı görüntüle @
6b184f63
/* -*- 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/.
*/
#include "User.hxx"
#include "Users.hxx"
#include <connectivity/dbtools.hxx>
#include <com/sun/star/sdbc/XRow.hpp>
using
namespace
::
connectivity
;
using
namespace
::
connectivity
::
firebird
;
using
namespace
::
connectivity
::
sdbcx
;
using
namespace
::
cppu
;
using
namespace
::
osl
;
using
namespace
::
rtl
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
beans
;
using
namespace
::
com
::
sun
::
star
::
container
;
using
namespace
::
com
::
sun
::
star
::
lang
;
using
namespace
::
com
::
sun
::
star
::
sdbc
;
using
namespace
::
com
::
sun
::
star
::
uno
;
Users
::
Users
(
const
uno
::
Reference
<
XDatabaseMetaData
>&
rMetaData
,
OWeakObject
&
rParent
,
Mutex
&
rMutex
,
TStringVector
&
rNames
)
:
OCollection
(
rParent
,
sal_True
,
rMutex
,
rNames
),
m_rMutex
(
rMutex
),
m_xMetaData
(
rMetaData
)
{
}
//----- OCollection -----------------------------------------------------------
void
Users
::
impl_refresh
()
throw
(
RuntimeException
)
{
// TODO: IMPLEMENT ME
}
ObjectType
Users
::
createObject
(
const
OUString
&
rName
)
{
(
void
)
rName
;
// TODO: set query string
OUString
sSql
;
uno
::
Reference
<
XResultSet
>
xUsers
=
m_xMetaData
->
getConnection
()
->
createStatement
()
->
executeQuery
(
sSql
);
if
(
!
xUsers
.
is
())
throw
RuntimeException
();
uno
::
Reference
<
XRow
>
xRow
(
xUsers
,
UNO_QUERY
);
if
(
!
xRow
.
is
()
||
!
xUsers
->
next
())
throw
RuntimeException
();
ObjectType
xRet
(
new
User
(
m_xMetaData
->
getConnection
(),
xRow
->
getString
(
1
)));
// Name
if
(
xUsers
->
next
())
throw
RuntimeException
();
// Only one user should be returned
return
xRet
;
}
uno
::
Reference
<
XPropertySet
>
Users
::
createDescriptor
()
{
// There is some internal magic so that the same class can be used as either
// a descriptor or as a normal user. See VUser.cxx for the details. In our
// case we just need to ensure we use the correct constructor.
return
new
User
(
m_xMetaData
->
getConnection
());
}
//----- XAppend ---------------------------------------------------------------
ObjectType
Users
::
appendObject
(
const
OUString
&
rName
,
const
uno
::
Reference
<
XPropertySet
>&
rDescriptor
)
{
// TODO: set sSql as appropriate
(
void
)
rName
;
(
void
)
rDescriptor
;
OUString
sSql
;
m_xMetaData
->
getConnection
()
->
createStatement
()
->
execute
(
sSql
);
return
createObject
(
rName
);
}
//----- XDrop -----------------------------------------------------------------
void
Users
::
dropObject
(
sal_Int32
nPosition
,
const
OUString
sName
)
{
uno
::
Reference
<
XPropertySet
>
xUser
(
getObject
(
nPosition
));
if
(
!
ODescriptor
::
isNew
(
xUser
))
{
(
void
)
sName
;
// TODO: drop me
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
connectivity/source/drivers/firebird/Users.hxx
0 → 100644
Dosyayı görüntüle @
6b184f63
/* -*- 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/.
*/
#ifndef CONNECTIVITY_FIREBIRD_USERS_HXX
#define CONNECTIVITY_FIREBIRD_USERS_HXX
#include "DatabaseMetaData.hxx"
#include <connectivity/sdbcx/VCollection.hxx>
namespace
connectivity
{
namespace
firebird
{
/**
* This implements com.sun.star.sdbcx.Container.
*/
class
Users
:
public
::
connectivity
::
sdbcx
::
OCollection
{
private
:
::
osl
::
Mutex
&
m_rMutex
;
protected
:
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XDatabaseMetaData
>
m_xMetaData
;
// OCollection
virtual
void
impl_refresh
()
throw
(
::
com
::
sun
::
star
::
uno
::
RuntimeException
);
virtual
::
connectivity
::
sdbcx
::
ObjectType
createObject
(
const
::
rtl
::
OUString
&
rName
);
virtual
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>
createDescriptor
();
virtual
::
connectivity
::
sdbcx
::
ObjectType
appendObject
(
const
OUString
&
rName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
beans
::
XPropertySet
>&
rDescriptor
);
public
:
Users
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
sdbc
::
XDatabaseMetaData
>&
rMetaData
,
::
cppu
::
OWeakObject
&
rParent
,
::
osl
::
Mutex
&
rMutex
,
::
connectivity
::
TStringVector
&
rNames
);
// TODO: we should also implement XDataDescriptorFactory, XRefreshable,
// XAppend, etc., but all are optional.
// XDrop
virtual
void
dropObject
(
sal_Int32
nPosition
,
const
::
rtl
::
OUString
rName
);
};
}
// namespace firebird
}
// namespace connectivity
#endif // CONNECTIVITY_FIREBIRD_USERS_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment