summaryrefslogtreecommitdiffstats
path: root/src/textdocvisitor.cpp
diff options
context:
space:
mode:
authoralbert-github <albert.tests@gmail.com>2014-02-08 19:46:56 (GMT)
committeralbert-github <albert.tests@gmail.com>2014-02-08 19:46:56 (GMT)
commit1bd64ac0e925ba2ff069ec64c026ea3c32f85600 (patch)
tree0a4663d5a76502ceb35b774ac9dc491763d978b7 /src/textdocvisitor.cpp
parent0178674db5f4391e41c389d21f42656684939167 (diff)
downloadDoxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.zip
Doxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.tar.gz
Doxygen-1bd64ac0e925ba2ff069ec64c026ea3c32f85600.tar.bz2
Recognize all HTML4 special character entities
In doxygen a limited number of HTML4 special character entities are recognized, with this patch the full list of HTML4 special character entities (see http://www.w3.org/TR/html4/sgml/entities.html) is supported (as far as they can be represented in the output format). - doxygen_manual.tex - latexgen.cpp Added wasysym package to support per thousand sign (perthousand command from textcomp didn't work properly) Added option for textcomp package so currency symbol would work properly - htmlcmds.doc Adjusted documentation, listing all entities - compound.xsd - xmlgen.cpp Removed in xsd file all references for special HTML4 character entities and placed placeholder so doxygen (in xmlgen.cpp)can automatically add the right element names. - util.cpp - util.h Define all entities with their representation for all output formats. Define access routines to the different representations Mapping (for recognition of the entities) based on running through the list of available entities, after validation of the order of the entities. A few entities contain now besides letters also numbers at the end. - docparser.h Define symbols for all entities as well as a helper struct and enum. The member m_letter is not used anymore and thus removed. All existing symbols were renamed so no confusion (i.e. errors when forgetting to rename some symbols) can occur. Obsolete references to letter removed, all letters with accents etc. are explicitly defined and not through the generic accent name plus an extra letter. - docparser.cpp Adjust used symbols to their new names. Remove references to letter (as used for accents etc.) Replace list of explicitly supported entities with call to symbol code access routine. - docbookvisitor.cpp - htmldocvisitor.cpp - latexdocvisitor.cpp - mandocvisitor.cpp - perlmodgen.cpp - printdocvisitor.h - rtfdocvisitor.cpp - textdocvisitor.cpp - xmldocvisitor.cpp Replace list of explicitly supported entities with call to access routine and use returned value to output.
Diffstat (limited to 'src/textdocvisitor.cpp')
-rw-r--r--src/textdocvisitor.cpp111
1 files changed, 8 insertions, 103 deletions
diff --git a/src/textdocvisitor.cpp b/src/textdocvisitor.cpp
index 9275846..1761d12 100644
--- a/src/textdocvisitor.cpp
+++ b/src/textdocvisitor.cpp
@@ -19,115 +19,20 @@
#include <qdir.h>
#include "textdocvisitor.h"
#include "message.h"
+#include "util.h"
//-------------------------------------------------------------------------
void TextDocVisitor::visit(DocSymbol *s)
{
- switch(s->symbol())
+ const char *res = get_symbol_text(s->symbol());
+ if (res)
{
- case DocSymbol::BSlash: m_t << "\\"; break;
- case DocSymbol::At: m_t << "@"; break;
- case DocSymbol::Less: m_t << "&lt;"; break;
- case DocSymbol::Greater: m_t << "&gt;"; break;
- case DocSymbol::Amp: m_t << "&amp;"; break;
- case DocSymbol::Dollar: m_t << "$"; break;
- case DocSymbol::Hash: m_t << "#"; break;
- case DocSymbol::DoubleColon: m_t << "::"; break;
- case DocSymbol::Percent: m_t << "%"; break;
- case DocSymbol::Pipe: m_t << "|"; break;
- case DocSymbol::Copy: m_t << "&copy;"; break;
- case DocSymbol::Tm: m_t << "&tm;"; break;
- case DocSymbol::Reg: m_t << "&reg;"; break;
- case DocSymbol::Apos: m_t << "'"; break;
- case DocSymbol::Quot: m_t << "\""; break;
- case DocSymbol::Lsquo: m_t << "&lsquo;"; break;
- case DocSymbol::Rsquo: m_t << "&rsquo;"; break;
- case DocSymbol::Ldquo: m_t << "&ldquo;"; break;
- case DocSymbol::Rdquo: m_t << "&rdquo;"; break;
- case DocSymbol::Ndash: m_t << "&ndash;"; break;
- case DocSymbol::Mdash: m_t << "&mdash;"; break;
- case DocSymbol::Uml: m_t << "&" << s->letter() << "uml;"; break;
- case DocSymbol::Acute: m_t << "&" << s->letter() << "acute;"; break;
- case DocSymbol::Grave: m_t << "&" << s->letter() << "grave;"; break;
- case DocSymbol::Circ: m_t << "&" << s->letter() << "circ;"; break;
- case DocSymbol::Slash: m_t << "&" << s->letter() << "slash;"; break;
- case DocSymbol::Tilde: m_t << "&" << s->letter() << "tilde;"; break;
- case DocSymbol::Szlig: m_t << "&szlig;"; break;
- case DocSymbol::Cedil: m_t << "&" << s->letter() << "cedil;"; break;
- case DocSymbol::Ring: m_t << "&" << s->letter() << "ring;"; break;
- case DocSymbol::Nbsp: m_t << "&nbsp;"; break;
- case DocSymbol::Aelig: m_t << "&aelig;"; break;
- case DocSymbol::AElig: m_t << "&AElig;"; break;
- case DocSymbol::GrkGamma: m_t << "&Gamma;"; break;
- case DocSymbol::GrkDelta: m_t << "&Delta;"; break;
- case DocSymbol::GrkTheta: m_t << "&Theta;"; break;
- case DocSymbol::GrkLambda: m_t << "&Lambda;"; break;
- case DocSymbol::GrkXi: m_t << "&Xi;"; break;
- case DocSymbol::GrkPi: m_t << "&Pi;"; break;
- case DocSymbol::GrkSigma: m_t << "&Sigma;"; break;
- case DocSymbol::GrkUpsilon: m_t << "&Upsilon;"; break;
- case DocSymbol::GrkPhi: m_t << "&Phi;"; break;
- case DocSymbol::GrkPsi: m_t << "&Psi;"; break;
- case DocSymbol::GrkOmega: m_t << "&Omega;"; break;
- case DocSymbol::Grkalpha: m_t << "&alpha;"; break;
- case DocSymbol::Grkbeta: m_t << "&beta;"; break;
- case DocSymbol::Grkgamma: m_t << "&gamma;"; break;
- case DocSymbol::Grkdelta: m_t << "&delta;"; break;
- case DocSymbol::Grkepsilon: m_t << "&epsilon;"; break;
- case DocSymbol::Grkzeta: m_t << "&zeta;"; break;
- case DocSymbol::Grketa: m_t << "&eta;"; break;
- case DocSymbol::Grktheta: m_t << "&theta;"; break;
- case DocSymbol::Grkiota: m_t << "&iota;"; break;
- case DocSymbol::Grkkappa: m_t << "&kappa;"; break;
- case DocSymbol::Grklambda: m_t << "&lambda;"; break;
- case DocSymbol::Grkmu: m_t << "&mu;"; break;
- case DocSymbol::Grknu: m_t << "&nu;"; break;
- case DocSymbol::Grkxi: m_t << "&xi;"; break;
- case DocSymbol::Grkpi: m_t << "&pi;"; break;
- case DocSymbol::Grkrho: m_t << "&rho;"; break;
- case DocSymbol::Grksigma: m_t << "&sigma;"; break;
- case DocSymbol::Grktau: m_t << "&tau;"; break;
- case DocSymbol::Grkupsilon: m_t << "&upsilon;"; break;
- case DocSymbol::Grkphi: m_t << "&phi;"; break;
- case DocSymbol::Grkchi: m_t << "&chi;"; break;
- case DocSymbol::Grkpsi: m_t << "&psi;"; break;
- case DocSymbol::Grkomega: m_t << "&omega;"; break;
- case DocSymbol::Grkvarsigma: m_t << "&sigmaf;"; break;
- case DocSymbol::Section: m_t << "&sect;"; break;
- case DocSymbol::Degree: m_t << "&deg;"; break;
- case DocSymbol::Prime: m_t << "&prime;"; break;
- case DocSymbol::DoublePrime: m_t << "&Prime;"; break;
- case DocSymbol::Infinity: m_t << "&infin;"; break;
- case DocSymbol::EmptySet: m_t << "&empty;"; break;
- case DocSymbol::PlusMinus: m_t << "&plusmn;"; break;
- case DocSymbol::Times: m_t << "&times;"; break;
- case DocSymbol::Minus: m_t << "&minus;"; break;
- case DocSymbol::CenterDot: m_t << "&sdot;"; break;
- case DocSymbol::Partial: m_t << "&part;"; break;
- case DocSymbol::Nabla: m_t << "&nabla;"; break;
- case DocSymbol::SquareRoot: m_t << "&radic;"; break;
- case DocSymbol::Perpendicular: m_t << "&perp;"; break;
- case DocSymbol::Sum: m_t << "&sum;"; break;
- case DocSymbol::Integral: m_t << "&int;"; break;
- case DocSymbol::Product: m_t << "&prod;"; break;
- case DocSymbol::Similar: m_t << "&sim;"; break;
- case DocSymbol::Approx: m_t << "&asymp;"; break;
- case DocSymbol::NotEqual: m_t << "&ne;"; break;
- case DocSymbol::Equivalent: m_t << "&equiv;"; break;
- case DocSymbol::Proportional: m_t << "&prop;"; break;
- case DocSymbol::LessEqual: m_t << "&le;"; break;
- case DocSymbol::GreaterEqual: m_t << "&ge;"; break;
- case DocSymbol::LeftArrow: m_t << "&larr;"; break;
- case DocSymbol::RightArrow: m_t << "&rarr;"; break;
- case DocSymbol::SetIn: m_t << "&isin;"; break;
- case DocSymbol::SetNotIn: m_t << "&notin;"; break;
- case DocSymbol::LeftCeil: m_t << "&lceil;"; break;
- case DocSymbol::RightCeil: m_t << "&rceil;"; break;
- case DocSymbol::LeftFloor: m_t << "&lfloor;"; break;
- case DocSymbol::RightFloor: m_t << "&rfloor;"; break;
- default:
- err("unknown symbol found\n");
+ m_t << res;
+ }
+ else
+ {
+ err("text: non supported HTML-entity found: &%s;\n",get_symbol_item(s->symbol()));
}
}