1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
25 #define INCLUDED_CONFIGMGR_SOURCE_PARSEMANAGER_HXX
26 
27 #include "sal/config.h"
28 
29 #include "com/sun/star/container/NoSuchElementException.hpp"
30 #include "com/sun/star/uno/RuntimeException.hpp"
31 #include "rtl/ref.hxx"
32 #include "sal/types.h"
33 #include "salhelper/simplereferenceobject.hxx"
34 #include "xmlreader/span.hxx"
35 #include "xmlreader/xmlreader.hxx"
36 
37 namespace rtl { class OUString; }
38 
39 namespace configmgr {
40 
41 class Parser;
42 
43 class ParseManager: public salhelper::SimpleReferenceObject {
44 public:
45     ParseManager(
46         rtl::OUString const & url, rtl::Reference< Parser > const & parser)
47         SAL_THROW((
48             com::sun::star::container::NoSuchElementException,
49             com::sun::star::uno::RuntimeException));
50 
51     bool parse();
52 
53     enum { NAMESPACE_OOR = 1, NAMESPACE_XS = 2, NAMESPACE_XSI = 3 };
54 
55 private:
56     virtual ~ParseManager();
57 
58     xmlreader::XmlReader reader_;
59     rtl::Reference< Parser > parser_;
60     xmlreader::Span itemData_;
61     int itemNamespaceId_;
62 };
63 
64 }
65 
66 #endif
67