LibreOffice Module dbaccess (master)
1
dbaccess
source
filter
xml
xmlDatabaseDescription.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 "
xmlDatabaseDescription.hxx
"
21
#include "
xmlfilter.hxx
"
22
#include <
xmloff/xmltoken.hxx
>
23
#include <
xmloff/ProgressBarHelper.hxx
>
24
#include "
xmlEnums.hxx
"
25
#include "
xmlFileBasedDatabase.hxx
"
26
#include "
xmlServerDatabase.hxx
"
27
28
namespace
dbaxml
29
{
30
using namespace
::
com::sun::star::uno
;
31
using namespace
::
com::sun::star::xml::sax
;
32
33
OXMLDatabaseDescription::OXMLDatabaseDescription
(
ODBFilter
& rImport ) :
34
SvXMLImportContext
( rImport )
35
,m_bFoundOne(false)
36
{
37
}
38
39
OXMLDatabaseDescription::~OXMLDatabaseDescription
()
40
{
41
42
}
43
44
css::uno::Reference< css::xml::sax::XFastContextHandler >
OXMLDatabaseDescription::createFastChildContext
(
45
sal_Int32 nElement,
const
css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
46
{
47
SvXMLImportContext
*pContext =
nullptr
;
48
49
switch
( nElement &
TOKEN_MASK
)
50
{
51
case
XML_FILE_BASED_DATABASE
:
52
if
( !
m_bFoundOne
)
53
{
54
m_bFoundOne
=
true
;
55
GetOwnImport
().GetProgressBarHelper()->Increment(
PROGRESS_BAR_STEP
);
56
pContext =
new
OXMLFileBasedDatabase
(
GetOwnImport
(), xAttrList );
57
}
58
break
;
59
case
XML_SERVER_DATABASE
:
60
if
( !
m_bFoundOne
)
61
{
62
m_bFoundOne
=
true
;
63
GetOwnImport
().GetProgressBarHelper()->Increment(
PROGRESS_BAR_STEP
);
64
pContext =
new
OXMLServerDatabase
(
GetOwnImport
(), xAttrList );
65
}
66
break
;
67
}
68
69
return
pContext;
70
}
71
72
ODBFilter
&
OXMLDatabaseDescription::GetOwnImport
()
73
{
74
return
static_cast<
ODBFilter
&
>
(
GetImport
());
75
}
76
77
}
// namespace dbaxml
78
79
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ProgressBarHelper.hxx
SvXMLImportContext
SvXMLImportContext::GetImport
SvXMLImport & GetImport()
dbaxml::ODBFilter
Definition:
xmlfilter.hxx:49
dbaxml::OXMLDatabaseDescription::createFastChildContext
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
Definition:
xmlDatabaseDescription.cxx:44
dbaxml::OXMLDatabaseDescription::m_bFoundOne
bool m_bFoundOne
Definition:
xmlDatabaseDescription.hxx:28
dbaxml::OXMLDatabaseDescription::GetOwnImport
ODBFilter & GetOwnImport()
Definition:
xmlDatabaseDescription.cxx:72
dbaxml::OXMLDatabaseDescription::OXMLDatabaseDescription
OXMLDatabaseDescription(ODBFilter &rImport)
Definition:
xmlDatabaseDescription.cxx:33
dbaxml::OXMLDatabaseDescription::~OXMLDatabaseDescription
virtual ~OXMLDatabaseDescription() override
Definition:
xmlDatabaseDescription.cxx:39
dbaxml::OXMLFileBasedDatabase
Definition:
xmlFileBasedDatabase.hxx:27
dbaxml::OXMLServerDatabase
Definition:
xmlServerDatabase.hxx:27
com::sun::star::uno
com::sun::star::xml::sax
dbaxml
Definition:
dbloader2.cxx:78
XML_FILE_BASED_DATABASE
XML_FILE_BASED_DATABASE
XML_SERVER_DATABASE
XML_SERVER_DATABASE
xmlDatabaseDescription.hxx
xmlEnums.hxx
PROGRESS_BAR_STEP
#define PROGRESS_BAR_STEP
Definition:
xmlEnums.hxx:21
xmlFileBasedDatabase.hxx
xmlServerDatabase.hxx
xmlfilter.hxx
TOKEN_MASK
constexpr sal_Int32 TOKEN_MASK
xmltoken.hxx
Generated on Sun Jul 30 2023 04:30:06 for LibreOffice Module dbaccess (master) by
1.9.3