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: ConcatToken.hpp,v 1.5 2004/09/08 13:56:47 peiyongz Exp $
|
---|
19 | */
|
---|
20 |
|
---|
21 | #if !defined(CONCATTOKEN_HPP)
|
---|
22 | #define CONCATTOKEN_HPP
|
---|
23 |
|
---|
24 | // ---------------------------------------------------------------------------
|
---|
25 | // Includes
|
---|
26 | // ---------------------------------------------------------------------------
|
---|
27 | #include <xercesc/util/regx/Token.hpp>
|
---|
28 |
|
---|
29 | XERCES_CPP_NAMESPACE_BEGIN
|
---|
30 |
|
---|
31 | class XMLUTIL_EXPORT ConcatToken : public Token {
|
---|
32 | public:
|
---|
33 | // -----------------------------------------------------------------------
|
---|
34 | // Public Constructors and Destructor
|
---|
35 | // -----------------------------------------------------------------------
|
---|
36 | ConcatToken(Token* const tok1, Token* const tok2
|
---|
37 | , MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
|
---|
38 | ~ConcatToken();
|
---|
39 |
|
---|
40 | // -----------------------------------------------------------------------
|
---|
41 | // Getter methods
|
---|
42 | // -----------------------------------------------------------------------
|
---|
43 | Token* getChild(const int index) const;
|
---|
44 | int size() const;
|
---|
45 |
|
---|
46 | private:
|
---|
47 | // -----------------------------------------------------------------------
|
---|
48 | // Unimplemented constructors and operators
|
---|
49 | // -----------------------------------------------------------------------
|
---|
50 | ConcatToken(const ConcatToken&);
|
---|
51 | ConcatToken& operator=(const ConcatToken&);
|
---|
52 |
|
---|
53 | // -----------------------------------------------------------------------
|
---|
54 | // Private data members
|
---|
55 | // -----------------------------------------------------------------------
|
---|
56 | Token* fChild1;
|
---|
57 | Token* fChild2;
|
---|
58 | };
|
---|
59 |
|
---|
60 |
|
---|
61 | // ---------------------------------------------------------------------------
|
---|
62 | // StringToken: getter methods
|
---|
63 | // ---------------------------------------------------------------------------
|
---|
64 | inline int ConcatToken::size() const {
|
---|
65 |
|
---|
66 | return 2;
|
---|
67 | }
|
---|
68 |
|
---|
69 | inline Token* ConcatToken::getChild(const int index) const {
|
---|
70 |
|
---|
71 | return index == 0 ? fChild1 : fChild2;
|
---|
72 | }
|
---|
73 |
|
---|
74 | XERCES_CPP_NAMESPACE_END
|
---|
75 |
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | /**
|
---|
79 | * End of file ConcatToken.hpp
|
---|
80 | */
|
---|