1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the  "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 #if !defined(XPATHCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680)
19 #define XPATHCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
20 
21 
22 
23 // Base include file.  Must be first.
24 #include <xalanc/XPath/XPathDefinitions.hpp>
25 
26 
27 
28 #include <xalanc/PlatformSupport/XalanDOMStringCache.hpp>
29 #include <xalanc/PlatformSupport/XalanDOMStringPool.hpp>
30 
31 
32 
33 // Base class header file...
34 #include <xalanc/XPath/XPathConstructionContext.hpp>
35 
36 
37 
38 namespace XALAN_CPP_NAMESPACE {
39 
40 
41 
42 /**
43  *
44  * An default implementation of an abtract class which provides support for
45  * constructing the internal representation  of an XPath.
46  *
47  */
48 class XALAN_XPATH_EXPORT XPathConstructionContextDefault : public XPathConstructionContext
49 {
50 public:
51 
52     /*
53      * Construct an instance.
54      */
55     XPathConstructionContextDefault(MemoryManager&  theManager XALAN_DEFAULT_MEMMGR);
56 
57     static XPathConstructionContextDefault*
58     create(MemoryManager&   theManager);
59 
60     virtual
61     ~XPathConstructionContextDefault();
62 
63 
64     // These interfaces are inherited from XPathConstructionContext...
65     virtual void
66     problem(
67             eSource                 source,
68             eClassification         classification,
69             const XalanDOMString&   msg,
70             const Locator*          locator,
71             const XalanNode*        sourceNode);
72 
73     virtual void
74     problem(
75             eSource                 source,
76             eClassification         classification,
77             const XalanDOMString&   msg,
78             const XalanNode*        sourceNode);
79 
80     virtual void
81     reset();
82 
83     virtual const XalanDOMString&
84     getPooledString(const XalanDOMString&   theString);
85 
86     virtual const XalanDOMString&
87     getPooledString(
88             const XalanDOMChar*         theString,
89             XalanDOMString::size_type   theLength = XalanDOMString::npos);
90 
91     virtual XalanDOMString&
92     getCachedString();
93 
94     virtual bool
95     releaseCachedString(XalanDOMString&     theString);
96 
97 private:
98 
99     XalanDOMStringPool      m_stringPool;
100 
101     XalanDOMStringCache     m_stringCache;
102 };
103 
104 
105 
106 }
107 
108 
109 
110 #endif  // XPATHCONSTRUCTIONCONTEXTDEFAULT_HEADER_GUARD_1357924680
111