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 ARY_INFO_ALL_DTS_HXX 25 #define ARY_INFO_ALL_DTS_HXX 26 27 28 29 // USED SERVICES 30 // BASE CLASSES 31 // COMPONENTS 32 // PARAMETERS 33 34 35 namespace ary 36 { 37 namespace info 38 { 39 40 class DocuDisplay; 41 42 class DocuToken 43 { 44 public: 45 virtual ~DocuToken() {} 46 47 void StoreAt( 48 DocuDisplay & o_rDisplay ) const; 49 bool IsWhite() const; 50 51 private: 52 virtual void do_StoreAt( 53 DocuDisplay & o_rDisplay ) const = 0; 54 virtual bool inq_IsWhite() const = 0; 55 }; 56 57 class DT_Text : public DocuToken 58 { 59 public: 60 DT_Text( 61 const char * i_sText ) 62 : sText( i_sText ) {} 63 64 const String & Text() const { return sText; } 65 66 private: 67 virtual void do_StoreAt( 68 DocuDisplay & o_rDisplay ) const; 69 virtual bool inq_IsWhite() const; 70 71 String sText; 72 }; 73 74 class DT_MaybeLink : public DocuToken 75 { 76 public: 77 DT_MaybeLink( 78 const char * i_sText, 79 bool i_bIsGlobal, 80 bool i_bIsFunction ) 81 : sText( i_sText ), 82 bIsGlobal(i_bIsGlobal), 83 bIsFunction(i_bIsFunction) { } 84 85 const String & Text() const { return sText; } 86 bool IsAbsolute() const { return bIsGlobal; } 87 bool IsFunction() const { return bIsFunction; } 88 89 private: 90 virtual void do_StoreAt( 91 DocuDisplay & o_rDisplay ) const; 92 virtual bool inq_IsWhite() const; 93 94 String sText; 95 bool bIsGlobal; 96 bool bIsFunction; 97 }; 98 99 class DT_Whitespace : public DocuToken 100 { 101 public: 102 DT_Whitespace( 103 UINT8 i_nLength ) 104 : nLength( i_nLength ) {} 105 UINT8 Length() const { return nLength; } 106 107 private: 108 virtual void do_StoreAt( 109 DocuDisplay & o_rDisplay ) const; 110 virtual bool inq_IsWhite() const; 111 112 UINT8 nLength; 113 }; 114 115 116 class DT_Eol : public DocuToken 117 { 118 virtual void do_StoreAt( 119 DocuDisplay & o_rDisplay ) const; 120 virtual bool inq_IsWhite() const; 121 }; 122 123 class DT_Xml : public DocuToken 124 { 125 public: 126 DT_Xml( 127 const char * i_sText ) 128 : sText( i_sText ) {} 129 130 const String & Text() const { return sText; } 131 132 private: 133 virtual void do_StoreAt( 134 DocuDisplay & o_rDisplay ) const; 135 virtual bool inq_IsWhite() const; 136 137 String sText; 138 }; 139 140 141 // IMPLEMENTATION 142 143 inline void 144 DocuToken::StoreAt( DocuDisplay & o_rDisplay ) const 145 { do_StoreAt(o_rDisplay); } 146 inline bool 147 DocuToken::IsWhite() const 148 { return inq_IsWhite(); } 149 150 151 152 } 153 } 154 155 #endif 156 157