Update ooo320-m1
[ooovba.git] / autodoc / source / parser_i / idoc / tk_xml.cxx
blob0d5f7ee1c2daadeaac1f288ffcacbc661c8967cf
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tk_xml.cxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include <precomp.h>
32 #include <s2_dsapi/tk_xml.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <s2_dsapi/tokintpr.hxx>
38 using csi::dsapi::Tok_XmlConst;
39 using csi::dsapi::Tok_XmlLink_Tag;
40 using csi::dsapi::Tok_XmlFormat_Tag;
43 lux::EnumValueMap G_aTok_XmlConst_EV_TokenId_Values;
44 Tok_XmlConst::EV_TokenId ev_consts_none(Tok_XmlConst::e_none,"");
45 Tok_XmlConst::EV_TokenId ev_e_true(Tok_XmlConst::e_true,"true");
46 Tok_XmlConst::EV_TokenId ev_e_false(Tok_XmlConst::e_false,"false");
47 Tok_XmlConst::EV_TokenId ev_e_null(Tok_XmlConst::e_null,"NULL");
48 Tok_XmlConst::EV_TokenId ev_e_void(Tok_XmlConst::e_void,"void");
50 lux::EnumValueMap G_aTok_XmlLink_Tag_EV_TokenId_Values;
51 Tok_XmlLink_Tag::EV_TokenId ev_linktags_none(Tok_XmlLink_Tag::e_none,"");
52 Tok_XmlLink_Tag::EV_TokenId ev_e_const(Tok_XmlLink_Tag::e_const,"const");
53 Tok_XmlLink_Tag::EV_TokenId ev_member(Tok_XmlLink_Tag::member,"member");
54 Tok_XmlLink_Tag::EV_TokenId ev_type(Tok_XmlLink_Tag::type,"type");
56 lux::EnumValueMap G_aTok_XmlFormat_Tag_EV_TokenId_Values;
57 Tok_XmlFormat_Tag::EV_TokenId ev_formattags_none(Tok_XmlFormat_Tag::e_none,"");
58 Tok_XmlFormat_Tag::EV_TokenId ev_code(Tok_XmlFormat_Tag::code,"code");
59 Tok_XmlFormat_Tag::EV_TokenId ev_listing(Tok_XmlFormat_Tag::listing,"listing");
60 Tok_XmlFormat_Tag::EV_TokenId ev_atom(Tok_XmlFormat_Tag::atom,"code");
63 namespace lux
66 template<> EnumValueMap &
67 Tok_XmlConst::EV_TokenId::Values_() { return G_aTok_XmlConst_EV_TokenId_Values; }
68 template<> EnumValueMap &
69 Tok_XmlLink_Tag::EV_TokenId::Values_() { return G_aTok_XmlLink_Tag_EV_TokenId_Values; }
70 template<> EnumValueMap &
71 Tok_XmlFormat_Tag::EV_TokenId::Values_() { return G_aTok_XmlFormat_Tag_EV_TokenId_Values; }
73 } // namespace lux
77 namespace csi
79 namespace dsapi
82 void
83 Tok_XmlConst::Trigger( TokenInterpreter & io_rInterpreter ) const
85 io_rInterpreter.Process_XmlConst(*this);
88 const char *
89 Tok_XmlConst::Text() const
91 return eTag.Text();
94 void
95 Tok_XmlLink_BeginTag::Trigger( TokenInterpreter & io_rInterpreter ) const
97 io_rInterpreter.Process_XmlLink_BeginTag(*this);
100 const char *
101 Tok_XmlLink_BeginTag::Text() const
103 static StreamStr ret(120);
104 ret.seekp(0);
105 if (sScope.length() > 0)
107 ret << "<"
108 << eTag.Text()
109 << " scope=\""
110 << sScope
111 << "\">";
113 else
115 ret << "<"
116 << eTag.Text()
117 << ">";
119 return ret.c_str();
122 void
123 Tok_XmlLink_EndTag::Trigger( TokenInterpreter & io_rInterpreter ) const
125 io_rInterpreter.Process_XmlLink_EndTag(*this);
128 const char *
129 Tok_XmlLink_EndTag::Text() const
131 static StreamStr ret(120);
132 ret.seekp(0);
133 ret << "</"
134 << eTag.Text()
135 << ">";
136 return ret.c_str();
139 void
140 Tok_XmlFormat_BeginTag::Trigger( TokenInterpreter & io_rInterpreter ) const
142 io_rInterpreter.Process_XmlFormat_BeginTag(*this);
145 const char *
146 Tok_XmlFormat_BeginTag::Text() const
148 static StreamStr ret(120);
149 ret.seekp(0);
150 ret << "<"
151 << eTag.Text()
152 << ">";
153 return ret.c_str();
156 void
157 Tok_XmlFormat_EndTag::Trigger( TokenInterpreter & io_rInterpreter ) const
159 io_rInterpreter.Process_XmlFormat_EndTag(*this);
162 const char *
163 Tok_XmlFormat_EndTag::Text() const
165 static StreamStr ret(120);
166 ret.seekp(0);
167 ret << "</"
168 << eTag.Text()
169 << ">";
170 return ret.c_str();
174 } // namespace dsapi
175 } // namespace csi