xref: /AOO42X/main/sax/source/fastparser/facreg.cxx (revision b1c5455db1639c48e26c568e4fa7ee78ca5d60ee)
1f9b72d11SAndrew Rist /**************************************************************
2f9b72d11SAndrew Rist  *
3f9b72d11SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4f9b72d11SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5f9b72d11SAndrew Rist  * distributed with this work for additional information
6f9b72d11SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7f9b72d11SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8f9b72d11SAndrew Rist  * "License"); you may not use this file except in compliance
9f9b72d11SAndrew Rist  * with the License.  You may obtain a copy of the License at
10f9b72d11SAndrew Rist  *
11f9b72d11SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12f9b72d11SAndrew Rist  *
13f9b72d11SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14f9b72d11SAndrew Rist  * software distributed under the License is distributed on an
15f9b72d11SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16f9b72d11SAndrew Rist  * KIND, either express or implied.  See the License for the
17f9b72d11SAndrew Rist  * specific language governing permissions and limitations
18f9b72d11SAndrew Rist  * under the License.
19f9b72d11SAndrew Rist  *
20f9b72d11SAndrew Rist  *************************************************************/
21f9b72d11SAndrew Rist 
22cdf0e10cSrcweir #include <cppuhelper/factory.hxx>
23cdf0e10cSrcweir #include <cppuhelper/weak.hxx>
24cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx>
25*d07f3ff7SDamjan Jovanovic #include <cppuhelper/implementationentry.hxx>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "../tools/fastserializer.hxx"
28cdf0e10cSrcweir #include "fastparser.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir using namespace sax_fastparser;
31cdf0e10cSrcweir using namespace ::cppu;
32cdf0e10cSrcweir using namespace ::com::sun::star::uno;
33cdf0e10cSrcweir using namespace ::com::sun::star::registry;
34cdf0e10cSrcweir using ::rtl::OUString;
35cdf0e10cSrcweir using namespace ::com::sun::star::lang;
36cdf0e10cSrcweir 
37cdf0e10cSrcweir namespace sax_fastparser
38cdf0e10cSrcweir {
39cdf0e10cSrcweir 
40cdf0e10cSrcweir //--------------------------------------
41cdf0e10cSrcweir // the extern interface
42cdf0e10cSrcweir //---------------------------------------
FastSaxParser_CreateInstance(const Reference<XComponentContext> &)43*d07f3ff7SDamjan Jovanovic Reference< XInterface > SAL_CALL FastSaxParser_CreateInstance( const Reference< XComponentContext >  & ) throw(Exception)
44cdf0e10cSrcweir {
45cdf0e10cSrcweir     FastSaxParser *p = new FastSaxParser;
46cdf0e10cSrcweir     return Reference< XInterface > ( (OWeakObject * ) p );
47cdf0e10cSrcweir }
48cdf0e10cSrcweir 
FastSaxSerializer_CreateInstance(const Reference<XComponentContext> &)49*d07f3ff7SDamjan Jovanovic Reference< XInterface > SAL_CALL FastSaxSerializer_CreateInstance( const Reference< XComponentContext >  & ) throw(Exception)
50cdf0e10cSrcweir {
51cdf0e10cSrcweir     FastSaxSerializer *p = new FastSaxSerializer;
52cdf0e10cSrcweir     return Reference< XInterface > ( (OWeakObject * ) p );
53cdf0e10cSrcweir }
54*d07f3ff7SDamjan Jovanovic 
55*d07f3ff7SDamjan Jovanovic struct ::cppu::ImplementationEntry g_component_entries[] =
56*d07f3ff7SDamjan Jovanovic {
57*d07f3ff7SDamjan Jovanovic     {
58*d07f3ff7SDamjan Jovanovic         FastSaxParser_CreateInstance,
59*d07f3ff7SDamjan Jovanovic         FastSaxParser::getImplementationName_Static,
60*d07f3ff7SDamjan Jovanovic         FastSaxParser::getSupportedServiceNames_Static,
61*d07f3ff7SDamjan Jovanovic         ::cppu::createSingleComponentFactory,
62*d07f3ff7SDamjan Jovanovic         0,
63*d07f3ff7SDamjan Jovanovic         0
64*d07f3ff7SDamjan Jovanovic     },
65*d07f3ff7SDamjan Jovanovic     {
66*d07f3ff7SDamjan Jovanovic         FastSaxSerializer_CreateInstance,
67*d07f3ff7SDamjan Jovanovic         FastSaxSerializer::getImplementationName_Static,
68*d07f3ff7SDamjan Jovanovic         FastSaxSerializer::getSupportedServiceNames_Static,
69*d07f3ff7SDamjan Jovanovic         ::cppu::createSingleComponentFactory,
70*d07f3ff7SDamjan Jovanovic         0,
71*d07f3ff7SDamjan Jovanovic         0
72*d07f3ff7SDamjan Jovanovic     },
73*d07f3ff7SDamjan Jovanovic     { 0, 0, 0, 0, 0, 0 }
74*d07f3ff7SDamjan Jovanovic };
75*d07f3ff7SDamjan Jovanovic 
76cdf0e10cSrcweir }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir extern "C"
79cdf0e10cSrcweir {
80cdf0e10cSrcweir 
component_getImplementationEnvironment(const sal_Char ** ppEnvTypeName,uno_Environment **)81b63233d8Sdamjan SAL_DLLPUBLIC_EXPORT void SAL_CALL component_getImplementationEnvironment(
82cdf0e10cSrcweir     const sal_Char ** ppEnvTypeName, uno_Environment ** /*ppEnv*/ )
83cdf0e10cSrcweir {
84cdf0e10cSrcweir     *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
85cdf0e10cSrcweir }
86cdf0e10cSrcweir 
component_getFactory(const sal_Char * pImplName,void * pServiceManager,void * pRegistryKey)87*d07f3ff7SDamjan Jovanovic SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey )
88cdf0e10cSrcweir {
89*d07f3ff7SDamjan Jovanovic     return ::cppu::component_getFactoryHelper( pImplName, pServiceManager, pRegistryKey, g_component_entries );
90cdf0e10cSrcweir }
91cdf0e10cSrcweir 
92cdf0e10cSrcweir 
93cdf0e10cSrcweir }
94