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 #include <precomp.h>
23 #include <ary_i/ci_text2.hxx>
24 
25 
26 // NOT FULLY DEFINED SERVICES
27 #include <ary_i/disdocum.hxx>
28 #include <ary_i/d_token.hxx>
29 
30 
31 namespace ary
32 {
33 namespace inf
34 {
35 
DocuTex2()36 DocuTex2::DocuTex2()
37 {
38 }
39 
~DocuTex2()40 DocuTex2::~DocuTex2()
41 {
42 	for ( TokenList::iterator iter = aTokens.begin();
43 		  iter != aTokens.end();
44 		  ++iter )
45 	{
46 		delete (*iter);
47 	}
48 }
49 
50 void
DisplayAt(DocumentationDisplay & o_rDisplay) const51 DocuTex2::DisplayAt( DocumentationDisplay & o_rDisplay ) const
52 {
53 	for ( ary::inf::DocuTex2::TokenList::const_iterator
54 				iter = aTokens.begin();
55 		  iter != aTokens.end();
56 		  ++iter )
57 	{
58 		(*iter)->DisplayAt(o_rDisplay);
59 	}
60 }
61 
62 void
AddToken(DYN DocuToken & let_drToken)63 DocuTex2::AddToken( DYN DocuToken &	let_drToken )
64 {
65     if (aTokens.empty())
66     {
67         if (let_drToken.IsWhiteOnly())
68             return;
69     }
70     aTokens.push_back(&let_drToken);
71 }
72 
73 bool
IsEmpty() const74 DocuTex2::IsEmpty() const
75 {
76 	for ( ary::inf::DocuTex2::TokenList::const_iterator
77 				iter = aTokens.begin();
78 		  iter != aTokens.end();
79 		  ++iter )
80 	{
81     	return false;
82 	}
83     return true;
84 }
85 
86 using csi::dsapi::DT_TextToken;
87 
88 const String &
TextOfFirstToken() const89 DocuTex2::TextOfFirstToken() const
90 {
91     if (NOT aTokens.empty())
92     {
93         const DT_TextToken *
94             pTok = dynamic_cast< const DT_TextToken* >(*aTokens.begin());
95 
96         if (pTok != 0)
97             return pTok->GetTextStr();
98     }
99     return String::Null_();
100 }
101 
102 String &
Access_TextOfFirstToken()103 DocuTex2::Access_TextOfFirstToken()
104 {
105     if (NOT aTokens.empty())
106     {
107         DT_TextToken *
108             pTok = dynamic_cast< DT_TextToken* >(*aTokens.begin());
109 
110         if (pTok != 0)
111             return pTok->Access_Text();
112     }
113 
114     static String sDummy_;
115     return sDummy_;
116 }
117 
118 
119 
Display_StdAtTag(const csi::dsapi::DT_StdAtTag &)120 void    DocuText_Display::Display_StdAtTag(
121 							const csi::dsapi::DT_StdAtTag & ) {}
Display_SeeAlsoAtTag(const csi::dsapi::DT_SeeAlsoAtTag &)122 void    DocuText_Display::Display_SeeAlsoAtTag(
123 							const csi::dsapi::DT_SeeAlsoAtTag & ) {}
Display_ParameterAtTag(const csi::dsapi::DT_ParameterAtTag &)124 void    DocuText_Display::Display_ParameterAtTag(
125 							const csi::dsapi::DT_ParameterAtTag & ) {}
Display_SinceAtTag(const csi::dsapi::DT_SinceAtTag &)126 void    DocuText_Display::Display_SinceAtTag(
127 							const csi::dsapi::DT_SinceAtTag & ) {}
128 
129 
130 
131 }   // namespace inf
132 }   // namespace ary
133 
134