Chameleon

Chameleon Svn Source Tree

Root/branches/xZenu/src/util/doxygen/src/textdocvisitor.cpp

Source at commit 1322 created 9 years 5 months ago.
By meklort, Add doxygen to utils folder
1/******************************************************************************
2 *
3 * $Id: $
4 *
5 *
6 * Copyright (C) 1997-2011 by Dimitri van Heesch.
7 *
8 * Permission to use, copy, modify, and distribute this software and its
9 * documentation under the terms of the GNU General Public License is hereby
10 * granted. No representations are made about the suitability of this software
11 * for any purpose. It is provided "as is" without express or implied warranty.
12 * See the GNU General Public License for more details.
13 *
14 * Documents produced by Doxygen are derivative works derived from the
15 * input used in their production; they are not affected by this license.
16 *
17 */
18
19#include <qdir.h>
20#include "textdocvisitor.h"
21#include "message.h"
22
23//-------------------------------------------------------------------------
24
25void TextDocVisitor::visit(DocSymbol *s)
26{
27 switch(s->symbol())
28 {
29 case DocSymbol::BSlash: m_t << "\\"; break;
30 case DocSymbol::At: m_t << "@"; break;
31 case DocSymbol::Less: m_t << "&lt;"; break;
32 case DocSymbol::Greater: m_t << "&gt;"; break;
33 case DocSymbol::Amp: m_t << "&amp;"; break;
34 case DocSymbol::Dollar: m_t << "$"; break;
35 case DocSymbol::Hash: m_t << "#"; break;
36 case DocSymbol::DoubleColon: m_t << "::"; break;
37 case DocSymbol::Percent: m_t << "%"; break;
38 case DocSymbol::Copy: m_t << "&copy;"; break;
39 case DocSymbol::Tm: m_t << "&tm;"; break;
40 case DocSymbol::Reg: m_t << "&reg;"; break;
41 case DocSymbol::Apos: m_t << "'"; break;
42 case DocSymbol::Quot: m_t << "\""; break;
43 case DocSymbol::Lsquo: m_t << "&lsquo;"; break;
44 case DocSymbol::Rsquo: m_t << "&rsquo;"; break;
45 case DocSymbol::Ldquo: m_t << "&ldquo;"; break;
46 case DocSymbol::Rdquo: m_t << "&rdquo;"; break;
47 case DocSymbol::Ndash: m_t << "&ndash;"; break;
48 case DocSymbol::Mdash: m_t << "&mdash;"; break;
49 case DocSymbol::Uml: m_t << "&" << s->letter() << "uml;"; break;
50 case DocSymbol::Acute: m_t << "&" << s->letter() << "acute;"; break;
51 case DocSymbol::Grave: m_t << "&" << s->letter() << "grave;"; break;
52 case DocSymbol::Circ: m_t << "&" << s->letter() << "circ;"; break;
53 case DocSymbol::Slash: m_t << "&" << s->letter() << "slash;"; break;
54 case DocSymbol::Tilde: m_t << "&" << s->letter() << "tilde;"; break;
55 case DocSymbol::Szlig: m_t << "&szlig;"; break;
56 case DocSymbol::Cedil: m_t << "&" << s->letter() << "cedil;"; break;
57 case DocSymbol::Ring: m_t << "&" << s->letter() << "ring;"; break;
58 case DocSymbol::Nbsp: m_t << "&nbsp;"; break;
59 case DocSymbol::Aelig: m_t << "&aelig;"; break;
60 case DocSymbol::AElig: m_t << "&AElig;"; break;
61 default:
62 err("error: unknown symbol found\n");
63 }
64}
65
66
67void TextDocVisitor::filter(const char *str)
68{
69 if (str==0) return;
70 //printf("TextDocVisitor::filter(%s)\n",str);
71 const char *p=str;
72 char c;
73 while (*p)
74 {
75 c=*p++;
76 switch(c)
77 {
78 case '\n': m_t << " "; break;
79 case '"': m_t << "&quot;"; break;
80 case '\'': m_t << "&#39;"; break;
81 case '<': m_t << "&lt;"; break;
82 case '>': m_t << "&gt;"; break;
83 case '&': m_t << "&amp;"; break;
84 default: m_t << c;
85 }
86 }
87}
88
89

Archive Download this file

Revision: 1322