1 | /*
|
---|
2 | * Copyright 2001,2004 The Apache Software Foundation.
|
---|
3 | *
|
---|
4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
5 | * you may not use this file except in compliance with the License.
|
---|
6 | * You may obtain a copy of the License at
|
---|
7 | *
|
---|
8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
9 | *
|
---|
10 | * Unless required by applicable law or agreed to in writing, software
|
---|
11 | * distributed under the License is distributed on an "AS IS" BASIS,
|
---|
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
---|
13 | * See the License for the specific language governing permissions and
|
---|
14 | * limitations under the License.
|
---|
15 | */
|
---|
16 |
|
---|
17 | /*
|
---|
18 | * $Id: ClosureToken.hpp,v 1.6 2004/09/08 13:56:47 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #if !defined(CLOSURETOKEN_HPP)
|
---|
22 | #define CLOSURETOKEN_HPP
|
---|
23 |
|
---|
24 | // ---------------------------------------------------------------------------
|
---|
25 | // Includes
|
---|
26 | // ---------------------------------------------------------------------------
|
---|
27 | #include <xercesc/util/regx/Token.hpp>
|
---|
28 |
|
---|
29 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
30 |
|
---|
31 | class XMLUTIL_EXPORT ClosureToken : public Token {
|
---|
32 | public:
|
---|
33 | // -----------------------------------------------------------------------
|
---|
34 | // Public Constructors and Destructor
|
---|
35 | // -----------------------------------------------------------------------
|
---|
36 | ClosureToken(const unsigned short tokType, Token* const tok
|
---|
37 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
38 | ~ClosureToken();
|
---|
39 |
|
---|
40 | // -----------------------------------------------------------------------
|
---|
41 | // Getter methods
|
---|
42 | // -----------------------------------------------------------------------
|
---|
43 | int size() const;
|
---|
44 | int getMin() const;
|
---|
45 | int getMax() const;
|
---|
46 | Token* getChild(const int index) const;
|
---|
47 |
|
---|
48 | // -----------------------------------------------------------------------
|
---|
49 | // Setter methods
|
---|
50 | // -----------------------------------------------------------------------
|
---|
51 | void setMin(const int minVal);
|
---|
52 | void setMax(const int maxVal);
|
---|
53 |
|
---|
54 | private:
|
---|
55 | // -----------------------------------------------------------------------
|
---|
56 | // Unimplemented constructors and operators
|
---|
57 | // -----------------------------------------------------------------------
|
---|
58 | ClosureToken(const ClosureToken&);
|
---|
59 | ClosureToken& operator=(const ClosureToken&);
|
---|
60 |
|
---|
61 | // -----------------------------------------------------------------------
|
---|
62 | // Private data members
|
---|
63 | // -----------------------------------------------------------------------
|
---|
64 | int fMin;
|
---|
65 | int fMax;
|
---|
66 | Token* fChild;
|
---|
67 | };
|
---|
68 |
|
---|
69 |
|
---|
70 | // ---------------------------------------------------------------------------
|
---|
71 | // ClosureToken: getter methods
|
---|
72 | // ---------------------------------------------------------------------------
|
---|
73 | inline int ClosureToken::size() const {
|
---|
74 |
|
---|
75 | return 1;
|
---|
76 | }
|
---|
77 |
|
---|
78 |
|
---|
79 | inline int ClosureToken::getMax() const {
|
---|
80 |
|
---|
81 | return fMax;
|
---|
82 | }
|
---|
83 |
|
---|
84 | inline int ClosureToken::getMin() const {
|
---|
85 |
|
---|
86 | return fMin;
|
---|
87 | }
|
---|
88 |
|
---|
89 | inline Token* ClosureToken::getChild(const int) const {
|
---|
90 |
|
---|
91 | return fChild;
|
---|
92 | }
|
---|
93 |
|
---|
94 | // ---------------------------------------------------------------------------
|
---|
95 | // ClosureToken: setter methods
|
---|
96 | // ---------------------------------------------------------------------------
|
---|
97 | inline void ClosureToken::setMax(const int maxVal) {
|
---|
98 |
|
---|
99 | fMax = maxVal;
|
---|
100 | }
|
---|
101 |
|
---|
102 | inline void ClosureToken::setMin(const int minVal) {
|
---|
103 |
|
---|
104 | fMin = minVal;
|
---|
105 | }
|
---|
106 |
|
---|
107 | XERCES_CPP_NAMESPACE_END
|
---|
108 |
|
---|
109 | #endif
|
---|
110 |
|
---|
111 | /**
|
---|
112 | * End of file ClosureToken.hpp
|
---|
113 | */
|
---|