Coverage Report

Created: 2023-03-26 07:54

/src/xerces-c/src/xercesc/util/XMLInitializer.cpp
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Licensed to the Apache Software Foundation (ASF) under one or more
3
 * contributor license agreements.  See the NOTICE file distributed with
4
 * this work for additional information regarding copyright ownership.
5
 * The ASF licenses this file to You under the Apache License, Version 2.0
6
 * (the "License"); you may not use this file except in compliance with
7
 * the License.  You may obtain a copy of the License at
8
 *
9
 *      http://www.apache.org/licenses/LICENSE-2.0
10
 *
11
 * Unless required by applicable law or agreed to in writing, software
12
 * distributed under the License is distributed on an "AS IS" BASIS,
13
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
 * See the License for the specific language governing permissions and
15
 * limitations under the License.
16
 */
17
18
/*
19
 * $Id: XMLInitializer.cpp 1329261 2012-04-23 14:35:09Z amassari $
20
 */
21
22
23
// ---------------------------------------------------------------------------
24
//  Includes
25
// ---------------------------------------------------------------------------
26
#include <xercesc/util/XMLInitializer.hpp>
27
#include <xercesc/util/PlatformUtils.hpp>
28
29
XERCES_CPP_NAMESPACE_BEGIN
30
31
// ---------------------------------------------------------------------------
32
//  XMLInitializer: Initialization methods
33
// ---------------------------------------------------------------------------
34
void XMLInitializer::initializeStaticData()
35
2
{
36
2
    try
37
2
    {
38
        // Note that in some cases the order of initialization can be
39
        // important.
40
        //
41
42
        // Core
43
        //
44
2
        initializeEncodingValidator();
45
2
        initializeXMLException();
46
2
        initializeXMLScanner();
47
2
        initializeXMLValidator();
48
49
        // Regex
50
        //
51
2
        initializeRangeTokenMap();
52
2
        initializeRegularExpression();
53
54
        // DTD
55
        //
56
2
        initializeDTDGrammar();
57
58
        // Schema
59
        //
60
2
        initializeXSDErrorReporter();
61
2
        initializeDatatypeValidatorFactory();
62
2
        initializeGeneralAttributeCheck();
63
2
        initializeXSValue();
64
2
        initializeComplexTypeInfo();
65
66
        // DOM
67
        //
68
2
        initializeDOMImplementationRegistry();
69
2
        initializeDOMImplementationImpl();
70
2
        initializeDOMDocumentTypeImpl();
71
2
        initializeDOMNodeListImpl();
72
2
        initializeDOMNormalizer();
73
74
        // XInclude
75
        //
76
2
        initializeXInclude();
77
2
  }
78
2
    catch(...) {
79
0
        XMLPlatformUtils::panic(PanicHandler::Panic_AllStaticInitErr);
80
0
    }
81
2
}
82
83
84
void XMLInitializer::terminateStaticData()
85
0
{
86
    // Terminate in the reverse order of initialization. There shouldn't
87
    // be any exceptions and if there are, we can't do anything about them
88
    // since we are no longer initialized (think of it as throwing from
89
    // a destructor).
90
    //
91
92
    // XInclude
93
    //
94
0
    terminateXInclude();
95
96
  // DOM
97
    //
98
0
    terminateDOMNormalizer();
99
0
    terminateDOMNodeListImpl();
100
0
    terminateDOMDocumentTypeImpl();
101
0
    terminateDOMImplementationImpl();
102
0
    terminateDOMImplementationRegistry();
103
104
    // Schema
105
    //
106
0
    terminateComplexTypeInfo();
107
0
    terminateXSValue();
108
0
    terminateGeneralAttributeCheck();
109
0
    terminateDatatypeValidatorFactory();
110
0
    terminateXSDErrorReporter();
111
112
    // DTD
113
    //
114
0
    terminateDTDGrammar();
115
116
    // Regex
117
    //
118
0
    terminateRegularExpression();
119
0
    terminateRangeTokenMap();
120
121
    // Core
122
    //
123
0
    terminateXMLValidator();
124
0
    terminateXMLScanner();
125
0
    terminateXMLException();
126
0
    terminateEncodingValidator();
127
0
}
128
129
130
XERCES_CPP_NAMESPACE_END