diff options
Diffstat (limited to 'src')
233 files changed, 2208 insertions, 1909 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index fdfb3a0..875cf1d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -2,7 +2,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/arguments.h b/src/arguments.h index eba452c..ed09869 100644 --- a/src/arguments.h +++ b/src/arguments.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/bufstr.h b/src/bufstr.h index cfb89c4..7fb7d40 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classdef.cpp b/src/classdef.cpp index c7f677a..2443d42 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classdef.h b/src/classdef.h index 35c093c..8c5bebf 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classlist.cpp b/src/classlist.cpp index 877e993..f728530 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classlist.h b/src/classlist.h index 6a4d09c..3f15b3e 100644 --- a/src/classlist.h +++ b/src/classlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index c728be3..cbb0cb7 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cmdmapper.h b/src/cmdmapper.h index 0017c02..adfd1a6 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentcnv.h b/src/commentcnv.h index 1c1fcb9..90206df 100644 --- a/src/commentcnv.h +++ b/src/commentcnv.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentcnv.l b/src/commentcnv.l index 21ebd02..4cc9da9 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentscan.h b/src/commentscan.h index e296b89..ce28ea2 100644 --- a/src/commentscan.h +++ b/src/commentscan.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentscan.l b/src/commentscan.l index 2170dc2..fc53c57 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -1842,8 +1842,14 @@ RCSTAG "$"{ID}":"[^\n$]+"$" } else { - delete guards.pop(); - BEGIN( GuardParamEnd ); + GuardedSection *s = guards.pop(); + bool parentVisible = s->parentVisible(); + delete s; + if (parentVisible) + { + enabledSectionFound=TRUE; + BEGIN( GuardParamEnd ); + } } } <SkipGuardedSection>{CMD}"else"/{NW} { diff --git a/src/compound.xsd b/src/compound.xsd index c1eb0ab..a1c9784 100644 --- a/src/compound.xsd +++ b/src/compound.xsd @@ -390,94 +390,7 @@ <xsd:element name="anchor" type="docAnchorType" /> <xsd:element name="formula" type="docFormulaType" /> <xsd:element name="ref" type="docRefTextType" /> - <xsd:element name="copy" type="docEmptyType" /> - <xsd:element name="trademark" type="docEmptyType" /> - <xsd:element name="registered" type="docEmptyType" /> - <xsd:element name="lsquo" type="docEmptyType" /> - <xsd:element name="rsquo" type="docEmptyType" /> - <xsd:element name="ldquo" type="docEmptyType" /> - <xsd:element name="rdquo" type="docEmptyType" /> - <xsd:element name="ndash" type="docEmptyType" /> - <xsd:element name="mdash" type="docEmptyType" /> - <xsd:element name="umlaut" type="docCharType" /> - <xsd:element name="acute" type="docCharType" /> - <xsd:element name="grave" type="docCharType" /> - <xsd:element name="circ" type="docCharType" /> - <xsd:element name="slash" type="docCharType" /> - <xsd:element name="tilde" type="docCharType" /> - <xsd:element name="cedil" type="docCharType" /> - <xsd:element name="ring" type="docCharType" /> - <xsd:element name="szlig" type="docEmptyType" /> - <xsd:element name="nonbreakablespace" type="docEmptyType" /> - <xsd:element name="aelig" type="docEmptyType" /> - <xsd:element name="AElig" type="docEmptyType" /> - <xsd:element name="Gamma" type="docEmptyType" /> - <xsd:element name="Delta" type="docEmptyType" /> - <xsd:element name="Theta" type="docEmptyType" /> - <xsd:element name="Lambda" type="docEmptyType" /> - <xsd:element name="Xi" type="docEmptyType" /> - <xsd:element name="Pi" type="docEmptyType" /> - <xsd:element name="Sigma" type="docEmptyType" /> - <xsd:element name="Upsilon" type="docEmptyType" /> - <xsd:element name="Phi" type="docEmptyType" /> - <xsd:element name="Psi" type="docEmptyType" /> - <xsd:element name="Omega" type="docEmptyType" /> - <xsd:element name="alpha" type="docEmptyType" /> - <xsd:element name="beta" type="docEmptyType" /> - <xsd:element name="gamma" type="docEmptyType" /> - <xsd:element name="delta" type="docEmptyType" /> - <xsd:element name="epsilon" type="docEmptyType" /> - <xsd:element name="zeta" type="docEmptyType" /> - <xsd:element name="eta" type="docEmptyType" /> - <xsd:element name="theta" type="docEmptyType" /> - <xsd:element name="iota" type="docEmptyType" /> - <xsd:element name="kappa" type="docEmptyType" /> - <xsd:element name="lambda" type="docEmptyType" /> - <xsd:element name="mu" type="docEmptyType" /> - <xsd:element name="nu" type="docEmptyType" /> - <xsd:element name="xi" type="docEmptyType" /> - <xsd:element name="pi" type="docEmptyType" /> - <xsd:element name="rho" type="docEmptyType" /> - <xsd:element name="sigma" type="docEmptyType" /> - <xsd:element name="tau" type="docEmptyType" /> - <xsd:element name="upsilon" type="docEmptyType" /> - <xsd:element name="phi" type="docEmptyType" /> - <xsd:element name="chi" type="docEmptyType" /> - <xsd:element name="psi" type="docEmptyType" /> - <xsd:element name="omega" type="docEmptyType" /> - <xsd:element name="sigmaf" type="docEmptyType" /> - <xsd:element name="sect" type="docEmptyType" /> - <xsd:element name="deg" type="docEmptyType" /> - <xsd:element name="prime" type="docEmptyType" /> - <xsd:element name="Prime" type="docEmptyType" /> - <xsd:element name="infin" type="docEmptyType" /> - <xsd:element name="empty" type="docEmptyType" /> - <xsd:element name="plusmn" type="docEmptyType" /> - <xsd:element name="times" type="docEmptyType" /> - <xsd:element name="minus" type="docEmptyType" /> - <xsd:element name="sdot" type="docEmptyType" /> - <xsd:element name="part" type="docEmptyType" /> - <xsd:element name="nabla" type="docEmptyType" /> - <xsd:element name="radic" type="docEmptyType" /> - <xsd:element name="perp" type="docEmptyType" /> - <xsd:element name="sum" type="docEmptyType" /> - <xsd:element name="int" type="docEmptyType" /> - <xsd:element name="prod" type="docEmptyType" /> - <xsd:element name="sim" type="docEmptyType" /> - <xsd:element name="asymp" type="docEmptyType" /> - <xsd:element name="ne" type="docEmptyType" /> - <xsd:element name="equiv" type="docEmptyType" /> - <xsd:element name="prop" type="docEmptyType" /> - <xsd:element name="le" type="docEmptyType" /> - <xsd:element name="ge" type="docEmptyType" /> - <xsd:element name="larr" type="docEmptyType" /> - <xsd:element name="rarr" type="docEmptyType" /> - <xsd:element name="isin" type="docEmptyType" /> - <xsd:element name="notin" type="docEmptyType" /> - <xsd:element name="lceil" type="docEmptyType" /> - <xsd:element name="rceil" type="docEmptyType" /> - <xsd:element name="lfloor" type="docEmptyType" /> - <xsd:element name="rfloor" type="docEmptyType" /> + <!-- Automatically insert here the HTML entities --> </xsd:choice> </xsd:group> @@ -717,10 +630,6 @@ </xsd:sequence> </xsd:complexType> - <xsd:complexType name="docCharType"> - <xsd:attribute name="char" type="DoxCharRange"/> - </xsd:complexType> - <xsd:complexType name="docEmptyType"/> <!-- Simple types --> diff --git a/src/condparser.cpp b/src/condparser.cpp index c99a232..67da1e3 100644 --- a/src/condparser.cpp +++ b/src/condparser.cpp @@ -1,5 +1,5 @@ /** - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/condparser.h b/src/condparser.h index a4dfee8..0310f36 100644 --- a/src/condparser.h +++ b/src/condparser.h @@ -2,7 +2,7 @@ #define CONDPARSER_H /** - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/config.h b/src/config.h index bb5d733..756e94e 100644 --- a/src/config.h +++ b/src/config.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/config.l b/src/config.l index 7d451b0..377d6e4 100644 --- a/src/config.l +++ b/src/config.l @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/config.xml b/src/config.xml index 45a36e8..dcaa372 100644 --- a/src/config.xml +++ b/src/config.xml @@ -6,7 +6,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/configgen.py b/src/configgen.py index 4aed8bf..4023930 100755 --- a/src/configgen.py +++ b/src/configgen.py @@ -1,7 +1,7 @@ #!/usr/bin/python # python script to generate configoptions.cpp and config.doc from config.xml # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/configoptions.h b/src/configoptions.h index 8b4fc22..be8ecf6 100644 --- a/src/configoptions.h +++ b/src/configoptions.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/constexp.h b/src/constexp.h index 1828b0b..27ca039 100644 --- a/src/constexp.h +++ b/src/constexp.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/constexp.l b/src/constexp.l index b333c72..bb4f842 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/constexp.y b/src/constexp.y index 421e26e..1475c1c 100644 --- a/src/constexp.y +++ b/src/constexp.y @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/context.cpp b/src/context.cpp index 89b8e0e..3641d1d 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -504,6 +504,10 @@ class TranslateContext::Private : public PropertyMapper { return theTranslator->trCompoundList(); } + TemplateVariant classListDescription() const + { + return theTranslator->trCompoundListDescription(); + } TemplateVariant classIndex() const { return theTranslator->trCompoundIndex(); @@ -713,6 +717,10 @@ class TranslateContext::Private : public PropertyMapper { return theTranslator->trCompoundMembers(); } + TemplateVariant detailLevel() const + { + return theTranslator->trDetailLevel(); + } Private() { //%% string generatedBy @@ -727,6 +735,8 @@ class TranslateContext::Private : public PropertyMapper addProperty("classes", this,&Private::classes); //%% string classList addProperty("classList", this,&Private::classList); + //%% string classListDescription + addProperty("classListDescription", this,&Private::classListDescription); //%% string classIndex addProperty("classIndex", this,&Private::classIndex); //%% string classHierarchy @@ -819,6 +829,8 @@ class TranslateContext::Private : public PropertyMapper addProperty("classDocumentation", this,&Private::classDocumentation); //%% string compoundMembers addProperty("compoundMembers", this,&Private::compoundMembers); + //%% strint detailLevel + addProperty("detailLevel", this,&Private::detailLevel); m_javaOpt = Config_getBool("OPTIMIZE_OUTPUT_JAVA"); m_fortranOpt = Config_getBool("OPTIMIZE_FOR_FORTRAN"); @@ -1984,6 +1996,7 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri addProperty("highlight",this,&Private::highlight); addProperty("subhighlight",this,&Private::subHighlight); addProperty("compoundType",this,&Private::compoundType); + addProperty("hasDetails",this,&Private::hasDetails); } TemplateVariant title() const { @@ -2001,6 +2014,10 @@ class NamespaceContext::Private : public DefinitionContext<NamespaceContext::Pri { return m_namespaceDef->compoundTypeString(); } + TemplateVariant hasDetails() const + { + return m_namespaceDef->hasDetailedDescription(); + } private: NamespaceDef *m_namespaceDef; }; @@ -4055,9 +4072,9 @@ TemplateVariant ClassHierarchyContext::get(const char *name) const class NestingNodeContext::Private : public PropertyMapper { public: - Private(Definition *d,bool addCls) : m_def(d), - m_classContext(m_def->definitionType()==Definition::TypeClass?(ClassDef*)d:0), - m_namespaceContext(m_def->definitionType()==Definition::TypeNamespace?(NamespaceDef*)d:0) + Private(const NestingNodeContext *parent,const NestingNodeContext *thisNode, + Definition *d,int index,int level,bool addCls) + : m_parent(parent), m_def(d), m_children(thisNode,level+1), m_level(level), m_index(index) { //%% bool is_leaf_node: true if this node does not have any children addProperty("is_leaf_node",this,&Private::isLeafNode); @@ -4067,6 +4084,23 @@ class NestingNodeContext::Private : public PropertyMapper addProperty("class",this,&Private::getClass); //%% [optional] Namespace namespace: namespace info (if this node represents a namespace) addProperty("namespace",this,&Private::getNamespace); + //%% [optional] File file: file info (if this node represents a file) + addProperty("file",this,&Private::file); + //%% [optional] Dir dir: directory info (if this node represents a directory) + addProperty("dir",this,&Private::dir); + //%% int id + addProperty("id",this,&Private::id); + //%% string level + addProperty("level",this,&Private::level); + //%% string name + addProperty("name",this,&Private::name); + //%% string brief + addProperty("brief",this,&Private::brief); + //%% bool isLinkable + addProperty("isLinkable",this,&Private::isLinkable); + addProperty("anchor",this,&Private::anchor); + addProperty("fileName",this,&Private::fileName); + addNamespaces(addCls); addClasses(); } @@ -4080,9 +4114,13 @@ class NestingNodeContext::Private : public PropertyMapper } TemplateVariant getClass() const { - if (m_def->definitionType()==Definition::TypeClass) + if (!m_cache.classContext && m_def->definitionType()==Definition::TypeClass) { - return TemplateVariant(&m_classContext); + m_cache.classContext.reset(new ClassContext((ClassDef*)m_def)); + } + if (m_cache.classContext) + { + return m_cache.classContext.get(); } else { @@ -4091,15 +4129,76 @@ class NestingNodeContext::Private : public PropertyMapper } TemplateVariant getNamespace() const { - if (m_def->definitionType()==Definition::TypeNamespace) + if (!m_cache.namespaceContext && m_def->definitionType()==Definition::TypeNamespace) + { + m_cache.namespaceContext.reset(new NamespaceContext((NamespaceDef*)m_def)); + } + if (m_cache.namespaceContext) { - return TemplateVariant(&m_namespaceContext); + return m_cache.namespaceContext.get(); } else { return TemplateVariant(FALSE); } } + TemplateVariant file() const + { + return FALSE; + } + TemplateVariant dir() const + { + return FALSE; + } + TemplateVariant level() const + { + return m_level; + } + TemplateVariant id() const + { + QCString result; + if (m_parent) result=m_parent->id(); + result+=QCString().setNum(m_index)+"_"; + return result; + } + TemplateVariant name() const + { + return m_def->name(); + } + QCString relPathAsString() const + { + static bool createSubdirs = Config_getBool("CREATE_SUBDIRS"); + return createSubdirs ? QCString("../../") : QCString(""); + } + TemplateVariant brief() const + { + if (!m_cache.brief) + { + if (m_def->hasBriefDescription()) + { + m_cache.brief.reset(new TemplateVariant(parseDoc(m_def,m_def->briefFile(),m_def->briefLine(), + "",m_def->briefDescription(),TRUE))); + } + else + { + m_cache.brief.reset(new TemplateVariant("")); + } + } + return *m_cache.brief; + } + TemplateVariant isLinkable() const + { + return m_def->isLinkable(); + } + TemplateVariant anchor() const + { + return m_def->anchor(); + } + TemplateVariant fileName() const + { + return m_def->getOutputFileBase(); + } + void addClasses() { ClassDef *cd = m_def->definitionType()==Definition::TypeClass ? (ClassDef*)m_def : 0; @@ -4120,17 +4219,26 @@ class NestingNodeContext::Private : public PropertyMapper m_children.addClasses(*nd->getClassSDict(),FALSE); } } - Definition *m_def; private: + const NestingNodeContext *m_parent; + Definition *m_def; NestingContext m_children; - ClassContext m_classContext; - NamespaceContext m_namespaceContext; + int m_level; + int m_index; + struct Cachable + { + ScopedPtr<ClassContext> classContext; + ScopedPtr<NamespaceContext> namespaceContext; + ScopedPtr<TemplateVariant> brief; + }; + mutable Cachable m_cache; }; //%% } -NestingNodeContext::NestingNodeContext(Definition *d,bool addClass) +NestingNodeContext::NestingNodeContext(const NestingNodeContext *parent, + Definition *d,int index,int level,bool addClass) { - p = new Private(d,addClass); + p = new Private(parent,this,d,index,level,addClass); } NestingNodeContext::~NestingNodeContext() @@ -4143,12 +4251,20 @@ TemplateVariant NestingNodeContext::get(const char *n) const return p->get(n); } +QCString NestingNodeContext::id() const +{ + return p->id().toString(); +} + //------------------------------------------------------------------------ //%% list Nesting[NestingNode]: namespace and class nesting relations class NestingContext::Private : public GenericNodeListContext<NestingNodeContext> { public: + Private(const NestingNodeContext *parent,int level) + : m_parent(parent), m_level(level), m_index(0) {} + void addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bool addClasses) { NamespaceSDict::Iterator nli(nsDict); @@ -4162,8 +4278,9 @@ class NestingContext::Private : public GenericNodeListContext<NestingNodeContext bool isLinkable = nd->isLinkableInProject(); if (isLinkable || hasChildren) { - NestingNodeContext *nnc = new NestingNodeContext(nd,addClasses); + NestingNodeContext *nnc = new NestingNodeContext(m_parent,nd,m_index,m_level,addClasses); append(nnc); + m_index++; } } } @@ -4190,17 +4307,22 @@ class NestingContext::Private : public GenericNodeListContext<NestingNodeContext { if (classVisibleInIndex(cd) && cd->templateMaster()==0) { - NestingNodeContext *nnc = new NestingNodeContext(cd,TRUE); + NestingNodeContext *nnc = new NestingNodeContext(m_parent,cd,m_index,m_level,TRUE); append(nnc); + m_index++; } } } } + private: + const NestingNodeContext *m_parent; + int m_level; + int m_index; }; -NestingContext::NestingContext() +NestingContext::NestingContext(const NestingNodeContext *parent,int level) { - p = new Private; + p = new Private(parent,level); } NestingContext::~NestingContext() @@ -4236,11 +4358,71 @@ void NestingContext::addNamespaces(const NamespaceSDict &nsDict,bool rootOnly,bo //------------------------------------------------------------------------ +static int computeMaxDepth(const TemplateListIntf *list) +{ + int maxDepth=0; + if (list) + { + TemplateListIntf::ConstIterator *it = list->createIterator(); + TemplateVariant v; + for (it->toFirst();it->current(v);it->toNext()) + { + const TemplateStructIntf *s = v.toStruct(); + TemplateVariant child = s->get("children"); + int d = computeMaxDepth(child.toList())+1; + if (d>maxDepth) maxDepth=d; + } + delete it; + } + return maxDepth; +} + +static int computeNumNodesAtLevel(const TemplateStructIntf *s,int level,int maxLevel) +{ + int num=0; + if (level<maxLevel) + { + num++; + TemplateVariant child = s->get("children"); + if (child.toList()) + { + TemplateListIntf::ConstIterator *it = child.toList()->createIterator(); + TemplateVariant v; + for (it->toFirst();it->current(v);it->toNext()) + { + num+=computeNumNodesAtLevel(v.toStruct(),level+1,maxLevel); + } + delete it; + } + } + return num; +} + //%% struct ClassTree: Class nesting relations //%% { class ClassTreeContext::Private : public PropertyMapper { public: + Private() : m_classTree(0,0) + { + if (Doxygen::namespaceSDict) + { + m_classTree.addNamespaces(*Doxygen::namespaceSDict,TRUE,TRUE); + } + if (Doxygen::classSDict) + { + m_classTree.addClasses(*Doxygen::classSDict,TRUE); + } + //%% Nesting tree + addProperty("tree",this,&Private::tree); + addProperty("fileName",this,&Private::fileName); + addProperty("relPath",this,&Private::relPath); + addProperty("highlight",this,&Private::highlight); + addProperty("subhighlight",this,&Private::subhighlight); + addProperty("title",this,&Private::title); + addProperty("preferredDepth",this,&Private::preferredDepth); + addProperty("maxDepth",this,&Private::maxDepth); + } TemplateVariant tree() const { return TemplateVariant(&m_classTree); @@ -4278,26 +4460,59 @@ class ClassTreeContext::Private : public PropertyMapper return theTranslator->trClasses(); } } - Private() + TemplateVariant maxDepth() const { - if (Doxygen::namespaceSDict) + if (!m_cache.maxDepthComputed) { - m_classTree.addNamespaces(*Doxygen::namespaceSDict,TRUE,TRUE); + m_cache.maxDepth = computeMaxDepth(&m_classTree); + m_cache.maxDepthComputed=TRUE; } - if (Doxygen::classSDict) + return m_cache.maxDepth; + } + TemplateVariant preferredDepth() const + { + if (!m_cache.preferredDepthComputed) { - m_classTree.addClasses(*Doxygen::classSDict,TRUE); + int preferredNumEntries = Config_getInt("HTML_INDEX_NUM_ENTRIES"); + m_cache.preferredDepth=1; + if (preferredNumEntries>0) + { + int depth = maxDepth().toInt(); + for (int i=1;i<=depth;i++) + { + int num=0; + TemplateListIntf::ConstIterator *it = m_classTree.createIterator(); + TemplateVariant v; + for (it->toFirst();it->current(v);it->toNext()) + { + num+=computeNumNodesAtLevel(v.toStruct(),0,i); + } + delete it; + if (num<=preferredNumEntries) + { + m_cache.preferredDepth=i; + } + else + { + break; + } + } + } + m_cache.preferredDepthComputed=TRUE; } - //%% Nesting tree - addProperty("tree",this,&Private::tree); - addProperty("fileName",this,&Private::fileName); - addProperty("relPath",this,&Private::relPath); - addProperty("highlight",this,&Private::highlight); - addProperty("subhighlight",this,&Private::subhighlight); - addProperty("title",this,&Private::title); + return m_cache.preferredDepth; } private: NestingContext m_classTree; + struct Cachable + { + Cachable() : maxDepthComputed(FALSE), preferredDepthComputed(FALSE) {} + int maxDepth; + bool maxDepthComputed; + int preferredDepth; + bool preferredDepthComputed; + }; + mutable Cachable m_cache; }; //%% } @@ -4408,7 +4623,7 @@ class NamespaceTreeContext::Private : public PropertyMapper return theTranslator->trNamespaceList(); } } - Private() + Private() : m_namespaceTree(0,0) { if (Doxygen::namespaceSDict) { diff --git a/src/context.h b/src/context.h index 7506471..589a873 100644 --- a/src/context.h +++ b/src/context.h @@ -366,8 +366,10 @@ class ClassHierarchyContext : public TemplateStructIntf class NestingNodeContext : public TemplateStructIntf { public: - NestingNodeContext(Definition *,bool addClasses); + NestingNodeContext(const NestingNodeContext *parent, + Definition *,int index,int level,bool addClasses); ~NestingNodeContext(); + QCString id() const; // TemplateStructIntf methods virtual TemplateVariant get(const char *name) const; @@ -382,7 +384,7 @@ class NestingNodeContext : public TemplateStructIntf class NestingContext : public TemplateListIntf { public: - NestingContext(); + NestingContext(const NestingNodeContext *parent,int level); ~NestingContext(); // TemplateListIntf diff --git a/src/cppvalue.cpp b/src/cppvalue.cpp index 7efb4f8..a99ec56 100644 --- a/src/cppvalue.cpp +++ b/src/cppvalue.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cppvalue.h b/src/cppvalue.h index 3f3ac3a..67c5433 100644 --- a/src/cppvalue.h +++ b/src/cppvalue.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/debug.cpp b/src/debug.cpp index a5000ff..e27ce11 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/debug.h b/src/debug.h index e1affab..e17c03c 100644 --- a/src/debug.h +++ b/src/debug.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/declinfo.h b/src/declinfo.h index 3d8cb87..5f11a1c 100644 --- a/src/declinfo.h +++ b/src/declinfo.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/declinfo.l b/src/declinfo.l index 58ecb05..f238be3 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defargs.h b/src/defargs.h index 1dbabdb..6ebfe1d 100644 --- a/src/defargs.h +++ b/src/defargs.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defargs.l b/src/defargs.l index 5f64b66..164c100 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defgen.cpp b/src/defgen.cpp index 4e0e5b8..358cd24 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defgen.h b/src/defgen.h index 290a415..696fb5c 100644 --- a/src/defgen.h +++ b/src/defgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/define.cpp b/src/define.cpp index 76a64e1..75459c9 100644 --- a/src/define.cpp +++ b/src/define.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/define.h b/src/define.h index bc758c0..7971cc4 100644 --- a/src/define.h +++ b/src/define.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/definition.cpp b/src/definition.cpp index 8be2217..c4b9f77 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/definition.h b/src/definition.h index b798e14..dfd9dad 100644 --- a/src/definition.h +++ b/src/definition.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/dia.cpp b/src/dia.cpp index 1032564..955171c 100644 --- a/src/dia.cpp +++ b/src/dia.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/diagram.cpp b/src/diagram.cpp index a7d2aa4..e50baec 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/diagram.h b/src/diagram.h index 62cab2e..6ce83f3 100644 --- a/src/diagram.h +++ b/src/diagram.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/dirdef.h b/src/dirdef.h index dc2d01e..6650d45 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index 93ef8d8..2011333 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -2,7 +2,7 @@ * * * -* Copyright (C) 1997-2012 by Dimitri van Heesch. +* Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docbookgen.h b/src/docbookgen.h index 344cb5b..0431cf2 100644 --- a/src/docbookgen.h +++ b/src/docbookgen.h @@ -2,7 +2,7 @@ * * * -* Copyright (C) 1997-2012 by Dimitri van Heesch. +* Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docbookvisitor.cpp b/src/docbookvisitor.cpp index aaea045..526ed49 100644 --- a/src/docbookvisitor.cpp +++ b/src/docbookvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2012 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -33,6 +33,7 @@ #include "filedef.h" #include "msc.h" #include "dia.h" +#include "htmlentity.h" DocbookDocVisitor::DocbookDocVisitor(FTextStream &t,CodeOutputInterface &ci) : DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE) @@ -73,109 +74,14 @@ void DocbookDocVisitor::visit(DocWhiteSpace *w) void DocbookDocVisitor::visit(DocSymbol *s) { if (m_hide) return; - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->docbook(s->symbol()); + if (res) { - case DocSymbol::BSlash: m_t << "\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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::Copy: m_t << "©"; break; - case DocSymbol::Tm: m_t << "™"; break; - case DocSymbol::Reg: m_t << "®"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << """; break; - case DocSymbol::Lsquo: m_t << "‘"; break; - case DocSymbol::Rsquo: m_t << "’"; break; - case DocSymbol::Ldquo: m_t << "“"; break; - case DocSymbol::Rdquo: m_t << "”"; break; - case DocSymbol::Ndash: m_t << "–"; break; - case DocSymbol::Mdash: m_t << "—"; break; - case DocSymbol::Uml: m_t << "¨"; break; - case DocSymbol::Acute: m_t << "´"; break; - case DocSymbol::Grave: m_t << "À"; break; - case DocSymbol::Circ: m_t << "ˆ"; break; - case DocSymbol::Tilde: m_t << "˜"; break; - case DocSymbol::Szlig: m_t << "ß"; break; - case DocSymbol::Cedil: m_t << "¸"; break; - case DocSymbol::Ring: m_t << "Å"; break; - case DocSymbol::Slash: m_t << "Ø"; break; - case DocSymbol::Nbsp: m_t << " "; break; - case DocSymbol::Aelig: m_t << "æ"; break; - case DocSymbol::AElig: m_t << "Æ"; break; - case DocSymbol::GrkGamma: m_t << "Γ"; break; - case DocSymbol::GrkDelta: m_t << "Δ"; break; - case DocSymbol::GrkTheta: m_t << "Θ"; break; - case DocSymbol::GrkLambda: m_t << "Λ"; break; - case DocSymbol::GrkXi: m_t << "Ξ"; break; - case DocSymbol::GrkPi: m_t << "Π"; break; - case DocSymbol::GrkSigma: m_t << "Σ"; break; - case DocSymbol::GrkUpsilon: m_t << "Υ"; break; - case DocSymbol::GrkPhi: m_t << "Φ"; break; - case DocSymbol::GrkPsi: m_t << "Ψ"; break; - case DocSymbol::GrkOmega: m_t << "Ω"; break; - case DocSymbol::Grkalpha: m_t << "α"; break; - case DocSymbol::Grkbeta: m_t << "β"; break; - case DocSymbol::Grkgamma: m_t << "γ"; break; - case DocSymbol::Grkdelta: m_t << "δ"; break; - case DocSymbol::Grkepsilon: m_t << "ε"; break; - case DocSymbol::Grkzeta: m_t << "ζ"; break; - case DocSymbol::Grketa: m_t << "η"; break; - case DocSymbol::Grktheta: m_t << "θ"; break; - case DocSymbol::Grkiota: m_t << "ι"; break; - case DocSymbol::Grkkappa: m_t << "κ"; break; - case DocSymbol::Grklambda: m_t << "λ"; break; - case DocSymbol::Grkmu: m_t << "μ"; break; - case DocSymbol::Grknu: m_t << "ν"; break; - case DocSymbol::Grkxi: m_t << "ξ"; break; - case DocSymbol::Grkpi: m_t << "π"; break; - case DocSymbol::Grkrho: m_t << "ρ"; break; - case DocSymbol::Grksigma: m_t << "σ"; break; - case DocSymbol::Grktau: m_t << "τ"; break; - case DocSymbol::Grkupsilon: m_t << "υ"; break; - case DocSymbol::Grkphi: m_t << "φ"; break; - case DocSymbol::Grkchi: m_t << "χ"; break; - case DocSymbol::Grkpsi: m_t << "ψ"; break; - case DocSymbol::Grkomega: m_t << "ω"; break; - case DocSymbol::Grkvarsigma: m_t << "ς"; break; - case DocSymbol::Section: m_t << "<simplesect/>"; break; - case DocSymbol::Degree: m_t << "°"; break; - case DocSymbol::Prime: m_t << "′"; break; - case DocSymbol::DoublePrime: m_t << "″"; break; - case DocSymbol::Infinity: m_t << "∞"; break; - case DocSymbol::EmptySet: m_t << "∅"; break; - case DocSymbol::PlusMinus: m_t << "±"; break; - case DocSymbol::Times: m_t << "×"; break; - case DocSymbol::Minus: m_t << "−"; break; - case DocSymbol::CenterDot: m_t << "⋅"; break; - case DocSymbol::Partial: m_t << "∂"; break; - case DocSymbol::Nabla: m_t << "∇"; break; - case DocSymbol::SquareRoot: m_t << "√"; break; - case DocSymbol::Perpendicular: m_t << "⊥"; break; - case DocSymbol::Sum: m_t << "∑"; break; - case DocSymbol::Integral: m_t << "∫"; break; - case DocSymbol::Product: m_t << "∏"; break; - case DocSymbol::Similar: m_t << "∼"; break; - case DocSymbol::Approx: m_t << "≈"; break; - case DocSymbol::NotEqual: m_t << "≠"; break; - case DocSymbol::Equivalent: m_t << "≡"; break; - case DocSymbol::Proportional: m_t << "∝"; break; - case DocSymbol::LessEqual: m_t << "≤"; break; - case DocSymbol::GreaterEqual: m_t << "≥"; break; - case DocSymbol::LeftArrow: m_t << "←"; break; - case DocSymbol::RightArrow: m_t << "→"; break; - case DocSymbol::SetIn: m_t << "∈"; break; - case DocSymbol::SetNotIn: m_t << "∉"; break; - case DocSymbol::LeftCeil: m_t << "⌈"; break; - case DocSymbol::RightCeil: m_t << "⌉"; break; - case DocSymbol::LeftFloor: m_t << "⌊"; break; - case DocSymbol::RightFloor: m_t << "⌋"; break; - default: - err("unknown symbol found\n"); + m_t << res; + } + else + { + err("DocBook: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } diff --git a/src/docbookvisitor.h b/src/docbookvisitor.h index a03e04a..20d424e 100644 --- a/src/docbookvisitor.h +++ b/src/docbookvisitor.h @@ -2,7 +2,7 @@ * * * -* Copyright (C) 1997-2012 by Dimitri van Heesch. +* Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docparser.cpp b/src/docparser.cpp index 7e34ad0..927b3ee 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -53,6 +53,7 @@ #include "config.h" #include "growbuf.h" #include "markdown.h" +#include "htmlentity.h" // debug off #define DBG(x) do {} while(0) @@ -1244,34 +1245,34 @@ reparsetoken: switch (Mappers::cmdMapper->map(tokenName)) { case CMD_BSLASH: - children.append(new DocSymbol(parent,DocSymbol::BSlash)); + children.append(new DocSymbol(parent,DocSymbol::Sym_BSlash)); break; case CMD_AT: - children.append(new DocSymbol(parent,DocSymbol::At)); + children.append(new DocSymbol(parent,DocSymbol::Sym_At)); break; case CMD_LESS: - children.append(new DocSymbol(parent,DocSymbol::Less)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Less)); break; case CMD_GREATER: - children.append(new DocSymbol(parent,DocSymbol::Greater)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Greater)); break; case CMD_AMP: - children.append(new DocSymbol(parent,DocSymbol::Amp)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Amp)); break; case CMD_DOLLAR: - children.append(new DocSymbol(parent,DocSymbol::Dollar)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Dollar)); break; case CMD_HASH: - children.append(new DocSymbol(parent,DocSymbol::Hash)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Hash)); break; case CMD_DCOLON: - children.append(new DocSymbol(parent,DocSymbol::DoubleColon)); + children.append(new DocSymbol(parent,DocSymbol::Sym_DoubleColon)); break; case CMD_PERCENT: - children.append(new DocSymbol(parent,DocSymbol::Percent)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Percent)); break; case CMD_QUOTE: - children.append(new DocSymbol(parent,DocSymbol::Quot)); + children.append(new DocSymbol(parent,DocSymbol::Sym_Quot)); break; case CMD_EMPHASIS: { @@ -1488,11 +1489,10 @@ reparsetoken: break; case TK_SYMBOL: { - char letter='\0'; - DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName,&letter); - if (s!=DocSymbol::Unknown) + DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName); + if (s!=DocSymbol::Sym_Unknown) { - children.append(new DocSymbol(parent,s,letter)); + children.append(new DocSymbol(parent,s)); } else { @@ -1571,138 +1571,10 @@ static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribL //--------------------------------------------------------------------------- -DocSymbol::SymType DocSymbol::decodeSymbol(const QCString &symName,char *letter) -{ - int l=symName.length(); - DBG(("decodeSymbol(%s) l=%d\n",qPrint(symName),l)); - // TODO: replace this with a hash - if (symName=="©") return DocSymbol::Copy; - else if (symName=="™") return DocSymbol::Tm; - else if (symName=="&tm;") return DocSymbol::Tm; // alias for ™ - else if (symName=="®") return DocSymbol::Reg; - else if (symName=="<") return DocSymbol::Less; - else if (symName==">") return DocSymbol::Greater; - else if (symName=="&") return DocSymbol::Amp; - else if (symName=="'") return DocSymbol::Apos; - else if (symName==""") return DocSymbol::Quot; - else if (symName=="‘") return DocSymbol::Lsquo; - else if (symName=="’") return DocSymbol::Rsquo; - else if (symName=="“") return DocSymbol::Ldquo; - else if (symName=="”") return DocSymbol::Rdquo; - else if (symName=="–") return DocSymbol::Ndash; - else if (symName=="—") return DocSymbol::Mdash; - else if (symName=="ß") return DocSymbol::Szlig; - else if (symName==" ") return DocSymbol::Nbsp; - else if (symName=="Æ") return DocSymbol::AElig; - else if (symName=="æ") return DocSymbol::Aelig; - else if (symName=="Γ") return DocSymbol::GrkGamma; - else if (symName=="Δ") return DocSymbol::GrkDelta; - else if (symName=="Θ") return DocSymbol::GrkTheta; - else if (symName=="Λ") return DocSymbol::GrkLambda; - else if (symName=="Ξ") return DocSymbol::GrkXi; - else if (symName=="Π") return DocSymbol::GrkPi; - else if (symName=="Σ") return DocSymbol::GrkSigma; - else if (symName=="Υ") return DocSymbol::GrkUpsilon; - else if (symName=="Φ") return DocSymbol::GrkPhi; - else if (symName=="Ψ") return DocSymbol::GrkPsi; - else if (symName=="Ω") return DocSymbol::GrkOmega; - else if (symName=="α") return DocSymbol::Grkalpha; - else if (symName=="β") return DocSymbol::Grkbeta; - else if (symName=="γ") return DocSymbol::Grkgamma; - else if (symName=="δ") return DocSymbol::Grkdelta; - else if (symName=="ε") return DocSymbol::Grkepsilon; - else if (symName=="ζ") return DocSymbol::Grkzeta; - else if (symName=="η") return DocSymbol::Grketa; - else if (symName=="θ") return DocSymbol::Grktheta; - else if (symName=="ι") return DocSymbol::Grkiota; - else if (symName=="κ") return DocSymbol::Grkkappa; - else if (symName=="λ") return DocSymbol::Grklambda; - else if (symName=="μ") return DocSymbol::Grkmu; - else if (symName=="ν") return DocSymbol::Grknu; - else if (symName=="ξ") return DocSymbol::Grkxi; - else if (symName=="π") return DocSymbol::Grkpi; - else if (symName=="ρ") return DocSymbol::Grkrho; - else if (symName=="σ") return DocSymbol::Grksigma; - else if (symName=="τ") return DocSymbol::Grktau; - else if (symName=="υ") return DocSymbol::Grkupsilon; - else if (symName=="φ") return DocSymbol::Grkphi; - else if (symName=="χ") return DocSymbol::Grkchi; - else if (symName=="ψ") return DocSymbol::Grkpsi; - else if (symName=="ω") return DocSymbol::Grkomega; - else if (symName=="ς") return DocSymbol::Grkvarsigma; - else if (symName=="§") return DocSymbol::Section; - else if (symName=="°") return DocSymbol::Degree; - else if (symName=="′") return DocSymbol::Prime; - else if (symName=="″") return DocSymbol::DoublePrime; - else if (symName=="∞") return DocSymbol::Infinity; - else if (symName=="∅") return DocSymbol::EmptySet; - else if (symName=="±") return DocSymbol::PlusMinus; - else if (symName=="×") return DocSymbol::Times; - else if (symName=="−") return DocSymbol::Minus; - else if (symName=="⋅") return DocSymbol::CenterDot; - else if (symName=="∂") return DocSymbol::Partial; - else if (symName=="∇") return DocSymbol::Nabla; - else if (symName=="√") return DocSymbol::SquareRoot; - else if (symName=="⊥") return DocSymbol::Perpendicular; - else if (symName=="∑") return DocSymbol::Sum; - else if (symName=="∫") return DocSymbol::Integral; - else if (symName=="∏") return DocSymbol::Product; - else if (symName=="∼") return DocSymbol::Similar; - else if (symName=="≈") return DocSymbol::Approx; - else if (symName=="≠") return DocSymbol::NotEqual; - else if (symName=="≡") return DocSymbol::Equivalent; - else if (symName=="∝") return DocSymbol::Proportional; - else if (symName=="≤") return DocSymbol::LessEqual; - else if (symName=="≥") return DocSymbol::GreaterEqual; - else if (symName=="←") return DocSymbol::LeftArrow; - else if (symName=="→") return DocSymbol::RightArrow; - else if (symName=="∈") return DocSymbol::SetIn; - else if (symName=="∉") return DocSymbol::SetNotIn; - else if (symName=="⌈") return DocSymbol::LeftCeil; - else if (symName=="⌉") return DocSymbol::RightCeil; - else if (symName=="⌊") return DocSymbol::LeftFloor; - else if (symName=="⌋") return DocSymbol::RightFloor; - else if (l==6 && symName.right(4)=="uml;") - { - *letter=symName.at(1); - return DocSymbol::Uml; - } - else if (l==8 && symName.right(6)=="acute;") - { - *letter=symName.at(1); - return DocSymbol::Acute; - } - else if (l==8 && symName.right(6)=="grave;") - { - *letter=symName.at(1); - return DocSymbol::Grave; - } - else if (l==7 && symName.right(5)=="circ;") - { - *letter=symName.at(1); - return DocSymbol::Circ; - } - else if (l==8 && symName.right(6)=="tilde;") - { - *letter=symName.at(1); - return DocSymbol::Tilde; - } - else if (l==8 && symName.right(6)=="cedil;") - { - *letter=symName.at(1); - return DocSymbol::Cedil; - } - else if (l==7 && symName.right(5)=="ring;") - { - *letter=symName.at(1); - return DocSymbol::Ring; - } - else if (l==8 && symName.right(6)=="slash;") - { - *letter=symName.at(1); - return DocSymbol::Slash; - } - return DocSymbol::Unknown; +DocSymbol::SymType DocSymbol::decodeSymbol(const QCString &symName) +{ + DBG(("decodeSymbol(%s)\n",qPrint(symName))); + return HtmlEntityMapper::instance()->name2sym(symName); } //--------------------------------------------------------------------------- @@ -3369,26 +3241,25 @@ int DocIndexEntry::parse() break; case TK_SYMBOL: { - char letter='\0'; - DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter); + DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name); switch (s) { - case DocSymbol::BSlash: m_entry+='\\'; break; - case DocSymbol::At: m_entry+='@'; break; - case DocSymbol::Less: m_entry+='<'; break; - case DocSymbol::Greater: m_entry+='>'; break; - case DocSymbol::Amp: m_entry+='&'; break; - case DocSymbol::Dollar: m_entry+='$'; break; - case DocSymbol::Hash: m_entry+='#'; break; - case DocSymbol::Percent: m_entry+='%'; break; - case DocSymbol::Apos: m_entry+='\''; break; - case DocSymbol::Quot: m_entry+='"'; break; - case DocSymbol::Lsquo: m_entry+='`'; break; - case DocSymbol::Rsquo: m_entry+='\''; break; - case DocSymbol::Ldquo: m_entry+="``"; break; - case DocSymbol::Rdquo: m_entry+="''"; break; - case DocSymbol::Ndash: m_entry+="--"; break; - case DocSymbol::Mdash: m_entry+="---"; break; + case DocSymbol::Sym_BSlash: m_entry+='\\'; break; + case DocSymbol::Sym_At: m_entry+='@'; break; + case DocSymbol::Sym_Less: m_entry+='<'; break; + case DocSymbol::Sym_Greater: m_entry+='>'; break; + case DocSymbol::Sym_Amp: m_entry+='&'; break; + case DocSymbol::Sym_Dollar: m_entry+='$'; break; + case DocSymbol::Sym_Hash: m_entry+='#'; break; + case DocSymbol::Sym_Percent: m_entry+='%'; break; + case DocSymbol::Sym_apos: m_entry+='\''; break; + case DocSymbol::Sym_Quot: m_entry+='"'; break; + case DocSymbol::Sym_lsquo: m_entry+='`'; break; + case DocSymbol::Sym_rsquo: m_entry+='\''; break; + case DocSymbol::Sym_ldquo: m_entry+="``"; break; + case DocSymbol::Sym_rdquo: m_entry+="''"; break; + case DocSymbol::Sym_ndash: m_entry+="--"; break; + case DocSymbol::Sym_mdash: m_entry+="---"; break; default: warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected symbol found as argument of \\addindex"); break; @@ -5470,37 +5341,37 @@ int DocPara::handleCommand(const QCString &cmdName) if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," ")); break; case CMD_BSLASH: - m_children.append(new DocSymbol(this,DocSymbol::BSlash)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash)); break; case CMD_AT: - m_children.append(new DocSymbol(this,DocSymbol::At)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_At)); break; case CMD_LESS: - m_children.append(new DocSymbol(this,DocSymbol::Less)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Less)); break; case CMD_GREATER: - m_children.append(new DocSymbol(this,DocSymbol::Greater)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater)); break; case CMD_AMP: - m_children.append(new DocSymbol(this,DocSymbol::Amp)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp)); break; case CMD_DOLLAR: - m_children.append(new DocSymbol(this,DocSymbol::Dollar)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar)); break; case CMD_HASH: - m_children.append(new DocSymbol(this,DocSymbol::Hash)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash)); break; case CMD_PIPE: - m_children.append(new DocSymbol(this,DocSymbol::Pipe)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Pipe)); break; case CMD_DCOLON: - m_children.append(new DocSymbol(this,DocSymbol::DoubleColon)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon)); break; case CMD_PERCENT: - m_children.append(new DocSymbol(this,DocSymbol::Percent)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent)); break; case CMD_QUOTE: - m_children.append(new DocSymbol(this,DocSymbol::Quot)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot)); break; case CMD_SA: g_inSeeBlock=TRUE; @@ -6691,11 +6562,10 @@ reparsetoken: break; case TK_SYMBOL: { - char letter='\0'; - DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter); - if (s!=DocSymbol::Unknown) + DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name); + if (s!=DocSymbol::Sym_Unknown) { - m_children.append(new DocSymbol(this,s,letter)); + m_children.append(new DocSymbol(this,s)); } else { @@ -6910,11 +6780,10 @@ void DocText::parse() break; case TK_SYMBOL: { - char letter='\0'; - DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name,&letter); - if (s!=DocSymbol::Unknown) + DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name); + if (s!=DocSymbol::Sym_Unknown) { - m_children.append(new DocSymbol(this,s,letter)); + m_children.append(new DocSymbol(this,s)); } else { @@ -6927,34 +6796,34 @@ void DocText::parse() switch (Mappers::cmdMapper->map(g_token->name)) { case CMD_BSLASH: - m_children.append(new DocSymbol(this,DocSymbol::BSlash)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash)); break; case CMD_AT: - m_children.append(new DocSymbol(this,DocSymbol::At)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_At)); break; case CMD_LESS: - m_children.append(new DocSymbol(this,DocSymbol::Less)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Less)); break; case CMD_GREATER: - m_children.append(new DocSymbol(this,DocSymbol::Greater)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater)); break; case CMD_AMP: - m_children.append(new DocSymbol(this,DocSymbol::Amp)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp)); break; case CMD_DOLLAR: - m_children.append(new DocSymbol(this,DocSymbol::Dollar)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar)); break; case CMD_HASH: - m_children.append(new DocSymbol(this,DocSymbol::Hash)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash)); break; case CMD_DCOLON: - m_children.append(new DocSymbol(this,DocSymbol::DoubleColon)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon)); break; case CMD_PERCENT: - m_children.append(new DocSymbol(this,DocSymbol::Percent)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent)); break; case CMD_QUOTE: - m_children.append(new DocSymbol(this,DocSymbol::Quot)); + m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot)); break; default: warn_doc_error(g_fileName,doctokenizerYYlineno,"Unexpected command `%s' found", diff --git a/src/docparser.h b/src/docparser.h index 050c871..37c78cd 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -336,34 +336,84 @@ class DocStyleChange : public DocNode class DocSymbol : public DocNode { public: - enum SymType { Unknown=0, BSlash, At, Less, Greater, Amp, Dollar, Hash, - DoubleColon, Percent, Copy, Tm, Reg, Apos, Quot, Uml, Acute, - Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Slash, - Lsquo, Rsquo, Ldquo, Rdquo, Ndash, Mdash, Aelig, AElig, - GrkGamma, GrkDelta, GrkTheta, GrkLambda, GrkXi, GrkPi, - GrkSigma, GrkUpsilon, GrkPhi, GrkPsi, GrkOmega, Grkalpha, - Grkbeta, Grkgamma, Grkdelta, Grkepsilon, Grkzeta, Grketa, - Grktheta, Grkiota, Grkkappa, Grklambda, Grkmu, Grknu, Grkxi, - Grkpi, Grkrho, Grksigma, Grktau, Grkupsilon, Grkphi, Grkchi, - Grkpsi, Grkomega, Grkvarsigma, Section, Degree, Prime, - DoublePrime, Infinity, EmptySet, PlusMinus, Times, Minus, - CenterDot, Partial, Nabla, SquareRoot, Perpendicular, Sum, - Integral, Product, Similar, Approx, NotEqual, Equivalent, - Proportional, LessEqual, GreaterEqual, LeftArrow, RightArrow, - SetIn, SetNotIn, LeftCeil, RightCeil, LeftFloor, RightFloor, - Pipe + enum SymType { Sym_Unknown = -1, + Sym_nbsp, Sym_iexcl, Sym_cent, Sym_pound, Sym_curren, + Sym_yen, Sym_brvbar, Sym_sect, Sym_uml, Sym_copy, + Sym_ordf, Sym_laquo, Sym_not, Sym_shy, Sym_reg, + Sym_macr, Sym_deg, Sym_plusmn, Sym_sup2, Sym_sup3, + Sym_acute, Sym_micro, Sym_para, Sym_middot, Sym_cedil, + Sym_sup1, Sym_ordm, Sym_raquo, Sym_frac14, Sym_frac12, + Sym_frac34, Sym_iquest, Sym_Agrave, Sym_Aacute, Sym_Acirc, + Sym_Atilde, Sym_Auml, Sym_Aring, Sym_AElig, Sym_Ccedil, + Sym_Egrave, Sym_Eacute, Sym_Ecirc, Sym_Euml, Sym_Igrave, + Sym_Iacute, Sym_Icirc, Sym_Iuml, Sym_ETH, Sym_Ntilde, + Sym_Ograve, Sym_Oacute, Sym_Ocirc, Sym_Otilde, Sym_Ouml, + Sym_times, Sym_Oslash, Sym_Ugrave, Sym_Uacute, Sym_Ucirc, + Sym_Uuml, Sym_Yacute, Sym_THORN, Sym_szlig, Sym_agrave, + Sym_aacute, Sym_acirc, Sym_atilde, Sym_auml, Sym_aring, + Sym_aelig, Sym_ccedil, Sym_egrave, Sym_eacute, Sym_ecirc, + Sym_euml, Sym_igrave, Sym_iacute, Sym_icirc, Sym_iuml, + Sym_eth, Sym_ntilde, Sym_ograve, Sym_oacute, Sym_ocirc, + Sym_otilde, Sym_ouml, Sym_divide, Sym_oslash, Sym_ugrave, + Sym_uacute, Sym_ucirc, Sym_uuml, Sym_yacute, Sym_thorn, + Sym_yuml, Sym_fnof, Sym_Alpha, Sym_Beta, Sym_Gamma, + Sym_Delta, Sym_Epsilon, Sym_Zeta, Sym_Eta, Sym_Theta, + Sym_Iota, Sym_Kappa, Sym_Lambda, Sym_Mu, Sym_Nu, + Sym_Xi, Sym_Omicron, Sym_Pi, Sym_Rho, Sym_Sigma, + Sym_Tau, Sym_Upsilon, Sym_Phi, Sym_Chi, Sym_Psi, + Sym_Omega, Sym_alpha, Sym_beta, Sym_gamma, Sym_delta, + Sym_epsilon, Sym_zeta, Sym_eta, Sym_theta, Sym_iota, + Sym_kappa, Sym_lambda, Sym_mu, Sym_nu, Sym_xi, + Sym_omicron, Sym_pi, Sym_rho, Sym_sigmaf, Sym_sigma, + Sym_tau, Sym_upsilon, Sym_phi, Sym_chi, Sym_psi, + Sym_omega, Sym_thetasym, Sym_upsih, Sym_piv, Sym_bull, + Sym_hellip, Sym_prime, Sym_Prime, Sym_oline, Sym_frasl, + Sym_weierp, Sym_image, Sym_real, Sym_trade, Sym_alefsym, + Sym_larr, Sym_uarr, Sym_rarr, Sym_darr, Sym_harr, + Sym_crarr, Sym_lArr, Sym_uArr, Sym_rArr, Sym_dArr, + Sym_hArr, Sym_forall, Sym_part, Sym_exist, Sym_empty, + Sym_nabla, Sym_isin, Sym_notin, Sym_ni, Sym_prod, + Sym_sum, Sym_minus, Sym_lowast, Sym_radic, Sym_prop, + Sym_infin, Sym_ang, Sym_and, Sym_or, Sym_cap, + Sym_cup, Sym_int, Sym_there4, Sym_sim, Sym_cong, + Sym_asymp, Sym_ne, Sym_equiv, Sym_le, Sym_ge, + Sym_sub, Sym_sup, Sym_nsub, Sym_sube, Sym_supe, + Sym_oplus, Sym_otimes, Sym_perp, Sym_sdot, Sym_lceil, + Sym_rceil, Sym_lfloor, Sym_rfloor, Sym_lang, Sym_rang, + Sym_loz, Sym_spades, Sym_clubs, Sym_hearts, Sym_diams, + Sym_quot, Sym_amp, Sym_lt, Sym_gt, Sym_OElig, + Sym_oelig, Sym_Scaron, Sym_scaron, Sym_Yuml, Sym_circ, + Sym_tilde, Sym_ensp, Sym_emsp, Sym_thinsp, Sym_zwnj, + Sym_zwj, Sym_lrm, Sym_rlm, Sym_ndash, Sym_mdash, + Sym_lsquo, Sym_rsquo, Sym_sbquo, Sym_ldquo, Sym_rdquo, + Sym_bdquo, Sym_dagger, Sym_Dagger, Sym_permil, Sym_lsaquo, + Sym_rsaquo, Sym_euro, + + /* doxygen extensions */ + Sym_tm, Sym_apos, + + /* doxygen commands mapped */ + Sym_BSlash, Sym_At, Sym_Less, Sym_Greater, Sym_Amp, + Sym_Dollar, Sym_Hash, Sym_DoubleColon, Sym_Percent, Sym_Pipe, + Sym_Quot }; - DocSymbol(DocNode *parent,SymType s,char letter='\0') : - m_symbol(s), m_letter(letter) { m_parent = parent; } + enum PerlType { Perl_unknown = 0, Perl_string, Perl_char, Perl_symbol, Perl_umlaut, + Perl_acute, Perl_grave, Perl_circ, Perl_slash, Perl_tilde, + Perl_cedilla, Perl_ring + }; + typedef struct PerlSymb { + const char *symb; + const PerlType type; + }PerlSymb; + DocSymbol(DocNode *parent,SymType s) : + m_symbol(s) { m_parent = parent; } SymType symbol() const { return m_symbol; } - char letter() const { return m_letter; } Kind kind() const { return Kind_Symbol; } void accept(DocVisitor *v) { v->visit(this); } - static SymType decodeSymbol(const QCString &symName,char *letter); + static SymType decodeSymbol(const QCString &symName); private: SymType m_symbol; - char m_letter; }; /** Node representing some amount of white space */ diff --git a/src/docsets.cpp b/src/docsets.cpp index 2aa2918..de75819 100644 --- a/src/docsets.cpp +++ b/src/docsets.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docsets.h b/src/docsets.h index c5f0dc7..eac5bfc 100644 --- a/src/docsets.h +++ b/src/docsets.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doctokenizer.h b/src/doctokenizer.h index ca0490c..1db764e 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -3,7 +3,7 @@ * $Id: $ * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doctokenizer.l b/src/doctokenizer.l index 6d521d9..a4e6c4a 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -3,7 +3,7 @@ * $Id: $ * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docvisitor.h b/src/docvisitor.h index d12295c..a444b47 100644 --- a/src/docvisitor.h +++ b/src/docvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/dot.cpp b/src/dot.cpp index 56ddc83..ea41685 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -1224,7 +1224,7 @@ DotManager *DotManager::instance() return m_theInstance; } -DotManager::DotManager() : m_dotMaps(1007) +DotManager::DotManager() : m_dotMaps(1009) { m_dotRuns.setAutoDelete(TRUE); m_dotMaps.setAutoDelete(TRUE); @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 3f05396..b195940 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -9822,7 +9822,7 @@ static void devUsage() static void usage(const char *name) { - msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2013\n\n",versionString); + msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2014\n\n",versionString); msg("You can use doxygen in a number of ways:\n\n"); msg("1) Use doxygen to generate a template configuration file:\n"); msg(" %s [-s] -g [configName]\n\n",name); diff --git a/src/doxygen.h b/src/doxygen.h index 99d6931..6f766c0 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doxygen.pro.in b/src/doxygen.pro.in index 506a3e8..8bca741 100644 --- a/src/doxygen.pro.in +++ b/src/doxygen.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/eclipsehelp.cpp b/src/eclipsehelp.cpp index 213b0fa..6680aeb 100644 --- a/src/eclipsehelp.cpp +++ b/src/eclipsehelp.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/eclipsehelp.h b/src/eclipsehelp.h index c21c4ae..f0ab78e 100644 --- a/src/eclipsehelp.h +++ b/src/eclipsehelp.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/entry.cpp b/src/entry.cpp index 15263ab..ee3d0ae 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/entry.h b/src/entry.h index cecd095..a861906 100644 --- a/src/entry.h +++ b/src/entry.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/example.h b/src/example.h index c0f405c..7c86554 100644 --- a/src/example.h +++ b/src/example.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filedef.cpp b/src/filedef.cpp index d7bc794..04c56de 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filedef.h b/src/filedef.h index 6cb4665..a95cd77 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filename.cpp b/src/filename.cpp index 0919024..35a1841 100644 --- a/src/filename.cpp +++ b/src/filename.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filename.h b/src/filename.h index e7383b8..ac7b164 100644 --- a/src/filename.h +++ b/src/filename.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filestorage.h b/src/filestorage.h index a6ee5b4..0d72923 100644 --- a/src/filestorage.h +++ b/src/filestorage.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/formula.cpp b/src/formula.cpp index 0d3c4cd..9e835e1 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -1,7 +1,7 @@ /****************************************************************************** * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/formula.h b/src/formula.h index 79821bf..47f7d4b 100644 --- a/src/formula.h +++ b/src/formula.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/fortrancode.h b/src/fortrancode.h index 3913ebb..8c947e9 100644 --- a/src/fortrancode.h +++ b/src/fortrancode.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/fortranscanner.h b/src/fortranscanner.h index 41f7790..a504abc 100644 --- a/src/fortranscanner.h +++ b/src/fortranscanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp index 4fd47b5..4613a92 100644 --- a/src/ftvhelp.cpp +++ b/src/ftvhelp.cpp @@ -1,7 +1,7 @@ /****************************************************************************** * ftvhelp.cpp,v 1.0 2000/09/06 16:09:00 * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -784,7 +784,7 @@ QCString FTVHelp::generateIndentLabel(FTVNode *n,int level) { result=generateIndentLabel(n->parent,level+1); } - result+=QCString().sprintf("%d_",n->index); + result+=QCString().setNum(n->index)+"_"; return result; } diff --git a/src/ftvhelp.h b/src/ftvhelp.h index b37314e..bddb2f0 100644 --- a/src/ftvhelp.h +++ b/src/ftvhelp.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 77b3610..59f3594 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/groupdef.h b/src/groupdef.h index 0d1a5ca..481bece 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htags.cpp b/src/htags.cpp index 5f0c71a..1e18ae1 100644 --- a/src/htags.cpp +++ b/src/htags.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htags.h b/src/htags.h index 474b098..5173b2b 100644 --- a/src/htags.h +++ b/src/htags.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlattrib.h b/src/htmlattrib.h index 0b139aa..e7fd204 100644 --- a/src/htmlattrib.h +++ b/src/htmlattrib.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index 536259a..f6878b9 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -33,6 +33,7 @@ #include "vhdldocgen.h" #include "filedef.h" #include "memberdef.h" +#include "htmlentity.h" static const int NUM_HTML_LIST_TYPES = 4; static const char types[][NUM_HTML_LIST_TYPES] = {"1", "a", "i", "A"}; @@ -182,110 +183,14 @@ void HtmlDocVisitor::visit(DocWhiteSpace *w) void HtmlDocVisitor::visit(DocSymbol *s) { if (m_hide) return; - switch(s->symbol()) - { - case DocSymbol::BSlash: m_t << "\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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 << "©"; break; - case DocSymbol::Tm: m_t << "™"; break; - case DocSymbol::Reg: m_t << "®"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << "\""; break; - case DocSymbol::Lsquo: m_t << "‘"; break; - case DocSymbol::Rsquo: m_t << "’"; break; - case DocSymbol::Ldquo: m_t << "“"; break; - case DocSymbol::Rdquo: m_t << "”"; break; - case DocSymbol::Ndash: m_t << "–"; break; - case DocSymbol::Mdash: m_t << "—"; 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 << "ß"; break; - case DocSymbol::Cedil: m_t << "&" << s->letter() << "cedil;"; break; - case DocSymbol::Ring: m_t << "&" << s->letter() << "ring;"; break; - case DocSymbol::Nbsp: m_t << " "; break; - case DocSymbol::AElig: m_t << "Æ"; break; - case DocSymbol::Aelig: m_t << "æ"; break; - case DocSymbol::GrkGamma: m_t << "Γ"; break; - case DocSymbol::GrkDelta: m_t << "Δ"; break; - case DocSymbol::GrkTheta: m_t << "Θ"; break; - case DocSymbol::GrkLambda: m_t << "Λ"; break; - case DocSymbol::GrkXi: m_t << "Ξ"; break; - case DocSymbol::GrkPi: m_t << "Π"; break; - case DocSymbol::GrkSigma: m_t << "Σ"; break; - case DocSymbol::GrkUpsilon: m_t << "Υ"; break; - case DocSymbol::GrkPhi: m_t << "Φ"; break; - case DocSymbol::GrkPsi: m_t << "Ψ"; break; - case DocSymbol::GrkOmega: m_t << "Ω"; break; - case DocSymbol::Grkalpha: m_t << "α"; break; - case DocSymbol::Grkbeta: m_t << "β"; break; - case DocSymbol::Grkgamma: m_t << "γ"; break; - case DocSymbol::Grkdelta: m_t << "δ"; break; - case DocSymbol::Grkepsilon: m_t << "ε"; break; - case DocSymbol::Grkzeta: m_t << "ζ"; break; - case DocSymbol::Grketa: m_t << "η"; break; - case DocSymbol::Grktheta: m_t << "θ"; break; - case DocSymbol::Grkiota: m_t << "ι"; break; - case DocSymbol::Grkkappa: m_t << "κ"; break; - case DocSymbol::Grklambda: m_t << "λ"; break; - case DocSymbol::Grkmu: m_t << "μ"; break; - case DocSymbol::Grknu: m_t << "ν"; break; - case DocSymbol::Grkxi: m_t << "ξ"; break; - case DocSymbol::Grkpi: m_t << "π"; break; - case DocSymbol::Grkrho: m_t << "ρ"; break; - case DocSymbol::Grksigma: m_t << "σ"; break; - case DocSymbol::Grktau: m_t << "τ"; break; - case DocSymbol::Grkupsilon: m_t << "υ"; break; - case DocSymbol::Grkphi: m_t << "φ"; break; - case DocSymbol::Grkchi: m_t << "χ"; break; - case DocSymbol::Grkpsi: m_t << "ψ"; break; - case DocSymbol::Grkomega: m_t << "ω"; break; - case DocSymbol::Grkvarsigma: m_t << "ς"; break; - case DocSymbol::Section: m_t << "§"; break; - case DocSymbol::Degree: m_t << "°"; break; - case DocSymbol::Prime: m_t << "′"; break; - case DocSymbol::DoublePrime: m_t << "″"; break; - case DocSymbol::Infinity: m_t << "∞"; break; - case DocSymbol::EmptySet: m_t << "∅"; break; - case DocSymbol::PlusMinus: m_t << "±"; break; - case DocSymbol::Times: m_t << "×"; break; - case DocSymbol::Minus: m_t << "−"; break; - case DocSymbol::CenterDot: m_t << "⋅"; break; - case DocSymbol::Partial: m_t << "∂"; break; - case DocSymbol::Nabla: m_t << "∇"; break; - case DocSymbol::SquareRoot: m_t << "√"; break; - case DocSymbol::Perpendicular: m_t << "⊥"; break; - case DocSymbol::Sum: m_t << "∑"; break; - case DocSymbol::Integral: m_t << "∫"; break; - case DocSymbol::Product: m_t << "∏"; break; - case DocSymbol::Similar: m_t << "∼"; break; - case DocSymbol::Approx: m_t << "≈"; break; - case DocSymbol::NotEqual: m_t << "≠"; break; - case DocSymbol::Equivalent: m_t << "≡"; break; - case DocSymbol::Proportional: m_t << "∝"; break; - case DocSymbol::LessEqual: m_t << "≤"; break; - case DocSymbol::GreaterEqual: m_t << "≥"; break; - case DocSymbol::LeftArrow: m_t << "←"; break; - case DocSymbol::RightArrow: m_t << "→"; break; - case DocSymbol::SetIn: m_t << "∈"; break; - case DocSymbol::SetNotIn: m_t << "∉"; break; - case DocSymbol::LeftCeil: m_t << "⌈"; break; - case DocSymbol::RightCeil: m_t << "⌉"; break; - case DocSymbol::LeftFloor: m_t << "⌊"; break; - case DocSymbol::RightFloor: m_t << "⌋"; break; - default: - err("unknown symbol found\n"); + const char *res = HtmlEntityMapper::instance()->html(s->symbol()); + if (res) + { + m_t << res; + } + else + { + err("HTML: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index fd7c23a..ddefecd 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp new file mode 100644 index 0000000..c7ff1da --- /dev/null +++ b/src/htmlentity.cpp @@ -0,0 +1,495 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2014 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include "htmlentity.h" +#include "message.h" +#include "ftextstream.h" + +//! Number of doxygen commands mapped as if it were HTML entities +static const int g_numberHtmlMappedCmds = 11; + +//! @brief Structure defining all HTML4 entities, doxygen extensions and doxygen commands representing special symbols. +//! @details In case an entity does not exist a NULL is given for the entity. The first column contains the symbolic code +//! for the entity, see also doxparser.h The second column contains the name of the enitity (without the starting \& and +//! ending ;) +static struct htmlEntityInfo +{ + DocSymbol::SymType symb; + const char *item; + const char *UTF8; + const char *html; + const char *xml; + const char *docbook; + const char *latex; + const char *man; + const char *rtf; + DocSymbol::PerlSymb perl; +} g_htmlEntities[] = +{ +#undef SYM +// helper macro to force consistent entries for the symbol and item columns +#define SYM(s) DocSymbol::Sym_##s,"&"#s";" + // HTML4 entities + // symb+item UTF-8 html xml docbook latex man rtf perl + { SYM(nbsp), "\xc2\xa0", " ", "<nonbreakablespace/>", " ", "~", " ", "\\~", { " ", DocSymbol::Perl_char }}, + { SYM(iexcl), "\xc2\xa1", "¡", "<iexcl/>", "¡", "!`", NULL, "\\'A1", { NULL, DocSymbol::Perl_unknown }}, + { SYM(cent), "\xc2\xa2", "¢", "<cent/>", "¢", "\\textcent{}", NULL, "\\'A2", { NULL, DocSymbol::Perl_unknown }}, + { SYM(pound), "\xc2\xa3", "£", "<pound/>", "£", "{$\\pounds$}", NULL, "\\'A3", { NULL, DocSymbol::Perl_unknown }}, + { SYM(curren), "\xc2\xa4", "¤", "<curren/>", "¤", "\\textcurrency{}", NULL, "\\'A4", { NULL, DocSymbol::Perl_unknown }}, + { SYM(yen), "\xc2\xa5", "¥", "<yen/>", "¥", "{$\\yen$}", NULL, "\\'A5", { NULL, DocSymbol::Perl_unknown }}, + { SYM(brvbar), "\xc2\xa6", "¦", "<brvbar/>", "¦", "\\textbrokenbar{}", NULL, "\\'A6", { NULL, DocSymbol::Perl_unknown }}, + { SYM(sect), "\xc2\xa7", "§", "<sect/>", "<simplesect/>", "{$\\S$}", NULL, "\\'A7", { "sect", DocSymbol::Perl_symbol }}, + { SYM(uml), "\xc2\xa8", "¨", "<umlaut/>", "¨", "\\textasciidieresis{}", " \\*(4", "\\'A8", { " ", DocSymbol::Perl_umlaut }}, + { SYM(copy), "\xc2\xa9", "©", "<copy/>", "©", "\\copyright{}", "(C)", "\\'A9", { "copyright", DocSymbol::Perl_symbol }}, + { SYM(ordf), "\xc2\xaa", "ª", "<ordf/>", "ª", "\\textordfeminine{}", NULL, "\\'AA", { NULL, DocSymbol::Perl_unknown }}, + { SYM(laquo), "\xc2\xab", "«", "<laquo/>", "«", "\\guillemotleft{}", NULL, "\\'AB", { NULL, DocSymbol::Perl_unknown }}, + { SYM(not), "\xc2\xac", "¬", "<not/>", "¬", "\\textlnot", NULL, "\\'AC", { NULL, DocSymbol::Perl_unknown }}, + { SYM(shy), "\xc2\xad", "­", "<shy/>", "­", "{$\\-$}", NULL, "\\-", { NULL, DocSymbol::Perl_unknown }}, + { SYM(reg), "\xc2\xae", "®", "<registered/>", "®", "\\textregistered{}", "(R)", "\\'AE", { "registered", DocSymbol::Perl_symbol }}, + { SYM(macr), "\xc2\xaf", "¯", "<macr/>", "¯", "\\={}", NULL, "\\'AF", { NULL, DocSymbol::Perl_unknown }}, + { SYM(deg), "\xc2\xb0", "°", "<deg/>", "°", "\\textdegree", NULL, "\\'B0", { "deg", DocSymbol::Perl_symbol }}, + { SYM(plusmn), "\xc2\xb1", "±", "<plusmn/>", "±", "{$\\pm$}", NULL, "\\'B1", { "+/-", DocSymbol::Perl_string }}, + { SYM(sup2), "\xc2\xb2", "²", "<sup2/>", "²", "\\texttwosuperior{}", NULL, "\\'B2", { NULL, DocSymbol::Perl_unknown }}, + { SYM(sup3), "\xc2\xb3", "³", "<sup3/>", "³", "\\textthreesuperior{}", NULL, "\\'B3", { NULL, DocSymbol::Perl_unknown }}, + { SYM(acute), "\xc2\xb4", "´", "<acute/>", "´", "\\'{}", NULL, "\\'B4", { " ", DocSymbol::Perl_acute }}, + { SYM(micro), "\xc2\xb5", "µ", "<micro/>", "µ", "{$\\mu$}", NULL, "\\'B5", { NULL, DocSymbol::Perl_unknown }}, + { SYM(para), "\xc2\xb6", "¶", "<para/>", "¶", "{$\\P$}", NULL, "\\'B6", { NULL, DocSymbol::Perl_unknown }}, + { SYM(middot), "\xc2\xb7", "·", "<middot/>", "·", "\\textperiodcentered{}", NULL, "\\'B7", { NULL, DocSymbol::Perl_unknown }}, + { SYM(cedil), "\xc2\xb8", "¸", "<cedil/>", "¸", "\\c{}", " \\*,", "\\'B8", { " ", DocSymbol::Perl_cedilla }}, + { SYM(sup1), "\xc2\xb9", "¹", "<sup1/>", "¹", "\\textonesuperior{}", NULL, "\\'B9", { NULL, DocSymbol::Perl_unknown }}, + { SYM(ordm), "\xc2\xba", "º", "<ordm/>", "º", "\\textordmasculine{}", NULL, "\\'BA", { NULL, DocSymbol::Perl_unknown }}, + { SYM(raquo), "\xc2\xbb", "»", "<raquo/>", "»", "\\guillemotright{}", NULL, "\\'BB", { NULL, DocSymbol::Perl_unknown }}, + { SYM(frac14), "\xc2\xbc", "¼", "<frac14/>", "¼", "{$\\frac14$}", "1/4", "\\'BC", { NULL, DocSymbol::Perl_unknown }}, + { SYM(frac12), "\xc2\xbd", "½", "<frac12/>", "½", "{$\\frac12$}", "1/2", "\\'BD", { NULL, DocSymbol::Perl_unknown }}, + { SYM(frac34), "\xc2\xbe", "¾", "<frac34/>", "¾", "{$\\frac34$}", "3/4", "\\'BE", { NULL, DocSymbol::Perl_unknown }}, + { SYM(iquest), "\xc2\xbf", "¿", "<iquest/>", "¿", "?`", NULL, "\\'BF", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Agrave), "\xc3\x80", "À", "<Agrave/>", "À", "\\`{A}", "A\\*:", "\\'C0", { "A", DocSymbol::Perl_grave }}, + { SYM(Aacute), "\xc3\x81", "Á", "<Aacute/>", "Á", "\\'{A}", "A\\*(`", "\\'C1", { "A", DocSymbol::Perl_acute }}, + { SYM(Acirc), "\xc3\x82", "Â", "<Acirc/>", "Â", "\\^{A}", "A\\*^", "\\'C2", { "A", DocSymbol::Perl_circ }}, + { SYM(Atilde), "\xc3\x83", "Ã", "<Atilde/>", "Ã", "\\~{A}", "A\\*~", "\\'C3", { "A", DocSymbol::Perl_tilde }}, + { SYM(Auml), "\xc3\x84", "Ä", "<Aumlaut/>", "Ä", "\\\"{A}", "A\\*(4", "\\'C4", { "A", DocSymbol::Perl_umlaut }}, + { SYM(Aring), "\xc3\x85", "Å", "<Aring/>", "Å", "\\AA", "A\\*o", "\\'C5", { "A", DocSymbol::Perl_ring }}, + { SYM(AElig), "\xc3\x86", "Æ", "<AElig/>", "Æ", "{\\AE}", NULL, "\\'C6", { "AElig", DocSymbol::Perl_symbol }}, + { SYM(Ccedil), "\xc3\x87", "Ç", "<Ccedil/>", "Ç", "\\c{C}", "C\\*,", "\\'C7", { "C", DocSymbol::Perl_cedilla }}, + { SYM(Egrave), "\xc3\x88", "È", "<Egrave/>", "È", "\\`{E}", "E\\*:", "\\'C8", { "E", DocSymbol::Perl_grave }}, + { SYM(Eacute), "\xc3\x89", "É", "<Eacute/>", "É", "\\'{E}", "E\\*(`", "\\'C9", { "E", DocSymbol::Perl_acute }}, + { SYM(Ecirc), "\xc3\x8a", "Ê", "<Ecirc/>", "Ê", "\\^{E}", "E\\*^", "\\'CA", { "E", DocSymbol::Perl_circ }}, + { SYM(Euml), "\xc3\x8b", "Ë", "<Eumlaut/>", "Ë", "\\\"{E}", "E\\*(4", "\\'CB", { "E", DocSymbol::Perl_umlaut }}, + { SYM(Igrave), "\xc3\x8c", "Ì", "<Igrave/>", "Ì", "\\`{I}", "I\\*:", "\\'CC", { "I", DocSymbol::Perl_grave }}, + { SYM(Iacute), "\xc3\x8d", "Í", "<Iacute/>", "Í", "\\'{I}", "I\\*(`", "\\'CD", { "I", DocSymbol::Perl_acute }}, + { SYM(Icirc), "\xc3\x8e", "Î", "<Icirc/>", "Î", "\\^{I}", "I\\*^", "\\'CE", { "I", DocSymbol::Perl_circ }}, + { SYM(Iuml), "\xc3\x8f", "Ï", "<Iumlaut/>", "Ï", "\\\"{I}", "I\\*(4", "\\'CF", { "I", DocSymbol::Perl_umlaut }}, + { SYM(ETH), "\xc3\x90", "Ð", "<ETH/>", "Ð", "\\DH", NULL, "\\'D0", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Ntilde), "\xc3\x91", "Ñ", "<Ntilde/>", "Ñ", "\\~{N}", "N\\*~", "\\'D1", { "N", DocSymbol::Perl_tilde }}, + { SYM(Ograve), "\xc3\x92", "Ò", "<Ograve/>", "Ò", "\\`{O}", "O\\*:", "\\'D2", { "O", DocSymbol::Perl_grave }}, + { SYM(Oacute), "\xc3\x93", "Ó", "<Oacute/>", "Ó", "\\'{O}", "O\\*(`", "\\'D3", { "O", DocSymbol::Perl_acute }}, + { SYM(Ocirc), "\xc3\x94", "Ô", "<Ocirc/>", "Ô", "\\^{O}", "O\\*^", "\\'D4", { "O", DocSymbol::Perl_circ }}, + { SYM(Otilde), "\xc3\x95", "Õ", "<Otilde/>", "Õ", "\\~{O}", "O\\*~", "\\'D5", { "O", DocSymbol::Perl_tilde }}, + { SYM(Ouml), "\xc3\x96", "Ö", "<Oumlaut/>", "Ö", "\\\"{O}", "O\\*(4", "\\'D6", { "O", DocSymbol::Perl_umlaut }}, + { SYM(times), "\xc3\x97", "×", "<times/>", "×", "{$\\times$}", NULL, "\\'D7", { "*", DocSymbol::Perl_char }}, + { SYM(Oslash), "\xc3\x98", "Ø", "<Oslash/>", "Ø", "{\\O}", "O\x08/", "\\'D8", { "O", DocSymbol::Perl_slash }}, + { SYM(Ugrave), "\xc3\x99", "Ù", "<Ugrave/>", "Ù", "\\`{U}", "U\\*:", "\\'D9", { "U", DocSymbol::Perl_grave }}, + { SYM(Uacute), "\xc3\x9a", "Ú", "<Uacute/>", "Ú", "\\'{U}", "U\\*(`", "\\'DA", { "U", DocSymbol::Perl_acute }}, + { SYM(Ucirc), "\xc3\x9b", "Û", "<Ucirc/>", "Û", "\\^{U}", "U\\*^", "\\'DB", { "U", DocSymbol::Perl_circ }}, + { SYM(Uuml), "\xc3\x9c", "Ü", "<Uumlaut/>", "Ü", "\\\"{U}", "U\\*(4", "\\'DC", { "U", DocSymbol::Perl_umlaut }}, + { SYM(Yacute), "\xc3\x9d", "Ý", "<Yacute/>", "Ý", "\\'{Y}", "Y\\*(`", "\\'DD", { "Y", DocSymbol::Perl_acute }}, + { SYM(THORN), "\xc3\x9e", "Þ", "<THORN/>", "Þ", "\\TH", NULL, "\\'DE", { NULL, DocSymbol::Perl_unknown }}, + { SYM(szlig), "\xc3\x9f", "ß", "<szlig/>", "ß", "{\\ss}", "s\\*:", "\\'DF", { "szlig", DocSymbol::Perl_symbol }}, + { SYM(agrave), "\xc3\xa0", "à", "<agrave/>", "à", "\\`{a}", "a\\*:", "\\'E0", { "a", DocSymbol::Perl_grave }}, + { SYM(aacute), "\xc3\xa1", "á", "<aacute/>", "á", "\\'{a}", "a\\*(`", "\\'E1", { "a", DocSymbol::Perl_acute }}, + { SYM(acirc), "\xc3\xa2", "â", "<acirc/>", "â", "\\^{a}", "a\\*^", "\\'E2", { "a", DocSymbol::Perl_circ }}, + { SYM(atilde), "\xc3\xa3", "ã", "<atilde/>", "ã", "\\~{a}", "a\\*~", "\\'E3", { "a", DocSymbol::Perl_tilde }}, + { SYM(auml), "\xc3\xa4", "ä", "<aumlaut/>", "ä", "\\\"{a}", "a\\*(4", "\\'E4", { "a", DocSymbol::Perl_umlaut }}, + { SYM(aring), "\xc3\xa5", "å", "<aring/>", "å", "\\aa", "a\\*o", "\\'E5", { "a", DocSymbol::Perl_ring }}, + { SYM(aelig), "\xc3\xa6", "æ", "<aelig/>", "æ", "{\\ae}", NULL, "\\'E6", { "aelig", DocSymbol::Perl_symbol }}, + { SYM(ccedil), "\xc3\xa7", "ç", "<ccedil/>", "ç", "\\c{c}", "c\\*,", "\\'E7", { "c", DocSymbol::Perl_cedilla }}, + { SYM(egrave), "\xc3\xa8", "è", "<egrave/>", "è", "\\`{e}", "e\\*:", "\\'E8", { "e", DocSymbol::Perl_grave }}, + { SYM(eacute), "\xc3\xa9", "é", "<eacute/>", "é", "\\'{e}", "e\\*(`", "\\'E9", { "e", DocSymbol::Perl_acute }}, + { SYM(ecirc), "\xc3\xaa", "ê", "<ecirc/>", "ê", "\\^{e}", "e\\*^", "\\'EA", { "e", DocSymbol::Perl_circ }}, + { SYM(euml), "\xc3\xab", "ë", "<eumlaut/>", "ë", "\\\"{e}", "e\\*(4", "\\'EB", { "e", DocSymbol::Perl_umlaut }}, + { SYM(igrave), "\xc3\xac", "ì", "<igrave/>", "ì", "\\`{\\i}", "i\\*:", "\\'EC", { "i", DocSymbol::Perl_grave }}, + { SYM(iacute), "\xc3\xad", "í", "<iacute/>", "í", "\\'{\\i}", "i\\*(`", "\\'ED", { "i", DocSymbol::Perl_acute }}, + { SYM(icirc), "\xc3\xae", "î", "<icirc/>", "î", "\\^{\\i}", "i\\*^", "\\'EE", { "i", DocSymbol::Perl_circ }}, + { SYM(iuml), "\xc3\xaf", "ï", "<iumlaut/>", "ï", "\\\"{\\i}", "i\\*(4", "\\'EF", { "i", DocSymbol::Perl_umlaut }}, + { SYM(eth), "\xc3\xb0", "ð", "<eth/>", "ð", "\\dh", NULL, "\\'F0", { NULL, DocSymbol::Perl_unknown }}, + { SYM(ntilde), "\xc3\xb1", "ñ", "<ntilde/>", "ñ", "\\~{n}", "n\\*~", "\\'F1", { "n", DocSymbol::Perl_tilde }}, + { SYM(ograve), "\xc3\xb2", "ò", "<ograve/>", "ò", "\\`{o}", "o\\*:", "\\'F2", { "o", DocSymbol::Perl_grave }}, + { SYM(oacute), "\xc3\xb3", "ó", "<oacute/>", "ó", "\\'{o}", "o\\*(`", "\\'F3", { "o", DocSymbol::Perl_acute }}, + { SYM(ocirc), "\xc3\xb4", "ô", "<ocirc/>", "ô", "\\^{o}", "o\\*^", "\\'F4", { "o", DocSymbol::Perl_circ }}, + { SYM(otilde), "\xc3\xb5", "õ", "<otilde/>", "õ", "\\~{o}", "o\\*~", "\\'F5", { "o", DocSymbol::Perl_tilde }}, + { SYM(ouml), "\xc3\xb6", "ö", "<oumlaut/>", "ö", "\\\"{o}", "o\\*(4", "\\'F6", { "o", DocSymbol::Perl_umlaut }}, + { SYM(divide), "\xc3\xb7", "÷", "<divide/>", "÷", "{$\\div$}", NULL, "\\'F7", { NULL, DocSymbol::Perl_unknown }}, + { SYM(oslash), "\xc3\xb8", "ø", "<oslash/>", "ø", "{\\o}", "o\x08/", "\\'F8", { "o", DocSymbol::Perl_slash }}, + { SYM(ugrave), "\xc3\xb9", "ù", "<ugrave/>", "ù", "\\`{u}", "u\\*:", "\\'F9", { "u", DocSymbol::Perl_grave }}, + { SYM(uacute), "\xc3\xba", "ú", "<uacute/>", "ú", "\\'{u}", "u\\*(`", "\\'FA", { "u", DocSymbol::Perl_acute }}, + { SYM(ucirc), "\xc3\xbb", "û", "<ucirc/>", "û", "\\^{u}", "u\\*^", "\\'FB", { "u", DocSymbol::Perl_circ }}, + { SYM(uuml), "\xc3\xbc", "ü", "<uumlaut/>", "ü", "\\\"{u}", "u\\*(4", "\\'FC", { "u", DocSymbol::Perl_umlaut }}, + { SYM(yacute), "\xc3\xbd", "ý", "<yacute/>", "ý", "\\'{y}", "y\\*(`", "\\'FD", { "y", DocSymbol::Perl_acute }}, + { SYM(thorn), "\xc3\xbe", "þ", "<thorn/>", "þ", "\\th", NULL, "\\'FE", { NULL, DocSymbol::Perl_unknown }}, + { SYM(yuml), "\xc3\xbf", "ÿ", "<yumlaut/>", "ÿ", "\\\"{y}", "y\\*(4", "\\'FF", { "y", DocSymbol::Perl_umlaut }}, + { SYM(fnof), "\xc6\x92", "ƒ", "<fnof/>", "ƒ", "\\textflorin", NULL, "\\'83", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Alpha), "\xce\x91", "Α", "<Alpha/>", "Α", "A", NULL, "\\u0913?", { "A", DocSymbol::Perl_char }}, + { SYM(Beta), "\xce\x92", "Β", "<Beta/>", "Β", "B", NULL, "\\u0914?", { "B", DocSymbol::Perl_char }}, + { SYM(Gamma), "\xce\x93", "Γ", "<Gamma/>", "Γ", "{$\\Gamma$}", NULL, "\\u0915?", { "Gamma", DocSymbol::Perl_symbol }}, + { SYM(Delta), "\xce\x94", "Δ", "<Delta/>", "Δ", "{$\\Delta$}", NULL, "\\u0916?", { "Delta", DocSymbol::Perl_symbol }}, + { SYM(Epsilon), "\xce\x95", "Ε", "<Epsilon/>", "Ε", "E", NULL, "\\u0917?", { "E", DocSymbol::Perl_char }}, + { SYM(Zeta), "\xce\x96", "Ζ", "<Zeta/>", "Ζ", "Z", NULL, "\\u0918?", { "Z", DocSymbol::Perl_char }}, + { SYM(Eta), "\xce\x97", "Η", "<Eta/>", "Η", "H", NULL, "\\u0919?", { "H", DocSymbol::Perl_char }}, + { SYM(Theta), "\xce\x98", "Θ", "<Theta/>", "Θ", "{$\\Theta$}", NULL, "\\u0920?", { "Theta", DocSymbol::Perl_symbol }}, + { SYM(Iota), "\xce\x99", "Ι", "<Iota/>", "Ι", "I", NULL, "\\u0921?", { "I", DocSymbol::Perl_char }}, + { SYM(Kappa), "\xce\x9a", "Κ", "<Kappa/>", "Κ", "K", NULL, "\\u0922?", { "K", DocSymbol::Perl_char }}, + { SYM(Lambda), "\xce\x9b", "Λ", "<Lambda/>", "Λ", "{$\\Lambda$}", NULL, "\\u0923?", { "Lambda", DocSymbol::Perl_symbol }}, + { SYM(Mu), "\xce\x9c", "Μ", "<Mu/>", "Μ", "M", NULL, "\\u0924?", { "M", DocSymbol::Perl_char }}, + { SYM(Nu), "\xce\x9d", "Ν", "<Nu/>", "Ν", "N", NULL, "\\u0925?", { "N", DocSymbol::Perl_char }}, + { SYM(Xi), "\xce\x9e", "Ξ", "<Xi/>", "Ξ", "{$\\Xi$}", NULL, "\\u0926?", { "Xi", DocSymbol::Perl_symbol }}, + { SYM(Omicron), "\xce\x9f", "Ο", "<Omicron/>", "Ο", "O", NULL, "\\u0927?", { "O", DocSymbol::Perl_char }}, + { SYM(Pi), "\xce\xa0", "Π", "<Pi/>", "Π", "{$\\Pi$}", NULL, "\\u0928?", { "Pi", DocSymbol::Perl_symbol }}, + { SYM(Rho), "\xce\xa1", "Ρ", "<Rho/>", "Ρ", "P", NULL, "\\u0929?", { "P", DocSymbol::Perl_char }}, + { SYM(Sigma), "\xce\xa3", "Σ", "<Sigma/>", "Σ", "{$\\Sigma$}", NULL, "\\u0931?", { "Sigma", DocSymbol::Perl_symbol }}, + { SYM(Tau), "\xce\xa4", "Τ", "<Tau/>", "Τ", "T", NULL, "\\u0932?", { "T", DocSymbol::Perl_char }}, + { SYM(Upsilon), "\xce\xa5", "Υ", "<Upsilon/>", "Υ", "{$\\Upsilon$}", NULL, "\\u0933?", { "Upsilon", DocSymbol::Perl_symbol }}, + { SYM(Phi), "\xce\xa6", "Φ", "<Phi/>", "Φ", "{$\\Phi$}", NULL, "\\u0934?", { "Phi", DocSymbol::Perl_symbol }}, + { SYM(Chi), "\xce\xa7", "Χ", "<Chi/>", "Χ", "X", NULL, "\\u0935?", { "X", DocSymbol::Perl_char }}, + { SYM(Psi), "\xce\xa8", "Ψ", "<Psi/>", "Ψ", "{$\\Psi$}", NULL, "\\u0936?", { "Psi", DocSymbol::Perl_symbol }}, + { SYM(Omega), "\xce\xa9", "Ω", "<Omega/>", "Ω", "{$\\Omega$}", NULL, "\\u0937?", { "Omega", DocSymbol::Perl_symbol }}, + { SYM(alpha), "\xce\xb1", "α", "<alpha/>", "α", "{$\\alpha$}", NULL, "\\u0945?", { "alpha", DocSymbol::Perl_symbol }}, + { SYM(beta), "\xce\xb2", "β", "<beta/>", "β", "{$\\beta$}", NULL, "\\u0946?", { "beta", DocSymbol::Perl_symbol }}, + { SYM(gamma), "\xce\xb3", "γ", "<gamma/>", "γ", "{$\\gamma$}", NULL, "\\u0947?", { "gamma", DocSymbol::Perl_symbol }}, + { SYM(delta), "\xce\xb4", "δ", "<delta/>", "δ", "{$\\delta$}", NULL, "\\u0948?", { "delta", DocSymbol::Perl_symbol }}, + { SYM(epsilon), "\xce\xb5", "ε", "<epsilon/>", "ε", "{$\\varepsilon$}", NULL, "\\u0949?", { "epsilon", DocSymbol::Perl_symbol }}, + { SYM(zeta), "\xce\xb6", "ζ", "<zeta/>", "ζ", "{$\\zeta$}", NULL, "\\u0950?", { "zeta", DocSymbol::Perl_symbol }}, + { SYM(eta), "\xce\xb7", "η", "<eta/>", "η", "{$\\eta$}", NULL, "\\u0951?", { "eta", DocSymbol::Perl_symbol }}, + { SYM(theta), "\xce\xb8", "θ", "<theta/>", "θ", "{$\\theta$}", NULL, "\\u0952?", { "theta", DocSymbol::Perl_symbol }}, + { SYM(iota), "\xce\xb9", "ι", "<iota/>", "ι", "{$\\iota$}", NULL, "\\u0953?", { "iota", DocSymbol::Perl_symbol }}, + { SYM(kappa), "\xce\xba", "κ", "<kappa/>", "κ", "{$\\kappa$}", NULL, "\\u0954?", { "kappa", DocSymbol::Perl_symbol }}, + { SYM(lambda), "\xce\xbb", "λ", "<lambda/>", "λ", "{$\\lambda$}", NULL, "\\u0955?", { "lambda", DocSymbol::Perl_symbol }}, + { SYM(mu), "\xce\xbc", "μ", "<mu/>", "μ", "{$\\mu$}", NULL, "\\u0956?", { "mu", DocSymbol::Perl_symbol }}, + { SYM(nu), "\xce\xbd", "ν", "<nu/>", "ν", "{$\\nu$}", NULL, "\\u0957?", { "nu", DocSymbol::Perl_symbol }}, + { SYM(xi), "\xce\xbe", "ξ", "<xi/>", "ξ", "{$\\xi$}", NULL, "\\u0958?", { "xi", DocSymbol::Perl_symbol }}, + { SYM(omicron), "\xce\xbf", "ο", "<omicron/>", "ο", "{$\\omicron$}", NULL, "\\u0959?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(pi), "\xcf\x80", "π", "<pi/>", "π", "{$\\pi$}", NULL, "\\u0960?", { "pi", DocSymbol::Perl_symbol }}, + { SYM(rho), "\xcf\x81", "ρ", "<rho/>", "ρ", "{$\\rho$}", NULL, "\\u0961?", { "rho", DocSymbol::Perl_symbol }}, + { SYM(sigmaf), "\xcf\x82", "ς", "<sigmaf/>", "ς", "{$\\varsigma$}", NULL, "\\u0962?", { "sigma", DocSymbol::Perl_symbol }}, + { SYM(sigma), "\xcf\x83", "σ", "<sigma/>", "σ", "{$\\sigma$}", NULL, "\\u0963?", { "sigma", DocSymbol::Perl_symbol }}, + { SYM(tau), "\xcf\x84", "τ", "<tau/>", "τ", "{$\\tau$}", NULL, "\\u0964?", { "tau", DocSymbol::Perl_symbol }}, + { SYM(upsilon), "\xcf\x85", "υ", "<upsilon/>", "υ", "{$\\upsilon$}", NULL, "\\u0965?", { "upsilon", DocSymbol::Perl_symbol }}, + { SYM(phi), "\xcf\x86", "φ", "<phi/>", "φ", "{$\\varphi$}", NULL, "\\u0966?", { "phi", DocSymbol::Perl_symbol }}, + { SYM(chi), "\xcf\x87", "χ", "<chi/>", "χ", "{$\\chi$}", NULL, "\\u0967?", { "chi", DocSymbol::Perl_symbol }}, + { SYM(psi), "\xcf\x88", "ψ", "<psi/>", "ψ", "{$\\psi$}", NULL, "\\u0968?", { "psi", DocSymbol::Perl_symbol }}, + { SYM(omega), "\xcf\x89", "ω", "<omega/>", "ω", "{$\\omega$}", NULL, "\\u0969?", { "omega", DocSymbol::Perl_symbol }}, + { SYM(thetasym), "\xcf\x91", "ϑ", "<thetasym/>", "ϑ", "{$\\vartheta$}", NULL, "\\u977?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(upsih), "\xcf\x92", "ϒ", "<upsih/>", "ϒ", "{$\\Upsilon$}", NULL, "\\u978?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(piv), "\xcf\x96", "ϖ", "<piv/>", "ϖ", "{$\\varpi$}", NULL, "\\u982?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(bull), "\xe2\x80\xa2", "•", "<bull/>", "•", "\\textbullet{}", NULL, "\\'95", { NULL, DocSymbol::Perl_unknown }}, + { SYM(hellip), "\xe2\x80\xa6", "…", "<hellip/>", "…", "{$\\cdots$}", NULL, "\\'85", { NULL, DocSymbol::Perl_unknown }}, + { SYM(prime), "\xe2\x80\xb2", "′", "<prime/>", "′", "'", NULL, "\\u8242?", { "\\\'", DocSymbol::Perl_string }}, + { SYM(Prime), "\xe2\x80\xb3", "″", "<Prime/>", "″", "''", NULL, "\\u8243?", { "\"", DocSymbol::Perl_char }}, + { SYM(oline), "\xe2\x80\xbe", "‾", "<oline/>", "‾", "{$\\overline{\\,}$}", NULL, "\\u8254?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(frasl), "\xe2\x81\x84", "⁄", "<frasl/>", "⁄", "/", NULL, "\\u8260?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(weierp), "\xe2\x84\x98", "℘", "<weierp/>", "℘", "{$\\wp$}", NULL, "\\u8472?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(image), "\xe2\x84\x91", "ℑ", "<image/>", "ℑ", "{$\\Im$}", NULL, "\\u8465?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(real), "\xe2\x84\x9c", "ℜ", "<real/>", "ℜ", "{$\\Re$}", NULL, "\\u8476?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(trade), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, + { SYM(alefsym), "\xe2\x85\xb5", "ℵ", "<alefsym/>", "ℵ", "{$\\aleph$}", NULL, "\\u8501?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(larr), "\xe2\x86\x90", "←", "<larr/>", "←", "{$\\leftarrow$}", NULL, "\\u8592?", { "<-", DocSymbol::Perl_string }}, + { SYM(uarr), "\xe2\x86\x91", "↑", "<uarr/>", "↑", "{$\\uparrow$}", NULL, "\\u8593?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(rarr), "\xe2\x86\x92", "→", "<rarr/>", "→", "{$\\rightarrow$}", NULL, "\\u8594?", { "->", DocSymbol::Perl_string }}, + { SYM(darr), "\xe2\x86\x93", "↓", "<darr/>", "↓", "{$\\downarrow$}", NULL, "\\u8595?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(harr), "\xe2\x86\x94", "↔", "<harr/>", "↔", "{$\\leftrightarrow$}", NULL, "\\u8596?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(crarr), "\xe2\x86\xb5", "↵", "<crarr/>", "↵", "{$\\hookleftarrow$}", NULL, "\\u8629?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(lArr), "\xe2\x87\x90", "⇐", "<lArr/>", "⇐", "{$\\Leftarrow$}", NULL, "\\u8656?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(uArr), "\xe2\x87\x91", "⇑", "<uArr/>", "⇑", "{$\\Uparrow$}", NULL, "\\u8657?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(rArr), "\xe2\x87\x92", "⇒", "<rArr/>", "⇒", "{$\\Rightarrow$}", NULL, "\\u8658?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(dArr), "\xe2\x87\x93", "⇓", "<dArr/>", "⇓", "{$\\Downarrow$}", NULL, "\\u8659?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(hArr), "\xe2\x87\x94", "⇔", "<hArr/>", "⇔", "{$\\Leftrightarrow$}", NULL, "\\u8660?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(forall), "\xe2\x88\x80", "∀", "<forall/>", "∀", "{$\\forall$}", NULL, "\\u8704?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(part), "\xe2\x88\x82", "∂", "<part/>", "∂", "{$\\partial$}", NULL, "\\u8706?", { "partial", DocSymbol::Perl_symbol }}, + { SYM(exist), "\xe2\x88\x83", "∃", "<exist/>", "∃", "{$\\exists$}", NULL, "\\u8707?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(empty), "\xe2\x88\x85", "∅", "<empty/>", "∅", "{$\\emptyset$}", NULL, "\\u8709?", { "empty", DocSymbol::Perl_symbol }}, + { SYM(nabla), "\xe2\x88\x87", "∇", "<nabla/>", "∇", "{$\\nabla$}", NULL, "\\u8711?", { "nabla", DocSymbol::Perl_symbol }}, + { SYM(isin), "\xe2\x88\x88", "∈", "<isin/>", "∈", "{$\\in$}", NULL, "\\u8712?", { "in", DocSymbol::Perl_symbol }}, + { SYM(notin), "\xe2\x88\x89", "∉", "<notin/>", "∉", "{$\\notin$}", NULL, "\\u8713?", { "notin", DocSymbol::Perl_symbol }}, + { SYM(ni), "\xe2\x88\x8b", "∋", "<ni/>", "∋", "{$\\ni$}", NULL, "\\u8715?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(prod), "\xe2\x88\x8f", "∏", "<prod/>", "∏", "{$\\prod$}", NULL, "\\u8719?", { "prod", DocSymbol::Perl_symbol }}, + { SYM(sum), "\xe2\x88\x91", "∑", "<sum/>", "∑", "{$\\sum$}", NULL, "\\u8721?", { "sum", DocSymbol::Perl_symbol }}, + { SYM(minus), "\xe2\x88\x92", "−", "<minus/>", "−", "-", NULL, "\\u8722?", { "-", DocSymbol::Perl_char }}, + { SYM(lowast), "\xe2\x88\x97", "∗", "<lowast/>", "∗", "{$\\ast$}", NULL, "\\u8727?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(radic), "\xe2\x88\x9a", "√", "<radic/>", "√", "{$\\surd$}", NULL, "\\u8730?", { "sqrt", DocSymbol::Perl_symbol }}, + { SYM(prop), "\xe2\x88\x9d", "∝", "<prop/>", "∝", "{$\\propto$}", NULL, "\\u8733?", { "propto", DocSymbol::Perl_symbol }}, + { SYM(infin), "\xe2\x88\x9e", "∞", "<infin/>", "∞", "{$\\infty$}", NULL, "\\u8734?", { "inf", DocSymbol::Perl_symbol }}, + { SYM(ang), "\xe2\x88\xa0", "∠", "<ang/>", "∠", "{$\\angle$}", NULL, "\\u8736?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(and), "\xe2\x88\xa7", "∧", "<and/>", "∧", "{$\\wedge$}", NULL, "\\u8743?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(or), "\xe2\x88\xa8", "∨", "<or/>", "∨", "{$\\vee$}", NULL, "\\u8744?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(cap), "\xe2\x88\xa9", "∩", "<cap/>", "∩", "{$\\cap$}", NULL, "\\u8745?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(cup), "\xe2\x88\xaa", "∪", "<cup/>", "∪", "{$\\cup$}", NULL, "\\u8746?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(int), "\xe2\x88\xab", "∫", "<int/>", "∫", "{$\\int$}", NULL, "\\u8747?", { "int", DocSymbol::Perl_symbol }}, + { SYM(there4), "\xe2\x88\xb4", "∴", "<there4/>", "∴", "{$\\therefore$}", NULL, "\\u8756?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(sim), "\xe2\x88\xbc", "∼", "<sim/>", "∼", "{$\\sim$}", NULL, "\\u8764?", { "~", DocSymbol::Perl_char }}, + { SYM(cong), "\xe2\x89\x85", "≅", "<cong/>", "≅", "{$\\cong$}", NULL, "\\u8773?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(asymp), "\xe2\x89\x88", "≈", "<asymp/>", "≈", "{$\\approx$}", NULL, "\\u8776?", { "approx", DocSymbol::Perl_symbol }}, + { SYM(ne), "\xe2\x89\xa0", "≠", "<ne/>", "≠", "{$\\ne$}", NULL, "\\u8800?", { "!=", DocSymbol::Perl_string }}, + { SYM(equiv), "\xe2\x89\xa1", "≡", "<equiv/>", "≡", "{$\\equiv$}", NULL, "\\u8801?", { "equiv", DocSymbol::Perl_symbol }}, + { SYM(le), "\xe2\x89\xa4", "≤", "<le/>", "≤", "{$\\le$}", NULL, "\\u8804?", { "<=", DocSymbol::Perl_string }}, + { SYM(ge), "\xe2\x89\xa5", "≥", "<ge/>", "≥", "{$\\ge$}", NULL, "\\u8805?", { ">=", DocSymbol::Perl_string }}, + { SYM(sub), "\xe2\x8a\x82", "⊂", "<sub/>", "⊂", "{$\\subset$}", NULL, "\\u8834?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(sup), "\xe2\x8a\x83", "⊃", "<sup/>", "⊃", "{$\\supset$}", NULL, "\\u8835?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(nsub), "\xe2\x8a\x84", "⊄", "<nsub/>", "⊄", "{$\\not\\subset$}", NULL, "\\u8836?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(sube), "\xe2\x8a\x86", "⊆", "<sube/>", "⊆", "{$\\subseteq$}", NULL, "\\u8838?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(supe), "\xe2\x8a\x87", "⊇", "<supe/>", "⊇", "{$\\supseteq$}", NULL, "\\u8839?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(oplus), "\xe2\x8a\x95", "⊕", "<oplus/>", "⊕", "{$\\oplus$}", NULL, "\\u8853?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(otimes), "\xe2\x8a\x97", "⊗", "<otimes/>", "⊗", "{$\\otimes$}", NULL, "\\u8855?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(perp), "\xe2\x8a\xa5", "⊥", "<perp/>", "⊥", "{$\\perp$}", NULL, "\\u8869?", { "perp", DocSymbol::Perl_symbol }}, + { SYM(sdot), "\xe2\x8b\x85", "⋅", "<sdot/>", "⋅", "{$\\cdot$}", NULL, "\\u8901?", { ".", DocSymbol::Perl_char }}, + { SYM(lceil), "\xe2\x8c\x88", "⌈", "<lceil/>", "⌈", "{$\\lceil$}", NULL, "\\u8968?", { "lceil", DocSymbol::Perl_symbol }}, + { SYM(rceil), "\xe2\x8c\x89", "⌉", "<rceil/>", "⌉", "{$\\rceil$}", NULL, "\\u8969?", { "rceil", DocSymbol::Perl_symbol }}, + { SYM(lfloor), "\xe2\x8c\x8a", "⌊", "<lfloor/>", "⌊", "{$\\lfloor$}", NULL, "\\u8970?", { "lfloor", DocSymbol::Perl_symbol }}, + { SYM(rfloor), "\xe2\x8c\x8b", "⌋", "<rfloor/>", "⌋", "{$\\rfloor$}", NULL, "\\u8971?", { "rfloor", DocSymbol::Perl_symbol }}, + { SYM(lang), "\xe2\x8c\xa9", "⟨", "<lang/>", "〈", "{$\\langle$}", NULL, "\\u9001?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(rang), "\xe2\x8c\xaa", "⟩", "<rang/>", "〉", "{$\\rangle$}", NULL, "\\u9002?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(loz), "\xe2\x97\x8a", "◊", "<loz/>", "◊", "{$\\lozenge$}", NULL, "\\u9674?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(spades), "\xe2\x99\xa0", "♠", "<spades/>", "♠", "{$\\spadesuit$}", NULL, "\\u9824?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(clubs), "\xe2\x99\xa3", "♣", "<clubs/>", "♣", "{$\\clubsuit$}", NULL, "\\u9827?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(hearts), "\xe2\x99\xa5", "♥", "<hearts/>", "♥", "{$\\heartsuit$}", NULL, "\\u9829?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(diams), "\xe2\x99\xa6", "♦", "<diams/>", "♦", "{$\\diamondsuit$}", NULL, "\\u9830?", { NULL, DocSymbol::Perl_unknown }}, + { SYM(quot), "\"", """, "\"", """, "\"", "\"", "\"", { "\"", DocSymbol::Perl_char }}, + { SYM(amp), "&", "&", "&", "&", "\\&", "&", "&", { "&", DocSymbol::Perl_char }}, + { SYM(lt), "<", "<", "<", "<", "<", "<", "<", { "<", DocSymbol::Perl_char }}, + { SYM(gt), ">", ">", ">", ">", ">", ">", ">", { ">", DocSymbol::Perl_char }}, + { SYM(OElig), "\xc5\x92", "Œ", "<OElig/>", "Œ", "\\OE", NULL, "\\'8C", { NULL, DocSymbol::Perl_unknown }}, + { SYM(oelig), "\xc5\x93", "œ", "<oelig/>", "œ", "\\oe", NULL, "\\'9C", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Scaron), "\xc5\xa0", "Š", "<Scaron/>", "Š", "\\v{S}", NULL, "\\'8A", { NULL, DocSymbol::Perl_unknown }}, + { SYM(scaron), "\xc5\xa1", "š", "<scaron/>", "š", "\\v{s}", NULL, "\\'9A", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Yuml), "\xc5\xb8", "Ÿ", "<Yumlaut/>", "Ÿ", "\\\"{Y}", "Y\\*(4", "\\'9F", { "Y", DocSymbol::Perl_umlaut }}, + { SYM(circ), "\xcb\x86", "ˆ", "<circ/>", "ˆ", "{$\\circ$}", NULL, "\\'88", { " ", DocSymbol::Perl_circ }}, + { SYM(tilde), "\xcb\x9c", "˜", "<tilde/>", "˜", "\\~{}", "~", "\\'98", { " ", DocSymbol::Perl_tilde }}, + { SYM(ensp), "\xe2\x80\x82", " ", "<ensp/>", " ", "\\enskip{}", NULL, "{\\enspace}", { NULL, DocSymbol::Perl_unknown }}, + { SYM(emsp), "\xe2\x80\x83", " ", "<emsp/>", " ", "\\quad{}", NULL, "{\\emspace}", { NULL, DocSymbol::Perl_unknown }}, + { SYM(thinsp), "\xe2\x80\x89", " ", "<thinsp/>", " ", "\\,", NULL, "{\\qmspace}", { NULL, DocSymbol::Perl_unknown }}, + { SYM(zwnj), "\xe2\x80\x8c", "‌", "<zwnj/>", "‌", "{}", NULL, "\\zwnj", { NULL, DocSymbol::Perl_unknown }}, + { SYM(zwj), "\xe2\x80\x8d", "‍", "<zwj/>", "‍", "", NULL, "\\zwj", { NULL, DocSymbol::Perl_unknown }}, + { SYM(lrm), "\xe2\x80\x8e", "‎", "<lrm/>", "‎", "", NULL, "\\ltrmark", { NULL, DocSymbol::Perl_unknown }}, + { SYM(rlm), "\xe2\x80\x8f", "‏", "<rlm/>", "‏", "", NULL, "\\rtlmark", { NULL, DocSymbol::Perl_unknown }}, + { SYM(ndash), "\xe2\x80\x93", "–", "<ndash/>", "–", "--", "--", "\\'96", { "-", DocSymbol::Perl_char }}, + { SYM(mdash), "\xe2\x80\x94", "—", "<mdash/>", "—", "---", "---", "\\'97", { "--", DocSymbol::Perl_string }}, + { SYM(lsquo), "\xe2\x80\x98", "‘", "<lsquo/>", "‘", "`", "`", "\\'91", { "\\\'", DocSymbol::Perl_string }}, + { SYM(rsquo), "\xe2\x80\x99", "’", "<rsquo/>", "’", "'", "'", "\\'92", { "\\\'", DocSymbol::Perl_string }}, + { SYM(sbquo), "\xe2\x80\x9a", "‚", "<sbquo/>", "‚", "\\quotesinglbase{}", NULL, "\\'82", { NULL, DocSymbol::Perl_unknown }}, + { SYM(ldquo), "\xe2\x80\x9c", "“", "<ldquo/>", "“", "``", "``", "\\'93", { "\"", DocSymbol::Perl_char }}, + { SYM(rdquo), "\xe2\x80\x9d", "”", "<rdquo/>", "”", "''", "''", "\\'94", { "\"", DocSymbol::Perl_char }}, + { SYM(bdquo), "\xe2\x80\x9e", "„", "<bdquo/>", "„", "\\quotedblbase{}", NULL, "\\'84", { NULL, DocSymbol::Perl_unknown }}, + { SYM(dagger), "\xe2\x80\xa0", "†", "<dagger/>", "†", "{$\\dagger$}", NULL, "\\'86", { NULL, DocSymbol::Perl_unknown }}, + { SYM(Dagger), "\xe2\x80\xa1", "‡", "<Dagger/>", "‡", "{$\\ddagger$}", NULL, "\\'87", { NULL, DocSymbol::Perl_unknown }}, + { SYM(permil), "\xe2\x80\xb0", "‰", "<permil/>", "‰", "{$\\permil{}$}", NULL, "\\'89", { NULL, DocSymbol::Perl_unknown }}, + { SYM(lsaquo), "\xe2\x80\xb9", "‹", "<lsaquo/>", "‹", "\\guilsinglleft{}", NULL, "\\'8B", { NULL, DocSymbol::Perl_unknown }}, + { SYM(rsaquo), "\xe2\x80\xba", "›", "<rsaquo/>", "›", "\\guilsinglright{}", NULL, "\\'9B", { NULL, DocSymbol::Perl_unknown }}, + { SYM(euro), "\xe2\x82\xac", "€", "<euro/>", "€", "\\texteuro{}", NULL, "\\'80", { NULL, DocSymbol::Perl_unknown }}, + + // doxygen extension to the HTML4 table of HTML entities + { SYM(tm), "\xe2\x84\xa2", "™", "<trademark/>", "™", "\\texttrademark{}", "(TM)", "\\'99", { "trademark", DocSymbol::Perl_symbol }}, + { SYM(apos), "'", "'", "'", "'", "'", "'", "'", { "\\\'", DocSymbol::Perl_string }}, + + // doxygen commands represented as HTML entities + { SYM(BSlash), "\\", "\\", "\\", "\\", "\\textbackslash{}", "\\\\", "\\\\", { "\\\\", DocSymbol::Perl_string }}, + { SYM(At), "@", "@", "@", "@", "@", "@", "@", { "@", DocSymbol::Perl_char }}, + { SYM(Less), "<", "<", "<", "<", "<", "<", "<", { "<", DocSymbol::Perl_char }}, + { SYM(Greater), ">", ">", ">", ">", ">", ">", ">", { ">", DocSymbol::Perl_char }}, + { SYM(Amp), "&", "&", "&", "&", "\\&", "&", "&", { "&", DocSymbol::Perl_char }}, + { SYM(Dollar), "$", "$", "$", "$", "\\$", "$", "$", { "$", DocSymbol::Perl_char }}, + { SYM(Hash), "#;", "#", "#", "#", "\\#", "#", "#", { "#", DocSymbol::Perl_char }}, + { SYM(DoubleColon), "::", "::", "::", "::", "::", "::", "::", { "::", DocSymbol::Perl_string }}, + { SYM(Percent), "%", "%", "%", "%", "\\%", "%", "%", { "%", DocSymbol::Perl_char }}, + { SYM(Pipe), "|", "|", "|", "|", "$|$", "|", "|", { "|", DocSymbol::Perl_char }}, + { SYM(Quot), "\"", "\"", "\"", """, "\"", "\"", "\"", { "\"", DocSymbol::Perl_char }} +}; + +static const int g_numHtmlEntities = (int)(sizeof(g_htmlEntities)/ sizeof(*g_htmlEntities)); + +HtmlEntityMapper *HtmlEntityMapper::s_instance = 0; + +HtmlEntityMapper::HtmlEntityMapper() +{ + m_name2sym = new QDict<int>(1009); + m_name2sym->setAutoDelete(TRUE); + for (int i = 0; i < g_numHtmlEntities; i++) + { + m_name2sym->insert(g_htmlEntities[i].item,new int(g_htmlEntities[i].symb)); + } +} + +HtmlEntityMapper::~HtmlEntityMapper() +{ + delete m_name2sym; +} + +/** Returns the one and only instance of the HTML entity mapper */ +HtmlEntityMapper *HtmlEntityMapper::instance() +{ + if (s_instance==0) + { + s_instance = new HtmlEntityMapper; + } + return s_instance; +} + +/** Deletes the one and only instance of the HTML entity mapper */ +void HtmlEntityMapper::deleteInstance() +{ + delete s_instance; + s_instance=0; +} + + +/*! @brief Access routine to the UTF8 code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @param useInPrintf If TRUE the result will be escaped such that it can be + * used in a printf string pattern + * @return the UTF8 code of the HTML entity, + * in case the UTF code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::utf8(DocSymbol::SymType symb,bool useInPrintf) const +{ + if (useInPrintf && symb==DocSymbol::Sym_Percent) + { + return "%%"; // escape for printf + } + else + { + return g_htmlEntities[symb].UTF8; + } +} + +/*! @brief Access routine to the html code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @param useInPrintf If TRUE the result will be escaped such that it can be + * used in a printf string pattern + * @return the html representation of the HTML entity, + * in case the html code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::html(DocSymbol::SymType symb,bool useInPrintf) const +{ + if (useInPrintf && symb==DocSymbol::Sym_Percent) + { + return "%%"; // escape for printf + } + else + { + return g_htmlEntities[symb].html; + } +} + +/*! @brief Access routine to the XML code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the XML code of the HTML entity, + * in case the XML code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::xml(DocSymbol::SymType symb) const +{ + return g_htmlEntities[symb].xml; +} + +/*! @brief Access routine to the docbook code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the docbook code of the HTML entity, + * in case the docbook code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::docbook(DocSymbol::SymType symb) const +{ + return g_htmlEntities[symb].docbook; +} + +/*! @brief Access routine to the LaTeX code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the LaTeX code of the HTML entity, + * in case the LaTeX code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::latex(DocSymbol::SymType symb) const +{ + return g_htmlEntities[symb].latex; +} + +/*! @brief Access routine to the man code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the man of the HTML entity, + * in case the man code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::man(DocSymbol::SymType symb) const +{ + return g_htmlEntities[symb].man; +} + +/*! @brief Access routine to the RTF code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the RTF of the HTML entity, + * in case the RTF code is unknown \c NULL is returned. + */ +const char *HtmlEntityMapper::rtf(DocSymbol::SymType symb) const +{ + return g_htmlEntities[symb].rtf; +} + +/*! @brief Access routine to the perl struct with the perl code of the HTML entity + * + * @param symb Code of the requested HTML entity + * @return the pointer to perl struct with the perl code of the HTML entity, + * in case the perl code does not exists the NULL pointer is entered in the + * \c symb field and in the `DocSymbol::Perl_unknown` in the \c type field. + */ +const DocSymbol::PerlSymb *HtmlEntityMapper::perl(DocSymbol::SymType symb) const +{ + return &g_htmlEntities[symb].perl; +} + +/*! + * @brief Give code of the requested HTML entity name + * @param symName HTML entity name without \c & and \c; + * @return the code for the requested HTML entity name, + * in case the requested HTML item does not exist `DocSymbol::Sym_unknown` is returned. + */ +DocSymbol::SymType HtmlEntityMapper::name2sym(const QCString &symName) const +{ + int *pSymb = m_name2sym->find(symName); + return pSymb ? ((DocSymbol::SymType)*pSymb) : DocSymbol::Sym_Unknown; +} + +void HtmlEntityMapper::writeXMLSchema(FTextStream &t) +{ + for (int i=0;i<g_numHtmlEntities - g_numberHtmlMappedCmds;i++) + { + QCString bareName = g_htmlEntities[i].item; + bareName = bareName.mid(1,bareName.length()-2); + t << " <xsd:element name=\"" << bareName << "\" type=\"docEmptyType\" />\n"; + } +} + +/*! @brief Routine to check if the entries of the html_entities are numbered correctly + * @details in case of a mismatch a warning message is given. + */ +void HtmlEntityMapper::validate() +{ + for (int i = 0; i < g_numHtmlEntities; i++) + { + if (i != g_htmlEntities[i].symb) + { + warn_uncond("Internal inconsistency, htmlentries code %d (item=%s)\n",i,g_htmlEntities[i].item); + } + } +} diff --git a/src/htmlentity.h b/src/htmlentity.h new file mode 100644 index 0000000..9cebeb3 --- /dev/null +++ b/src/htmlentity.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2014 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ +#ifndef HTMLENTITY_H +#define HTMLENTITY_H + +#include <qdict.h> +#include "docparser.h" + +class FTextStream; + +/** @brief Singleton helper class to map html entities to other formats */ +class HtmlEntityMapper +{ + public: + static HtmlEntityMapper *instance(); + static void deleteInstance(); + DocSymbol::SymType name2sym(const QCString &symName) const; + const char *utf8(DocSymbol::SymType symb,bool useInPrintf=FALSE) const; + const char *html(DocSymbol::SymType symb,bool useInPrintf=FALSE) const; + const char *xml(DocSymbol::SymType symb) const; + const char *docbook(DocSymbol::SymType symb) const; + const char *latex(DocSymbol::SymType symb) const; + const char *man(DocSymbol::SymType symb) const; + const char *rtf(DocSymbol::SymType symb) const; + const DocSymbol::PerlSymb *perl(DocSymbol::SymType symb) const; + void writeXMLSchema(FTextStream &t); + void validate(); + private: + HtmlEntityMapper(); + ~HtmlEntityMapper(); + static HtmlEntityMapper *s_instance; + QDict<int> *m_name2sym; +}; + +#endif diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 059d0e7..fa446ed 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlgen.h b/src/htmlgen.h index 5d86878..7b63a6b 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index 50aea83..754893d 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlhelp.h b/src/htmlhelp.h index 85e46e0..574cec9 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/image.cpp b/src/image.cpp index 49485af..3283754 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/image.h b/src/image.h index d2311a1..ad11a64 100644 --- a/src/image.h +++ b/src/image.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/index.cpp b/src/index.cpp index 88dbd73..a283b0c 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/index.h b/src/index.h index ae15f16..6805655 100644 --- a/src/index.h +++ b/src/index.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/language.cpp b/src/language.cpp index c993323..c7a2b12 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/language.h b/src/language.h index 9550cb9..4780ab3 100644 --- a/src/language.h +++ b/src/language.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index bc8e5a5..aefcac3 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -31,6 +31,7 @@ #include "cite.h" #include "filedef.h" #include "config.h" +#include "htmlentity.h" static QCString escapeLabelName(const char *s) { @@ -135,135 +136,25 @@ void LatexDocVisitor::visit(DocWhiteSpace *w) void LatexDocVisitor::visit(DocSymbol *s) { if (m_hide) return; - switch(s->symbol()) - { - case DocSymbol::BSlash: m_t << "\\textbackslash{}"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: if (m_insidePre) m_t << "<"; else m_t << "$<$"; - break; - case DocSymbol::Greater: if (m_insidePre) m_t << ">"; else m_t << "$>$"; break; - case DocSymbol::Amp: m_t << "\\&"; 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 << "\\copyright{}"; break; - case DocSymbol::Tm: m_t << "\\texttrademark{}"; break; - case DocSymbol::Reg: m_t << "\\textregistered{}"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << "\""; break; - case DocSymbol::Lsquo: m_t << "`"; break; - case DocSymbol::Rsquo: m_t << "'"; break; - case DocSymbol::Ldquo: m_t << "``"; break; - case DocSymbol::Rdquo: m_t << "''"; break; - case DocSymbol::Ndash: m_t << "--"; break; - case DocSymbol::Mdash: m_t << "---"; break; - case DocSymbol::Uml: - if (s->letter()=='i') - m_t << "\\\"{\\i}"; - else - m_t << "\\\"{" << s->letter() << "}"; - break; - case DocSymbol::Acute: - if (s->letter()=='i') - m_t << "\\'{\\i}"; - else - m_t << "\\'{" << s->letter() << "}"; - break; - case DocSymbol::Grave: - if (s->letter()=='i') - m_t << "\\`{\\i}"; - else - m_t << "\\`{" << s->letter() << "}"; - break; - case DocSymbol::Circ: - if (s->letter()=='i') - m_t << "\\^{\\i}"; - else - m_t << "\\^{" << s->letter() << "}"; - break; - case DocSymbol::Slash: if (tolower(s->letter())=='o') - m_t << "{\\" << s->letter() << "}"; - else - m_t << s->letter(); - break; - case DocSymbol::Tilde: m_t << "\\~{" << s->letter() << "}"; break; - case DocSymbol::Szlig: m_t << "{\\ss}"; break; - case DocSymbol::Cedil: m_t << "\\c{" << s->letter() << "}"; break; - case DocSymbol::Ring: m_t << "\\" << s->letter() << s->letter(); break; - case DocSymbol::Nbsp: m_t << "~"; break; - case DocSymbol::AElig: m_t << "{\\AE}"; break; - case DocSymbol::Aelig: m_t << "{\\ae}"; 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 << "{$\\varepsilon$}"; 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 << "{$\\varphi$}"; 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 << "{$\\varsigma$}"; break; - case DocSymbol::Section: m_t << "{$\\S$}"; break; - case DocSymbol::Degree: m_t << "\\textdegree"; break; - case DocSymbol::Prime: m_t << "'"; break; - case DocSymbol::DoublePrime: m_t << "''"; break; - case DocSymbol::Infinity: m_t << "{$\\infty$}"; break; - case DocSymbol::EmptySet: m_t << "{$\\emptyset$}"; break; - case DocSymbol::PlusMinus: m_t << "{$\\pm$}"; break; - case DocSymbol::Times: m_t << "{$\\times$}"; break; - case DocSymbol::Minus: m_t << "-"; break; - case DocSymbol::CenterDot: m_t << "{$\\cdot$}"; break; - case DocSymbol::Partial: m_t << "{$\\partial$}"; break; - case DocSymbol::Nabla: m_t << "{$\\nabla$}"; break; - case DocSymbol::SquareRoot: m_t << "{$\\surd$}"; 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 << "{$\\approx$}"; break; - case DocSymbol::NotEqual: m_t << "{$\\ne$}"; break; - case DocSymbol::Equivalent: m_t << "{$\\equiv$}"; break; - case DocSymbol::Proportional: m_t << "{$\\propto$}"; break; - case DocSymbol::LessEqual: m_t << "{$\\le$}"; break; - case DocSymbol::GreaterEqual: m_t << "{$\\ge$}"; break; - case DocSymbol::LeftArrow: m_t << "{$\\leftarrow$}"; break; - case DocSymbol::RightArrow: m_t << "{$\\rightarrow$}"; break; - case DocSymbol::SetIn: m_t << "{$\\in$}"; 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"); + const char *res = HtmlEntityMapper::instance()->latex(s->symbol()); + if (res) + { + if (((s->symbol() == DocSymbol::Sym_lt) || (s->symbol() == DocSymbol::Sym_Less))&& (!m_insidePre)) + { + m_t << "$<$"; + } + else if (((s->symbol() == DocSymbol::Sym_gt) || (s->symbol() == DocSymbol::Sym_Greater)) && (!m_insidePre)) + { + m_t << "$>$"; + } + else + { + m_t << res; + } + } + else + { + err("LaTeX: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 4073b7f..d386569 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 04750f5..1fa092d 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -293,7 +293,9 @@ static void writeDefaultHeaderPart1(FTextStream &t) "\\usepackage{makeidx}\n" "\\usepackage{multicol}\n" "\\usepackage{multirow}\n" + "\\PassOptionsToPackage{warn}{textcomp}\n" "\\usepackage{textcomp}\n" + "\\usepackage[nointegrals]{wasysym}\n" "\\usepackage[table]{xcolor}\n" "\n"; diff --git a/src/latexgen.h b/src/latexgen.h index 8e29c01..f68612d 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/layout.cpp b/src/layout.cpp index bc00745..739a2a3 100644 --- a/src/layout.cpp +++ b/src/layout.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/layout.h b/src/layout.h index 2506076..d50bc7c 100644 --- a/src/layout.h +++ b/src/layout.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxycfg.pro.in b/src/libdoxycfg.pro.in index a8f38c1..ab7c36c 100644 --- a/src/libdoxycfg.pro.in +++ b/src/libdoxycfg.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxycfg.t.in b/src/libdoxycfg.t.in index 0afb9c6..89833f6 100644 --- a/src/libdoxycfg.t.in +++ b/src/libdoxycfg.t.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index b441b96..457db58 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby @@ -59,6 +59,7 @@ HEADERS = arguments.h \ htmldocvisitor.h \ htmlgen.h \ htmlhelp.h \ + htmlentity.h \ image.h \ index.h \ language.h \ @@ -152,6 +153,7 @@ SOURCES = arguments.cpp \ htmldocvisitor.cpp \ htmlgen.cpp \ htmlhelp.cpp \ + htmlentity.cpp \ image.cpp \ index.cpp \ language.cpp \ diff --git a/src/libdoxygen.t.in b/src/libdoxygen.t.in index 7dfc906..173f90b 100644 --- a/src/libdoxygen.t.in +++ b/src/libdoxygen.t.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2013 by Dimitri van Heesch. +# Copyright (C) 1997-2014 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/logos.cpp b/src/logos.cpp index 6aea996..9a9e5db 100644 --- a/src/logos.cpp +++ b/src/logos.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/logos.h b/src/logos.h index 13406e1..083d772 100644 --- a/src/logos.h +++ b/src/logos.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/main.cpp b/src/main.cpp index 09798ec..b64f700 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 729f3d4..1f8f77e 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -29,6 +29,7 @@ #include "message.h" #include "parserintf.h" #include "filedef.h" +#include "htmlentity.h" ManDocVisitor::ManDocVisitor(FTextStream &t,CodeOutputInterface &ci, const char *langExt) @@ -75,42 +76,15 @@ void ManDocVisitor::visit(DocWhiteSpace *w) void ManDocVisitor::visit(DocSymbol *s) { if (m_hide) return; - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->man(s->symbol()); + if (res) { - case DocSymbol::BSlash: m_t << "\\\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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 << "(C)"; break; - case DocSymbol::Tm: m_t << "(TM)"; break; - case DocSymbol::Reg: m_t << "(R)"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << "\""; break; - case DocSymbol::Lsquo: m_t << "`"; break; - case DocSymbol::Rsquo: m_t << "'"; break; - case DocSymbol::Ldquo: m_t << "``"; break; - case DocSymbol::Rdquo: m_t << "''"; break; - case DocSymbol::Ndash: m_t << "--"; break; - case DocSymbol::Mdash: m_t << "---"; break; - case DocSymbol::Uml: m_t << s->letter() << "\\*(4"; break; - case DocSymbol::Acute: m_t << s->letter() << "\\*(`"; break; - case DocSymbol::Grave: m_t << s->letter() << "\\*:"; break; - case DocSymbol::Circ: m_t << s->letter() << "\\*^"; break; - case DocSymbol::Slash: m_t << s->letter(); break; /* todo: implement this */ - case DocSymbol::Tilde: m_t << s->letter() << "\\*~"; break; - case DocSymbol::Szlig: m_t << "s\\*:"; break; - case DocSymbol::Cedil: m_t << s->letter() << "\\*,"; break; - case DocSymbol::Ring: m_t << s->letter() << "\\*o"; break; - case DocSymbol::Nbsp: m_t << " "; break; - default: - // unsupport symbol for man page :-( - break; + m_t << res; + } + else + { + // no error or warning to be supplied + // err("man: non supported HTML-entity found: &%s;\n",get_symbol_item(s->symbol())); } m_firstCol=FALSE; } diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h index 7012152..a5906d0 100644 --- a/src/mandocvisitor.h +++ b/src/mandocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mangen.cpp b/src/mangen.cpp index f1cc76a..cf6795b 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mangen.h b/src/mangen.h index 7ac5ae1..98ef959 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/markdown.cpp b/src/markdown.cpp index 6c7c349..6ae95fe 100644 --- a/src/markdown.cpp +++ b/src/markdown.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -1725,7 +1725,7 @@ static int writeBlockQuote(GrowBuf &out,const char *data,int size) { // find end of this line end=i+1; - while (end<size && data[end-1]!='\n') end++; + while (end<=size && data[end-1]!='\n') end++; int j=i; int level=0; int indent=i; @@ -1781,7 +1781,7 @@ static int writeCodeBlock(GrowBuf &out,const char *data,int size,int refIndent) { // find end of this line end=i+1; - while (end<size && data[end-1]!='\n') end++; + while (end<=size && data[end-1]!='\n') end++; int j=i; int indent=0; while (j<end && data[j]==' ') j++,indent++; @@ -1828,7 +1828,7 @@ static void findEndOfLine(GrowBuf &out,const char *data,int size, // find end of the line int nb=0; end=i+1; - while (end<size && data[end-1]!='\n') + while (end<=size && data[end-1]!='\n') { // while looking for the end of the line we might encounter a block // that needs to be passed unprocessed. @@ -1892,12 +1892,12 @@ static void findEndOfLine(GrowBuf &out,const char *data,int size, } else if (nb==0 && data[end-1]=='`') { - while (end<size && data[end-1]=='`') end++,nb++; + while (end<=size && data[end-1]=='`') end++,nb++; } else if (nb>0 && data[end-1]=='`') { int enb=0; - while (end<size && data[end-1]=='`') end++,enb++; + while (end<=size && data[end-1]=='`') end++,enb++; if (enb==nb) nb=0; } else @@ -1968,7 +1968,7 @@ static QCString processBlocks(const QCString &s,int indent) // get indent for the first line end = i+1; int sp=0; - while (end<size && data[end-1]!='\n') + while (end<=size && data[end-1]!='\n') { if (data[end-1]==' ') sp++; end++; diff --git a/src/markdown.h b/src/markdown.h index d3a845e..8fd7677 100644 --- a/src/markdown.h +++ b/src/markdown.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/marshal.h b/src/marshal.h index 977a89b..0c61276 100644 --- a/src/marshal.h +++ b/src/marshal.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 6b890c1..b0a6668 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberdef.h b/src/memberdef.h index dffd53c..3259102 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 055ddbf..84567e2 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membergroup.h b/src/membergroup.h index 1c744d3..42e60c5 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberlist.cpp b/src/memberlist.cpp index e0851fe..28ed37e 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberlist.h b/src/memberlist.h index aa20807..607eb01 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membername.cpp b/src/membername.cpp index 946ce43..a2f7296 100644 --- a/src/membername.cpp +++ b/src/membername.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membername.h b/src/membername.h index 1b9dd47..7a2fdc5 100644 --- a/src/membername.h +++ b/src/membername.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/message.cpp b/src/message.cpp index dad3e0e..8e4ecbd 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/message.h b/src/message.h index ca76a20..481e8bf 100644 --- a/src/message.h +++ b/src/message.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/msc.cpp b/src/msc.cpp index 3592e76..ebbba0f 100644 --- a/src/msc.cpp +++ b/src/msc.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 146e8da..253b712 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -248,11 +248,17 @@ void NamespaceDef::computeAnchors() if (allMemberList) setAnchors(allMemberList); } +bool NamespaceDef::hasDetailedDescription() const +{ + static bool repeatBrief = Config_getBool("REPEAT_BRIEF"); + return ((!briefDescription().isEmpty() && repeatBrief) || + !documentation().isEmpty()); +} + + void NamespaceDef::writeDetailedDescription(OutputList &ol,const QCString &title) { - if ((!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) || - !documentation().isEmpty() - ) + if (hasDetailedDescription()) { ol.pushGeneratorState(); ol.disable(OutputGenerator::Html); @@ -294,7 +300,7 @@ void NamespaceDef::writeDetailedDescription(OutputList &ol,const QCString &title void NamespaceDef::writeBriefDescription(OutputList &ol) { - if (!briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) + if (hasBriefDescription()) { DocRoot *rootNode = validatingParseDoc(briefFile(),briefLine(),this,0, briefDescription(),TRUE,FALSE,0,TRUE,FALSE); @@ -307,9 +313,7 @@ void NamespaceDef::writeBriefDescription(OutputList &ol) ol.writeString(" \n"); ol.enable(OutputGenerator::RTF); - if (Config_getBool("REPEAT_BRIEF") || - !documentation().isEmpty() - ) + if (hasDetailedDescription()) { ol.disableAllBut(OutputGenerator::Html); ol.startTextLink(0,"details"); diff --git a/src/namespacedef.h b/src/namespacedef.h index c4afac9..fedd410 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -71,6 +71,7 @@ class NamespaceDef : public Definition bool isLinkableInProject() const; bool isLinkable() const; + bool hasDetailedDescription() const; void addMembersToMemberGroup(); void distributeMemberGroupDocumentation(); void findSectionsInDocumentation(); diff --git a/src/objcache.cpp b/src/objcache.cpp index 3a538a3..a59c67b 100644 --- a/src/objcache.cpp +++ b/src/objcache.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/objcache.h b/src/objcache.h index d93c1f6..6e6e95d 100644 --- a/src/objcache.h +++ b/src/objcache.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputgen.cpp b/src/outputgen.cpp index 89686e0..ee9bc48 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputgen.h b/src/outputgen.h index 95c467d..aaf1ba7 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputlist.cpp b/src/outputlist.cpp index 4efbd9c..59c3efb 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputlist.h b/src/outputlist.h index fc41aae..f578d64 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pagedef.cpp b/src/pagedef.cpp index 3c9e1b6..e75327c 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pagedef.h b/src/pagedef.h index 01823cb..890829e 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/parserintf.h b/src/parserintf.h index 5378588..c389597 100644 --- a/src/parserintf.h +++ b/src/parserintf.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index 237cb8f..7fa0153 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * Authors: Dimitri van Heesch, Miguel Lobo. * * Permission to use, copy, modify, and distribute this software and its @@ -41,6 +41,8 @@ #include "namespacedef.h" #include "membergroup.h" #include "section.h" +#include "util.h" +#include "htmlentity.h" #define PERLOUTPUT_MAX_INDENTATION 40 @@ -540,140 +542,71 @@ void PerlModDocVisitor::visit(DocWhiteSpace *) void PerlModDocVisitor::visit(DocSymbol *sy) { - char c = 0; - const char *s = 0; - const char *accent = 0; - const char *symbol = 0; - switch(sy->symbol()) + const DocSymbol::PerlSymb *res = HtmlEntityMapper::instance()->perl(sy->symbol()); + const char *accent=0; + if (res-> symb) { - case DocSymbol::At: c = '@'; break; - case DocSymbol::Less: c = '<'; break; - case DocSymbol::Greater: c = '>'; break; - case DocSymbol::Amp: c = '&'; break; - case DocSymbol::Dollar: c = '$'; break; - case DocSymbol::Hash: c = '#'; break; - case DocSymbol::DoubleColon: s = "::"; break; - case DocSymbol::Percent: c = '%'; break; - case DocSymbol::Pipe: c = '|'; break; - case DocSymbol::Quot: c = '"'; break; - case DocSymbol::Lsquo: s = "\\\'"; break; - case DocSymbol::Rsquo: s = "\\\'"; break; - case DocSymbol::Ldquo: c = '"'; break; - case DocSymbol::Rdquo: c = '"'; break; - case DocSymbol::Ndash: c = '-'; break; - case DocSymbol::Mdash: s = "--"; break; - case DocSymbol::Nbsp: c = ' '; break; - case DocSymbol::Uml: accent = "umlaut"; break; - case DocSymbol::Acute: accent = "acute"; break; - case DocSymbol::Grave: accent = "grave"; break; - case DocSymbol::Circ: accent = "circ"; break; - case DocSymbol::Slash: accent = "slash"; break; - case DocSymbol::Tilde: accent = "tilde"; break; - case DocSymbol::Cedil: accent = "cedilla"; break; - case DocSymbol::Ring: accent = "ring"; break; - case DocSymbol::BSlash: s = "\\\\"; break; - case DocSymbol::Copy: symbol = "copyright"; break; - case DocSymbol::Tm: symbol = "trademark"; break; - case DocSymbol::Reg: symbol = "registered"; break; - case DocSymbol::Szlig: symbol = "szlig"; break; - case DocSymbol::Apos: s = "\\\'"; break; - case DocSymbol::Aelig: symbol = "aelig"; break; - case DocSymbol::AElig: symbol = "AElig"; break; - case DocSymbol::GrkGamma: symbol = "Gamma"; break; - case DocSymbol::GrkDelta: symbol = "Delta"; break; - case DocSymbol::GrkTheta: symbol = "Theta"; break; - case DocSymbol::GrkLambda: symbol = "Lambda"; break; - case DocSymbol::GrkXi: symbol = "Xi"; break; - case DocSymbol::GrkPi: symbol = "Pi"; break; - case DocSymbol::GrkSigma: symbol = "Sigma"; break; - case DocSymbol::GrkUpsilon: symbol = "Upsilon"; break; - case DocSymbol::GrkPhi: symbol = "Phi"; break; - case DocSymbol::GrkPsi: symbol = "Psi"; break; - case DocSymbol::GrkOmega: symbol = "Omega"; break; - case DocSymbol::Grkalpha: symbol = "alpha"; break; - case DocSymbol::Grkbeta: symbol = "beta"; break; - case DocSymbol::Grkgamma: symbol = "gamma"; break; - case DocSymbol::Grkdelta: symbol = "delta"; break; - case DocSymbol::Grkepsilon: symbol = "epsilon"; break; - case DocSymbol::Grkzeta: symbol = "zeta"; break; - case DocSymbol::Grketa: symbol = "eta"; break; - case DocSymbol::Grktheta: symbol = "theta"; break; - case DocSymbol::Grkiota: symbol = "iota"; break; - case DocSymbol::Grkkappa: symbol = "kappa"; break; - case DocSymbol::Grklambda: symbol = "lambda"; break; - case DocSymbol::Grkmu: symbol = "mu"; break; - case DocSymbol::Grknu: symbol = "nu"; break; - case DocSymbol::Grkxi: symbol = "xi"; break; - case DocSymbol::Grkpi: symbol = "pi"; break; - case DocSymbol::Grkrho: symbol = "rho"; break; - case DocSymbol::Grksigma: symbol = "sigma"; break; - case DocSymbol::Grktau: symbol = "tau"; break; - case DocSymbol::Grkupsilon: symbol = "upsilon"; break; - case DocSymbol::Grkphi: symbol = "phi"; break; - case DocSymbol::Grkchi: symbol = "chi"; break; - case DocSymbol::Grkpsi: symbol = "psi"; break; - case DocSymbol::Grkomega: symbol = "omega"; break; - case DocSymbol::Grkvarsigma: symbol = "sigma"; break; - case DocSymbol::Section: symbol = "sect"; break; - case DocSymbol::Degree: symbol = "deg"; break; - case DocSymbol::Prime: s = "\\\'"; break; - case DocSymbol::DoublePrime: c = '"'; break; - case DocSymbol::Infinity: symbol = "inf"; break; - case DocSymbol::EmptySet: symbol = "empty"; break; - case DocSymbol::PlusMinus: s = "+/-"; break; - case DocSymbol::Times: c = '*'; break; - case DocSymbol::Minus: c = '-'; break; - case DocSymbol::CenterDot: c = '.'; break; - case DocSymbol::Partial: symbol = "partial"; break; - case DocSymbol::Nabla: symbol = "nabla"; break; - case DocSymbol::SquareRoot: symbol = "sqrt"; break; - case DocSymbol::Perpendicular: symbol = "perp"; break; - case DocSymbol::Sum: symbol = "sum"; break; - case DocSymbol::Integral: symbol = "int"; break; - case DocSymbol::Product: symbol = "prod"; break; - case DocSymbol::Similar: c = '~'; break; - case DocSymbol::Approx: symbol = "approx"; break; - case DocSymbol::NotEqual: s = "!="; break; - case DocSymbol::Equivalent: symbol = "equiv"; break; - case DocSymbol::Proportional: symbol = "propto"; break; - case DocSymbol::LessEqual: s = "<="; break; - case DocSymbol::GreaterEqual: s = ">="; break; - case DocSymbol::LeftArrow: s = "<-"; break; - case DocSymbol::RightArrow: s = "->"; break; - case DocSymbol::SetIn: symbol = "in"; break; - case DocSymbol::SetNotIn: symbol = "notin"; break; - case DocSymbol::LeftCeil: symbol = "lceil"; break; - case DocSymbol::RightCeil: symbol = "rceil"; break; - case DocSymbol::LeftFloor: symbol = "lfloor"; break; - case DocSymbol::RightFloor: symbol = "rfloor"; break; - case DocSymbol::Unknown: err("unknown symbol found\n"); - break; - } - if (c != 0) - { - enterText(); - m_output.add(c); - } - else if (s != 0) - { - enterText(); - m_output.add(s); - } - else if (symbol != 0) - { - leaveText(); - openItem("symbol"); - m_output.addFieldQuotedString("symbol", symbol); - closeItem(); - } - else if (accent != 0) + switch (res->type) + { + case DocSymbol::Perl_string: + enterText(); + m_output.add(res->symb); + break; + case DocSymbol::Perl_char: + enterText(); + m_output.add(res->symb[0]); + break; + case DocSymbol::Perl_symbol: + leaveText(); + openItem("symbol"); + m_output.addFieldQuotedString("symbol", res->symb); + closeItem(); + break; + default: + switch(res->type) + { + case DocSymbol::Perl_umlaut: + accent = "umlaut"; + break; + case DocSymbol::Perl_acute: + accent = "acute"; + break; + case DocSymbol::Perl_grave: + accent = "grave"; + break; + case DocSymbol::Perl_circ: + accent = "circ"; + break; + case DocSymbol::Perl_slash: + accent = "slash"; + break; + case DocSymbol::Perl_tilde: + accent = "tilde"; + break; + case DocSymbol::Perl_cedilla: + accent = "cedilla"; + break; + case DocSymbol::Perl_ring: + accent = "ring"; + break; + default: + break; + } + leaveText(); + if (accent) + { + openItem("accent"); + m_output + .addFieldQuotedString("accent", accent) + .addFieldQuotedChar("letter", res->symb[0]); + closeItem(); + } + break; + } + } + else { - leaveText(); - openItem("accent"); - m_output - .addFieldQuotedString("accent", accent) - .addFieldQuotedChar("letter", sy->letter()); - closeItem(); + err("perl: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(sy->symbol(),TRUE)); } } diff --git a/src/perlmodgen.h b/src/perlmodgen.h index 7f593b2..f908959 100644 --- a/src/perlmodgen.h +++ b/src/perlmodgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index 37929fc..ee4104e 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -21,6 +21,7 @@ #include <qglobal.h> #include "docvisitor.h" +#include "htmlentity.h" /*! Concrete visitor implementation for pretty printing */ class PrintDocVisitor : public DocVisitor @@ -56,106 +57,14 @@ class PrintDocVisitor : public DocVisitor void visit(DocSymbol *s) { indent_leaf(); - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->utf8(s->symbol(),TRUE); + if (res) { - case DocSymbol::BSlash: printf("\\"); break; - case DocSymbol::At: printf("@"); break; - case DocSymbol::Less: printf("<"); break; - case DocSymbol::Greater: printf(">"); break; - case DocSymbol::Amp: printf("&"); break; - case DocSymbol::Dollar: printf("$"); break; - case DocSymbol::Hash: printf("#"); break; - case DocSymbol::Percent: printf("%%"); break; - case DocSymbol::Pipe: printf("|"); break; - case DocSymbol::Copy: printf("©"); break; - case DocSymbol::Apos: printf("'"); break; - case DocSymbol::Quot: printf("\""); break; - case DocSymbol::Lsquo: printf("‘"); break; - case DocSymbol::Rsquo: printf("’"); break; - case DocSymbol::Ldquo: printf("“"); break; - case DocSymbol::Rdquo: printf("”"); break; - case DocSymbol::Ndash: printf("–"); break; - case DocSymbol::Mdash: printf("—"); break; - case DocSymbol::Uml: printf("&%cuml;",s->letter()); break; - case DocSymbol::Acute: printf("&%cacute;",s->letter()); break; - case DocSymbol::Grave: printf("&%cgrave;",s->letter()); break; - case DocSymbol::Circ: printf("&%ccirc;",s->letter()); break; - case DocSymbol::Tilde: printf("&%ctilde;",s->letter()); break; - case DocSymbol::Szlig: printf("ß"); break; - case DocSymbol::Cedil: printf("&%ccedul;",s->letter()); break; - case DocSymbol::Ring: printf("&%cring;",s->letter()); break; - case DocSymbol::Nbsp: printf(" "); break; - case DocSymbol::Aelig: printf("æ"); break; - case DocSymbol::AElig: printf("Æ"); break; - case DocSymbol::GrkGamma: printf("Γ"); break; - case DocSymbol::GrkDelta: printf("Δ"); break; - case DocSymbol::GrkTheta: printf("Θ"); break; - case DocSymbol::GrkLambda: printf("Λ"); break; - case DocSymbol::GrkXi: printf("Ξ"); break; - case DocSymbol::GrkPi: printf("Π"); break; - case DocSymbol::GrkSigma: printf("Σ"); break; - case DocSymbol::GrkUpsilon: printf("Υ"); break; - case DocSymbol::GrkPhi: printf("Φ"); break; - case DocSymbol::GrkPsi: printf("Ψ"); break; - case DocSymbol::GrkOmega: printf("Ω"); break; - case DocSymbol::Grkalpha: printf("α"); break; - case DocSymbol::Grkbeta: printf("β"); break; - case DocSymbol::Grkgamma: printf("γ"); break; - case DocSymbol::Grkdelta: printf("δ"); break; - case DocSymbol::Grkepsilon: printf("ε"); break; - case DocSymbol::Grkzeta: printf("ζ"); break; - case DocSymbol::Grketa: printf("η"); break; - case DocSymbol::Grktheta: printf("θ"); break; - case DocSymbol::Grkiota: printf("ι"); break; - case DocSymbol::Grkkappa: printf("κ"); break; - case DocSymbol::Grklambda: printf("λ"); break; - case DocSymbol::Grkmu: printf("μ"); break; - case DocSymbol::Grknu: printf("ν"); break; - case DocSymbol::Grkxi: printf("ξ"); break; - case DocSymbol::Grkpi: printf("π"); break; - case DocSymbol::Grkrho: printf("ρ"); break; - case DocSymbol::Grksigma: printf("σ"); break; - case DocSymbol::Grktau: printf("τ"); break; - case DocSymbol::Grkupsilon: printf("υ"); break; - case DocSymbol::Grkphi: printf("φ"); break; - case DocSymbol::Grkchi: printf("χ"); break; - case DocSymbol::Grkpsi: printf("ψ"); break; - case DocSymbol::Grkomega: printf("ω"); break; - case DocSymbol::Grkvarsigma: printf("ς"); break; - case DocSymbol::Section: printf("§"); break; - case DocSymbol::Degree: printf("°"); break; - case DocSymbol::Prime: printf("′"); break; - case DocSymbol::DoublePrime: printf("″"); break; - case DocSymbol::Infinity: printf("∞"); break; - case DocSymbol::EmptySet: printf("∅"); break; - case DocSymbol::PlusMinus: printf("±"); break; - case DocSymbol::Times: printf("×"); break; - case DocSymbol::Minus: printf("−"); break; - case DocSymbol::CenterDot: printf("⋅"); break; - case DocSymbol::Partial: printf("∂"); break; - case DocSymbol::Nabla: printf("∇"); break; - case DocSymbol::SquareRoot: printf("√"); break; - case DocSymbol::Perpendicular: printf("⊥"); break; - case DocSymbol::Sum: printf("∑"); break; - case DocSymbol::Integral: printf("∫"); break; - case DocSymbol::Product: printf("∏"); break; - case DocSymbol::Similar: printf("∼"); break; - case DocSymbol::Approx: printf("≈"); break; - case DocSymbol::NotEqual: printf("≠"); break; - case DocSymbol::Equivalent: printf("≡"); break; - case DocSymbol::Proportional: printf("∝"); break; - case DocSymbol::LessEqual: printf("≤"); break; - case DocSymbol::GreaterEqual: printf("≥"); break; - case DocSymbol::LeftArrow: printf("←"); break; - case DocSymbol::RightArrow: printf("→"); break; - case DocSymbol::SetIn: printf("∈"); break; - case DocSymbol::SetNotIn: printf("∉"); break; - case DocSymbol::LeftCeil: printf("⌈"); break; - case DocSymbol::RightCeil: printf("⌉"); break; - case DocSymbol::LeftFloor: printf("⌊"); break; - case DocSymbol::RightFloor: printf("⌋"); break; - default: - printf("unknown symbol found\n"); + printf("%s",res); + } + else + { + printf("print: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } void visit(DocURL *u) diff --git a/src/pycode.h b/src/pycode.h index 6382975..9b0dacb 100644 --- a/src/pycode.h +++ b/src/pycode.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pycode.l b/src/pycode.l index 8512711..585b587 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pyscanner.h b/src/pyscanner.h index 4b99706..e4e974f 100644 --- a/src/pyscanner.h +++ b/src/pyscanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pyscanner.l b/src/pyscanner.l index 671d330..d239d49 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/reflist.cpp b/src/reflist.cpp index 70bd9ba..ee6ac91 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/reflist.h b/src/reflist.h index 2fb25cf..97b1420 100644 --- a/src/reflist.h +++ b/src/reflist.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 7c2fef8..05c8247 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -32,6 +32,7 @@ #include "dia.h" #include "filedef.h" #include "config.h" +#include "htmlentity.h" //#define DBG_RTF(x) m_t << x #define DBG_RTF(x) do {} while(0) @@ -121,198 +122,14 @@ void RTFDocVisitor::visit(DocSymbol *s) { if (m_hide) return; DBG_RTF("{\\comment RTFDocVisitor::visit(DocSymbol)}\n"); - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->rtf(s->symbol()); + if (res) { - case DocSymbol::BSlash: m_t << "\\\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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 << "(C)"; break; - case DocSymbol::Tm: m_t << "(TM)"; break; - case DocSymbol::Reg: m_t << "(R)"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << "\""; break; - case DocSymbol::Lsquo: m_t << "`"; break; - case DocSymbol::Rsquo: m_t << "'"; break; - case DocSymbol::Ldquo: m_t << "\""; break; - case DocSymbol::Rdquo: m_t << "\""; break; - case DocSymbol::Ndash: m_t << "-"; break; - case DocSymbol::Mdash: m_t << "--"; break; - case DocSymbol::Uml: switch(s->letter()) - { - case 'A' : m_t << '\304'; break; - case 'E' : m_t << '\313'; break; - case 'I' : m_t << '\317'; break; - case 'O' : m_t << '\326'; break; - case 'U' : m_t << '\334'; break; - case 'Y' : m_t << 'Y'; break; - case 'a' : m_t << '\344'; break; - case 'e' : m_t << '\353'; break; - case 'i' : m_t << '\357'; break; - case 'o' : m_t << '\366'; break; - case 'u' : m_t << '\374'; break; - case 'y' : m_t << '\377'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Acute: switch(s->letter()) - { - case 'A' : m_t << '\301'; break; - case 'E' : m_t << '\311'; break; - case 'I' : m_t << '\315'; break; - case 'O' : m_t << '\323'; break; - case 'U' : m_t << '\332'; break; - case 'Y' : m_t << '\335'; break; - case 'a' : m_t << '\341'; break; - case 'e' : m_t << '\351'; break; - case 'i' : m_t << '\355'; break; - case 'o' : m_t << '\363'; break; - case 'u' : m_t << '\372'; break; - case 'y' : m_t << '\375'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Grave: switch(s->letter()) - { - case 'A' : m_t << '\300'; break; - case 'E' : m_t << '\310'; break; - case 'I' : m_t << '\314'; break; - case 'O' : m_t << '\322'; break; - case 'U' : m_t << '\331'; break; - case 'a' : m_t << '\340'; break; - case 'e' : m_t << '\350'; break; - case 'i' : m_t << '\354'; break; - case 'o' : m_t << '\362'; break; - case 'u' : m_t << '\371'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Circ: switch(s->letter()) - { - case 'A' : m_t << '\302'; break; - case 'E' : m_t << '\312'; break; - case 'I' : m_t << '\316'; break; - case 'O' : m_t << '\324'; break; - case 'U' : m_t << '\333'; break; - case 'a' : m_t << '\342'; break; - case 'e' : m_t << '\352'; break; - case 'i' : m_t << '\356'; break; - case 'o' : m_t << '\364'; break; - case 'u' : m_t << '\373'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Tilde: switch(s->letter()) - { - case 'A' : m_t << '\303'; break; - case 'N' : m_t << '\321'; break; - case 'O' : m_t << '\325'; break; - case 'a' : m_t << '\343'; break; - case 'n' : m_t << '\361'; break; - case 'o' : m_t << '\365'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Cedil: switch(s->letter()) - { - case 'C' : m_t << '\307'; break; - case 'c' : m_t << '\347'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Slash: switch(s->letter()) - { - case 'O' : m_t << '\330'; break; - case 'o' : m_t << '\370'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Ring: switch(s->letter()) - { - case 'A' : m_t << '\305'; break; - case 'a' : m_t << '\345'; break; - default: m_t << '?'; break; - } - break; - case DocSymbol::Szlig: m_t << "\337"; break; - case DocSymbol::Nbsp: m_t << "\\~ "; break; - case DocSymbol::Aelig: m_t << "\346"; break; - case DocSymbol::AElig: m_t << "\306"; 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 << "sigma "; break; - case DocSymbol::Section: m_t << "\247"; break; - case DocSymbol::Degree: m_t << "\260"; break; - case DocSymbol::Prime: m_t << "'"; break; - case DocSymbol::DoublePrime: m_t << "\""; break; - case DocSymbol::Infinity: m_t << "inf "; break; - case DocSymbol::EmptySet: m_t << "empty "; break; - case DocSymbol::PlusMinus: m_t << "\261"; break; - case DocSymbol::Times: m_t << "\327"; break; - case DocSymbol::Minus: m_t << "-"; break; - case DocSymbol::CenterDot: m_t << "."; break; - case DocSymbol::Partial: m_t << "partial "; break; - case DocSymbol::Nabla: m_t << "nabla "; break; - case DocSymbol::SquareRoot: m_t << "sqrt "; 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 << "~"; break; - case DocSymbol::Approx: m_t << "approx "; break; - case DocSymbol::NotEqual: m_t << "!="; break; - case DocSymbol::Equivalent: m_t << "equiv "; break; - case DocSymbol::Proportional: m_t << "propto "; break; - case DocSymbol::LessEqual: m_t << "<="; break; - case DocSymbol::GreaterEqual: m_t << ">="; break; - case DocSymbol::LeftArrow: m_t << "<-"; break; - case DocSymbol::RightArrow: m_t << "->"; break; - case DocSymbol::SetIn: m_t << "in "; 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("RTF: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } m_lastIsPara=FALSE; } diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h index 9572b73..efc9d21 100644 --- a/src/rtfdocvisitor.h +++ b/src/rtfdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 14110cb..8699c4e 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Parker Waechter & Dimitri van Heesch. + * Copyright (C) 1997-2014 by Parker Waechter & Dimitri van Heesch. * * Style sheet additions by Alexander Bartolich * diff --git a/src/rtfgen.h b/src/rtfgen.h index 6206311..7b31673 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Parker Waechter & Dimitri van Heesch. + * Copyright (C) 1997-2014 by Parker Waechter & Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfstyle.cpp b/src/rtfstyle.cpp index 2bede42..f44951a 100644 --- a/src/rtfstyle.cpp +++ b/src/rtfstyle.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfstyle.h b/src/rtfstyle.h index 52488f1..4f0a03f 100644 --- a/src/rtfstyle.h +++ b/src/rtfstyle.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/scanner.h b/src/scanner.h index 767fea0..8c8c3d9 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/scanner.l b/src/scanner.l index 9f163e2..dd72ee1 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 9c37ea2..7aa8216 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/searchindex.h b/src/searchindex.h index 2ce80e8..872c0d3 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/section.h b/src/section.h index 486656d..431c63b 100644 --- a/src/section.h +++ b/src/section.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/sortdict.h b/src/sortdict.h index fe51e24..f79a335 100644 --- a/src/sortdict.h +++ b/src/sortdict.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/sqlite3gen.cpp b/src/sqlite3gen.cpp index d4904cc..6f701e2 100644 --- a/src/sqlite3gen.cpp +++ b/src/sqlite3gen.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2012 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/sqlite3gen.h b/src/sqlite3gen.h index 689f1da..59664dd 100644 --- a/src/sqlite3gen.h +++ b/src/sqlite3gen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2012 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/store.cpp b/src/store.cpp index 7e5118a..8916015 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/store.h b/src/store.h index d075dc0..597ea63 100644 --- a/src/store.h +++ b/src/store.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tagreader.cpp b/src/tagreader.cpp index cbdf996..467781a 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tagreader.h b/src/tagreader.h index 73619db..1b5f7e3 100644 --- a/src/tagreader.h +++ b/src/tagreader.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tclscanner.h b/src/tclscanner.h index 02627b4..baa8e84 100644 --- a/src/tclscanner.h +++ b/src/tclscanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * Copyright (C) 2010-2011 by Rene Zaumseil * * Permission to use, copy, modify, and distribute this software and its diff --git a/src/template.cpp b/src/template.cpp index ea3c673..da4ff6a 100644 --- a/src/template.cpp +++ b/src/template.cpp @@ -504,6 +504,8 @@ class Operator not in ==, !=, <, >, <=, >= + +, - + *, /, % | : , @@ -511,7 +513,9 @@ class Operator enum Type { Or, And, Not, In, Equal, NotEqual, Less, Greater, LessEqual, - GreaterEqual, Filter, Colon, Comma, Last + GreaterEqual, Plus, Minus, Multiply, Divide, Modulo, Filter, Colon, Comma, + LeftParen, RightParen, + Last }; static const char *toString(Type op) @@ -528,9 +532,16 @@ class Operator case Greater: return ">"; case LessEqual: return "<="; case GreaterEqual: return ">="; + case Plus: return "+"; + case Minus: return "-"; + case Multiply: return "*"; + case Divide: return "/"; + case Modulo: return "%"; case Filter: return "|"; case Colon: return ":"; case Comma: return ","; + case LeftParen: return "("; + case RightParen: return ")"; case Last: return "?"; } return "?"; @@ -890,7 +901,7 @@ class ExprAstFunctionVariable : public ExprAst public: ExprAstFunctionVariable(ExprAst *var,const QList<ExprAst> &args) : m_var(var), m_args(args) - { TRACE(("ExprAstFunctionVariable(%s)\n",var->name().data())); + { TRACE(("ExprAstFunctionVariable()\n")); m_args.setAutoDelete(TRUE); } virtual TemplateVariant resolve(TemplateContext *c) @@ -982,6 +993,28 @@ class ExprAstNegate : public ExprAst ExprAst *m_expr; }; +class ExprAstUnary : public ExprAst +{ + public: + ExprAstUnary(Operator::Type op,ExprAst *exp) : m_operator(op), m_exp(exp) + { TRACE(("ExprAstUnary %s\n",Operator::toString(op))); } + ~ExprAstUnary() { delete m_exp; } + virtual TemplateVariant resolve(TemplateContext *c) + { + TemplateVariant exp = m_exp->resolve(c); + switch (m_operator) + { + case Operator::Minus: + return -exp.toInt(); + default: + return TemplateVariant(); + } + } + private: + Operator::Type m_operator; + ExprAst *m_exp; +}; + /** @brief Class representing a binary operator in the AST */ class ExprAstBinary : public ExprAst { @@ -992,6 +1025,7 @@ class ExprAstBinary : public ExprAst ~ExprAstBinary() { delete m_lhs; delete m_rhs; } virtual TemplateVariant resolve(TemplateContext *c) { + TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c); TemplateVariant lhs = m_lhs->resolve(c); TemplateVariant rhs = m_rhs ? m_rhs->resolve(c) : TemplateVariant(); switch(m_operator) @@ -1040,6 +1074,44 @@ class ExprAstBinary : public ExprAst { return lhs.toInt()>=rhs.toInt(); } + case Operator::Plus: + { + return TemplateVariant(lhs.toInt() + rhs.toInt()); + } + case Operator::Minus: + { + return TemplateVariant(lhs.toInt() - rhs.toInt()); + } + case Operator::Multiply: + { + return TemplateVariant(lhs.toInt() * rhs.toInt()); + } + case Operator::Divide: + { + int denom = rhs.toInt(); + if (denom!=0) + { + return TemplateVariant(lhs.toInt() / denom); + } + else // divide by zero + { + ci->warn(ci->templateName(),ci->line(),"division by zero while evaluating expression is undefined"); + return 0; + } + } + case Operator::Modulo: + { + int denom = rhs.toInt(); + if (denom!=0) + { + return TemplateVariant(lhs.toInt() % denom); + } + else // module zero + { + ci->warn(ci->templateName(),ci->line(),"modulo zero while evaluating expression is undefined"); + return 0; + } + } default: return TemplateVariant(); } @@ -1110,23 +1182,7 @@ class ExpressionParser if (expr==0) return 0; m_tokenStream = expr; getNextToken(); - return parseOrExpression(); - } - - ExprAst *parsePrimary(const char *expr) - { - if (expr==0) return 0; - m_tokenStream = expr; - getNextToken(); - return parsePrimaryExpression(); - } - - ExprAst *parseVariable(const char *varExpr) - { - if (varExpr==0) return 0; - m_tokenStream = varExpr; - getNextToken(); - return parseFilteredVariable(); + return parseExpression(); } private: @@ -1149,6 +1205,14 @@ class ExpressionParser Operator::Type op; }; + ExprAst *parseExpression() + { + TRACE(("{parseExpression(%s)\n",m_tokenStream)); + ExprAst *result = parseOrExpression(); + TRACE(("}parseExpression(%s)\n",m_tokenStream)); + return result; + } + ExprAst *parseOrExpression() { TRACE(("{parseOrExpression(%s)\n",m_tokenStream)); @@ -1212,7 +1276,7 @@ class ExpressionParser ExprAst *parseCompareExpression() { TRACE(("{parseCompareExpression(%s)\n",m_tokenStream)); - ExprAst *lhs = parsePrimaryExpression(); + ExprAst *lhs = parseAdditiveExpression(); if (lhs) { Operator::Type op = m_curToken.op; @@ -1235,6 +1299,74 @@ class ExpressionParser return lhs; } + ExprAst *parseAdditiveExpression() + { + TRACE(("{parseAdditiveExpression(%s)\n",m_tokenStream)); + ExprAst *lhs = parseMultiplicativeExpression(); + if (lhs) + { + while (m_curToken.type==ExprToken::Operator && + (m_curToken.op==Operator::Plus || m_curToken.op==Operator::Minus)) + { + Operator::Type op = m_curToken.op; + getNextToken(); + ExprAst *rhs = parseMultiplicativeExpression(); + lhs = new ExprAstBinary(op,lhs,rhs); + } + } + TRACE(("}parseAdditiveExpression(%s)\n",m_tokenStream)); + return lhs; + } + + ExprAst *parseMultiplicativeExpression() + { + TRACE(("{parseMultiplicativeExpression(%s)\n",m_tokenStream)); + ExprAst *lhs = parseUnaryExpression(); + if (lhs) + { + while (m_curToken.type==ExprToken::Operator && + (m_curToken.op==Operator::Multiply || m_curToken.op==Operator::Divide || m_curToken.op==Operator::Modulo)) + { + Operator::Type op = m_curToken.op; + getNextToken(); + ExprAst *rhs = parseUnaryExpression(); + lhs = new ExprAstBinary(op,lhs,rhs); + } + } + TRACE(("}parseMultiplicativeExpression(%s)\n",m_tokenStream)); + return lhs; + } + + ExprAst *parseUnaryExpression() + { + TRACE(("{parseUnaryExpression(%s)\n",m_tokenStream)); + ExprAst *result=0; + if (m_curToken.type==ExprToken::Operator) + { + if (m_curToken.op==Operator::Plus) + { + getNextToken(); + result = parsePrimaryExpression(); + } + else if (m_curToken.op==Operator::Minus) + { + getNextToken(); + ExprAst *rhs = parsePrimaryExpression(); + result = new ExprAstUnary(m_curToken.op,rhs); + } + else + { + result = parsePrimaryExpression(); + } + } + else + { + result = parsePrimaryExpression(); + } + TRACE(("}parseUnaryExpression(%s)\n",m_tokenStream)); + return result; + } + ExprAst *parsePrimaryExpression() { TRACE(("{parsePrimary(%s)\n",m_tokenStream)); @@ -1250,16 +1382,29 @@ class ExpressionParser case ExprToken::Literal: result = parseLiteral(); break; - default: - if (m_curToken.type==ExprToken::Operator) + case ExprToken::Operator: + if (m_curToken.op==Operator::LeftParen) { - warn(m_parser->templateName(),m_line,"unexpected operator '%s' in expression", - Operator::toString(m_curToken.op)); + getNextToken(); // skip over opening bracket + result = parseExpression(); + if (m_curToken.type!=ExprToken::Operator || + m_curToken.op!=Operator::RightParen) + { + warn(m_parser->templateName(),m_line,"missing closing parenthesis"); + } + else + { + getNextToken(); // skip over closing bracket + } } else { - warn(m_parser->templateName(),m_line,"unexpected token in expression"); + warn(m_parser->templateName(),m_line,"unexpected operator '%s' in expression", + Operator::toString(m_curToken.op)); } + break; + default: + warn(m_parser->templateName(),m_line,"unexpected token in expression"); } TRACE(("}parsePrimary(%s)\n",m_tokenStream)); return result; @@ -1364,141 +1509,179 @@ class ExpressionParser if (p==0 || *p=='\0') return FALSE; while (*p==' ') p++; // skip over spaces char c=*p; - if (strncmp(p,"not ",4)==0) - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Not; - p+=4; - } - else if (strncmp(p,"and ",4)==0) - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::And; - p+=4; - } - else if (strncmp(p,"or ",3)==0) - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Or; - p+=3; - } - else if (c=='=' && *(p+1)=='=') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Equal; - p+=2; - } - else if (c=='!' && *(p+1)=='=') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::NotEqual; - p+=2; - } - else if (c=='<' && *(p+1)=='=') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::LessEqual; - p+=2; - } - else if (c=='>' && *(p+1)=='=') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::GreaterEqual; - p+=2; - } - else if (c=='<') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Less; - p++; - } - else if (c=='>') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Greater; - p++; - } - else if (c=='|') - { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Filter; - p++; - } - else if (c==':') + const char *q = p; + switch (c) { - m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Colon; - p++; + case '=': + if (c=='=' && *(p+1)=='=') // equal + { + m_curToken.op = Operator::Equal; + p+=2; + } + break; + case '!': + if (c=='!' && *(p+1)=='=') // not equal + { + m_curToken.op = Operator::NotEqual; + p+=2; + } + break; + case '<': + if (c=='<' && *(p+1)=='=') // less or equal + { + m_curToken.op = Operator::LessEqual; + p+=2; + } + else // less + { + m_curToken.op = Operator::Less; + p++; + } + break; + case '>': + if (c=='>' && *(p+1)=='=') // greater or equal + { + m_curToken.op = Operator::GreaterEqual; + p+=2; + } + else // greater + { + m_curToken.op = Operator::Greater; + p++; + } + break; + case '(': + m_curToken.op = Operator::LeftParen; + p++; + break; + case ')': + m_curToken.op = Operator::RightParen; + p++; + break; + case '|': + m_curToken.op = Operator::Filter; + p++; + break; + case '+': + m_curToken.op = Operator::Plus; + p++; + break; + case '-': + m_curToken.op = Operator::Minus; + p++; + break; + case '*': + m_curToken.op = Operator::Multiply; + p++; + break; + case '/': + m_curToken.op = Operator::Divide; + p++; + break; + case '%': + m_curToken.op = Operator::Modulo; + p++; + break; + case ':': + m_curToken.op = Operator::Colon; + p++; + break; + case ',': + m_curToken.op = Operator::Comma; + p++; + break; + case 'n': + if (strncmp(p,"not ",4)==0) + { + m_curToken.op = Operator::Not; + p+=4; + } + break; + case 'a': + if (strncmp(p,"and ",4)==0) + { + m_curToken.op = Operator::And; + p+=4; + } + break; + case 'o': + if (strncmp(p,"or ",3)==0) + { + m_curToken.op = Operator::Or; + p+=3; + } + break; + default: + break; } - else if (c==',') + if (p!=q) // found an operator { m_curToken.type = ExprToken::Operator; - m_curToken.op = Operator::Comma; - p++; } - else if ((c=='-' && *(p+1)>='0' && *(p+1)<='9') || (c>='0' && c<='9')) + else // no token found yet { - m_curToken.type = ExprToken::Number; - const char *np = p; - if (c=='-') np++; - m_curToken.num = 0; - while (*np>='0' && *np<='9') - { - m_curToken.num*=10; - m_curToken.num+=*np-'0'; - np++; - } - if (c=='-') m_curToken.num=-m_curToken.num; - p=np; - } - else if (c=='_' || (c>='a' && c<='z') || (c>='A' && c<='Z')) - { - m_curToken.type = ExprToken::Identifier; - s[0]=c; - m_curToken.id = s; - p++; - while ((c=*p) && - (c=='_' || c=='.' || - (c>='a' && c<='z') || - (c>='A' && c<='Z') || - (c>='0' && c<='9')) - ) - { - s[0]=c; - m_curToken.id+=s; - p++; - } - if (m_curToken.id=="True") // treat true literal as numerical 1 - { - m_curToken.type = ExprToken::Number; - m_curToken.num = 1; - } - else if (m_curToken.id=="False") // treat false literal as numerical 0 + if (c>='0' && c<='9') // number? { m_curToken.type = ExprToken::Number; + const char *np = p; m_curToken.num = 0; + while (*np>='0' && *np<='9') + { + m_curToken.num*=10; + m_curToken.num+=*np-'0'; + np++; + } + p=np; } - } - else if (c=='"' || c=='\'') - { - m_curToken.type = ExprToken::Literal; - m_curToken.id.resize(0); - p++; - char tokenChar = c; - char cp=0; - while ((c=*p) && (c!=tokenChar || (c==tokenChar && cp=='\\'))) + else if (c=='_' || (c>='a' && c<='z') || (c>='A' && c<='Z')) // identifier? { + m_curToken.type = ExprToken::Identifier; s[0]=c; - if (c!='\\' || cp=='\\') // don't add escapes + m_curToken.id = s; + p++; + while ((c=*p) && + (c=='_' || c=='.' || + (c>='a' && c<='z') || + (c>='A' && c<='Z') || + (c>='0' && c<='9')) + ) { + s[0]=c; m_curToken.id+=s; + p++; } - cp=c; + if (m_curToken.id=="True") // treat true literal as numerical 1 + { + m_curToken.type = ExprToken::Number; + m_curToken.num = 1; + } + else if (m_curToken.id=="False") // treat false literal as numerical 0 + { + m_curToken.type = ExprToken::Number; + m_curToken.num = 0; + } + } + else if (c=='"' || c=='\'') // string literal + { + m_curToken.type = ExprToken::Literal; + m_curToken.id.resize(0); p++; + char tokenChar = c; + char cp=0; + while ((c=*p) && (c!=tokenChar || (c==tokenChar && cp=='\\'))) + { + s[0]=c; + if (c!='\\' || cp=='\\') // don't add escapes + { + m_curToken.id+=s; + } + cp=c; + p++; + } + if (*p==tokenChar) p++; } - if (*p==tokenChar) p++; } - else + if (p==q) // still no valid token found -> error { m_curToken.type = ExprToken::Unknown; char s[2]; @@ -1758,7 +1941,11 @@ class TemplateNodeVariable : public TemplateNode { TRACE(("TemplateNodeVariable(%s)\n",var.data())); ExpressionParser expParser(parser,line); - m_var = expParser.parseVariable(var); + m_var = expParser.parse(var); + if (m_var==0) + { + parser->warn(m_templateName,line,"invalid expression '%s' for variable",var.data()); + } } ~TemplateNodeVariable() { @@ -1769,19 +1956,22 @@ class TemplateNodeVariable : public TemplateNode { TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c); ci->setLocation(m_templateName,m_line); - TemplateVariant v = m_var->resolve(c); - if (v.type()==TemplateVariant::Function) - { - v = v.call(QValueList<TemplateVariant>()); - } - //printf("TemplateNodeVariable::render(%s) raw=%d\n",value.data(),v.raw()); - if (ci->escapeIntf() && !v.raw()) + if (m_var) { - ts << ci->escapeIntf()->escape(v.toString()); - } - else - { - ts << v.toString(); + TemplateVariant v = m_var->resolve(c); + if (v.type()==TemplateVariant::Function) + { + v = v.call(QValueList<TemplateVariant>()); + } + //printf("TemplateNodeVariable::render(%s) raw=%d\n",value.data(),v.raw()); + if (ci->escapeIntf() && !v.raw()) + { + ts << ci->escapeIntf()->escape(v.toString()); + } + else + { + ts << v.toString(); + } } } @@ -1832,6 +2022,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf> TemplateNodeIf(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) : TemplateNodeCreator<TemplateNodeIf>(parser,parent,line) { + m_ifGuardedNodes.setAutoDelete(TRUE); TRACE(("{TemplateNodeIf(%s)\n",data.data())); if (data.isEmpty()) { @@ -1839,15 +2030,37 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf> } QStrList stopAt; stopAt.append("endif"); + stopAt.append("elif"); stopAt.append("else"); - parser->parse(this,line,stopAt,m_trueNodes); - TemplateToken *tok = parser->takeNextToken(); + + // if 'nodes' + GuardedNodes *guardedNodes = new GuardedNodes; ExpressionParser ex(parser,line); - m_guardAst = ex.parse(data); + guardedNodes->line = line; + guardedNodes->guardAst = ex.parse(data); + parser->parse(this,line,stopAt,guardedNodes->trueNodes); + m_ifGuardedNodes.append(guardedNodes); + TemplateToken *tok = parser->takeNextToken(); + + // elif 'nodes' + while (tok && tok->data.left(5)=="elif ") + { + ExpressionParser ex(parser,line); + guardedNodes = new GuardedNodes; + guardedNodes->line = tok->line; + guardedNodes->guardAst = ex.parse(tok->data.mid(5)); + parser->parse(this,tok->line,stopAt,guardedNodes->trueNodes); + m_ifGuardedNodes.append(guardedNodes); + // proceed to the next token + delete tok; + tok = parser->takeNextToken(); + } + // else 'nodes' if (tok && tok->data=="else") { - stopAt.removeLast(); + stopAt.removeLast(); // remove "else" + stopAt.removeLast(); // remove "elif" parser->parse(this,line,stopAt,m_falseNodes); parser->removeNextToken(); // skip over endif } @@ -1856,7 +2069,6 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf> } ~TemplateNodeIf() { - delete m_guardAst; } void render(FTextStream &ts, TemplateContext *c) @@ -1864,22 +2076,41 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf> TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c); ci->setLocation(m_templateName,m_line); //printf("TemplateNodeIf::render #trueNodes=%d #falseNodes=%d\n",m_trueNodes.count(),m_falseNodes.count()); - if (m_guardAst) + bool processed=FALSE; + QListIterator<GuardedNodes> li(m_ifGuardedNodes); + GuardedNodes *nodes; + for (li.toFirst();(nodes=li.current()) && !processed;++li) { - TemplateVariant guardValue = m_guardAst->resolve(c); - if (guardValue.toBool()) // guard is true, render corresponding nodes + if (nodes->guardAst) { - m_trueNodes.render(ts,c); + TemplateVariant guardValue = nodes->guardAst->resolve(c); + if (guardValue.toBool()) // render nodes for the first guard that evaluated to 'true' + { + nodes->trueNodes.render(ts,c); + processed=TRUE; + } } - else // guard is false, render corresponding nodes + else { - m_falseNodes.render(ts,c); + ci->warn(m_templateName,nodes->line,"invalid expression for if/elif"); } } + if (!processed) + { + // all guards are false, render 'else' nodes + m_falseNodes.render(ts,c); + } } private: - ExprAst *m_guardAst; - TemplateNodeList m_trueNodes; + struct GuardedNodes + { + GuardedNodes() : guardAst(0) {} + ~GuardedNodes() { delete guardAst; } + int line; + ExprAst *guardAst; + TemplateNodeList trueNodes; + }; + QList<GuardedNodes> m_ifGuardedNodes; TemplateNodeList m_falseNodes; }; @@ -1893,7 +2124,7 @@ class TemplateNodeRepeat : public TemplateNodeCreator<TemplateNodeRepeat> { TRACE(("{TemplateNodeRepeat(%s)\n",data.data())); ExpressionParser expParser(parser,line); - m_expr = expParser.parseVariable(data); + m_expr = expParser.parse(data); QStrList stopAt; stopAt.append("endrepeat"); parser->parse(this,line,stopAt,m_repeatNodes); @@ -1938,6 +2169,176 @@ class TemplateNodeRepeat : public TemplateNodeCreator<TemplateNodeRepeat> //---------------------------------------------------------- +/** @brief Class representing a 'range' tag in a template */ +class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange> +{ + public: + TemplateNodeRange(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) + : TemplateNodeCreator<TemplateNodeRange>(parser,parent,line) + { + TRACE(("{TemplateNodeRange(%s)\n",data.data())); + QCString start,end; + int i1 = data.find(" from "); + int i2 = data.find(" to "); + int i3 = data.find(" downto "); + if (i1==-1) + { + if (data.right(5)==" from") + { + parser->warn(m_templateName,line,"range missing after 'from' keyword"); + } + else if (data=="from") + { + parser->warn(m_templateName,line,"range needs an iterator variable and a range"); + } + else + { + parser->warn(m_templateName,line,"range is missing 'from' keyword"); + } + } + else if (i2==-1 && i3==-1) + { + if (data.right(3)==" to") + { + parser->warn(m_templateName,line,"range is missing end value after 'to' keyword"); + } + else if (data.right(7)==" downto") + { + parser->warn(m_templateName,line,"range is missing end value after 'downto' keyword"); + } + else + { + parser->warn(m_templateName,line,"range is missing 'to' or 'downto' keyword"); + } + } + else + { + m_var = data.left(i1).stripWhiteSpace(); + if (m_var.isEmpty()) + { + parser->warn(m_templateName,line,"range needs an iterator variable"); + } + start = data.mid(i1+6,i2-i1-6).stripWhiteSpace(); + if (i2!=-1) + { + end = data.right(data.length()-i2-4).stripWhiteSpace(); + m_down = FALSE; + } + else if (i3!=-1) + { + end = data.right(data.length()-i3-8).stripWhiteSpace(); + m_down = TRUE; + } + } + ExpressionParser expParser(parser,line); + m_startExpr = expParser.parse(start); + m_endExpr = expParser.parse(end); + + QStrList stopAt; + stopAt.append("endrange"); + parser->parse(this,line,stopAt,m_loopNodes); + parser->removeNextToken(); // skip over endrange + TRACE(("}TemplateNodeRange(%s)\n",data.data())); + } + + ~TemplateNodeRange() + { + delete m_startExpr; + delete m_endExpr; + } + + void render(FTextStream &ts, TemplateContext *c) + { + TemplateContextImpl* ci = dynamic_cast<TemplateContextImpl*>(c); + ci->setLocation(m_templateName,m_line); + //printf("TemplateNodeRange::render #loopNodes=%d\n", + // m_loopNodes.count()); + if (m_startExpr && m_endExpr) + { + TemplateVariant vs = m_startExpr->resolve(c); + TemplateVariant ve = m_endExpr->resolve(c); + if (vs.type()==TemplateVariant::Integer && ve.type()==TemplateVariant::Integer) + { + int s = vs.toInt(); + int e = ve.toInt(); + int l = m_down ? s-e+1 : e-s+1; + if (l>0) + { + c->push(); + //int index = m_reversed ? list.count() : 0; + TemplateVariant v; + const TemplateVariant *parentLoop = c->getRef("forloop"); + uint index = 0; + int i = m_down ? e : s; + bool done=false; + while (!done) + { + // set the forloop meta-data variable + TemplateStruct s; + s.set("counter0", (int)index); + s.set("counter", (int)(index+1)); + s.set("revcounter", (int)(l-index)); + s.set("revcounter0", (int)(l-index-1)); + s.set("first",index==0); + s.set("last", (int)index==l-1); + s.set("parentloop",parentLoop ? *parentLoop : TemplateVariant()); + c->set("forloop",&s); + + // set the iterator variable + c->set(m_var,i); + + // render all items for this iteration of the loop + m_loopNodes.render(ts,c); + + index++; + if (m_down) + { + i--; + done = i<e; + } + else + { + i++; + done = i>e; + } + } + c->pop(); + } + else + { + ci->warn(m_templateName,m_line,"range %d %s %d is empty!", + s,m_down?"downto":"to",e); + } + } + else if (vs.type()!=TemplateVariant::Integer) + { + ci->warn(m_templateName,m_line,"range requires a start value of integer type!"); + } + else if (ve.type()!=TemplateVariant::Integer) + { + ci->warn(m_templateName,m_line,"range requires an end value of integer type!"); + } + } + else if (!m_startExpr) + { + ci->warn(m_templateName,m_line,"range has empty start value"); + } + else if (!m_endExpr) + { + ci->warn(m_templateName,m_line,"range has empty end value"); + } + } + + private: + bool m_down; + ExprAst *m_startExpr; + ExprAst *m_endExpr; + QCString m_var; + TemplateNodeList m_loopNodes; +}; + +//---------------------------------------------------------- + /** @brief Class representing a 'for' tag in a template */ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor> { @@ -1985,7 +2386,7 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor> } } ExpressionParser expParser(parser,line); - m_expr = expParser.parseVariable(exprStr); + m_expr = expParser.parse(exprStr); QStrList stopAt; stopAt.append("endfor"); @@ -2215,7 +2616,7 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend> { parser->warn(m_templateName,line,"extend tag is missing template file argument"); } - m_extendExpr = ep.parsePrimary(data); + m_extendExpr = ep.parse(data); QStrList stopAt; parser->parse(this,line,stopAt,m_nodes); TRACE(("}TemplateNodeExtend(%s)\n",data.data())); @@ -2298,7 +2699,7 @@ class TemplateNodeInclude : public TemplateNodeCreator<TemplateNodeInclude> { parser->warn(m_templateName,line,"include tag is missing template file argument"); } - m_includeExpr = ep.parsePrimary(data); + m_includeExpr = ep.parse(data); } ~TemplateNodeInclude() { @@ -2374,8 +2775,8 @@ class TemplateNodeCreate : public TemplateNodeCreator<TemplateNodeCreate> else { ExpressionParser ep(parser,line); - m_fileExpr = ep.parsePrimary(data.left(i).stripWhiteSpace()); - m_templateExpr = ep.parsePrimary(data.mid(i+6).stripWhiteSpace()); + m_fileExpr = ep.parse(data.left(i).stripWhiteSpace()); + m_templateExpr = ep.parse(data.mid(i+6).stripWhiteSpace()); } } ~TemplateNodeCreate() @@ -2461,7 +2862,7 @@ class TemplateNodeTree : public TemplateNodeCreator<TemplateNodeTree> { parser->warn(m_templateName,line,"recursetree tag is missing data argument"); } - m_treeExpr = ep.parsePrimary(data); + m_treeExpr = ep.parse(data); QStrList stopAt; stopAt.append("endrecursetree"); parser->parse(this,line,stopAt,m_treeNodes); @@ -2569,7 +2970,7 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith> int j=arg.find('='); if (j>0) { - ExprAst *expr = expParser.parsePrimary(arg.mid(j+1)); + ExprAst *expr = expParser.parse(arg.mid(j+1)); if (expr) { m_args.append(new Mapping(arg.left(j),expr)); @@ -2627,7 +3028,7 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle> QValueListIterator<QCString> it = args.begin(); while (it!=args.end()) { - ExprAst *expr = expParser.parsePrimary(*it); + ExprAst *expr = expParser.parse(*it); if (expr) { m_args.append(expr); @@ -2697,7 +3098,7 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet> int j=arg.find('='); if (j>0) { - ExprAst *expr = expParser.parsePrimary(arg.mid(j+1)); + ExprAst *expr = expParser.parse(arg.mid(j+1)); if (expr) { m_args.append(new Mapping(arg.left(j),expr)); @@ -2776,8 +3177,8 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers> { ExpressionParser expParser(parser,line); m_var = data.left(i); - m_listExpr = expParser.parseVariable(data.mid(i+4,w-i-4)); - m_patternExpr = expParser.parseVariable(data.right(data.length()-w-6)); + m_listExpr = expParser.parse(data.mid(i+4,w-i-4)); + m_patternExpr = expParser.parse(data.right(data.length()-w-6)); } QStrList stopAt; stopAt.append("endmarkers"); @@ -2910,6 +3311,7 @@ static TemplateNodeFactory::AutoRegister<TemplateNodeTree> autoRefTree("rec static TemplateNodeFactory::AutoRegister<TemplateNodeWith> autoRefWith("with"); static TemplateNodeFactory::AutoRegister<TemplateNodeBlock> autoRefBlock("block"); static TemplateNodeFactory::AutoRegister<TemplateNodeCycle> autoRefCycle("cycle"); +static TemplateNodeFactory::AutoRegister<TemplateNodeRange> autoRefRange("range"); static TemplateNodeFactory::AutoRegister<TemplateNodeExtend> autoRefExtend("extend"); static TemplateNodeFactory::AutoRegister<TemplateNodeCreate> autoRefCreate("create"); static TemplateNodeFactory::AutoRegister<TemplateNodeRepeat> autoRefRepeat("repeat"); @@ -3284,7 +3686,8 @@ void TemplateParser::parse( command=="endblock" || command=="endwith" || command=="endrecursetree" || command=="endspaceless" || command=="endmarkers" || command=="endmsg" || - command=="endrepeat") + command=="endrepeat" || command=="elif" || + command=="endrange") { warn(m_templateName,tok->line,"Found tag '%s' without matching start tag",command.data()); } diff --git a/src/textdocvisitor.cpp b/src/textdocvisitor.cpp index 9275846..6f3151f 100644 --- a/src/textdocvisitor.cpp +++ b/src/textdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -19,115 +19,21 @@ #include <qdir.h> #include "textdocvisitor.h" #include "message.h" +#include "util.h" +#include "htmlentity.h" //------------------------------------------------------------------------- void TextDocVisitor::visit(DocSymbol *s) { - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->html(s->symbol()); + if (res) { - case DocSymbol::BSlash: m_t << "\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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 << "©"; break; - case DocSymbol::Tm: m_t << "&tm;"; break; - case DocSymbol::Reg: m_t << "®"; break; - case DocSymbol::Apos: m_t << "'"; break; - case DocSymbol::Quot: m_t << "\""; break; - case DocSymbol::Lsquo: m_t << "‘"; break; - case DocSymbol::Rsquo: m_t << "’"; break; - case DocSymbol::Ldquo: m_t << "“"; break; - case DocSymbol::Rdquo: m_t << "”"; break; - case DocSymbol::Ndash: m_t << "–"; break; - case DocSymbol::Mdash: m_t << "—"; 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 << "ß"; break; - case DocSymbol::Cedil: m_t << "&" << s->letter() << "cedil;"; break; - case DocSymbol::Ring: m_t << "&" << s->letter() << "ring;"; break; - case DocSymbol::Nbsp: m_t << " "; break; - case DocSymbol::Aelig: m_t << "æ"; break; - case DocSymbol::AElig: m_t << "Æ"; break; - case DocSymbol::GrkGamma: m_t << "Γ"; break; - case DocSymbol::GrkDelta: m_t << "Δ"; break; - case DocSymbol::GrkTheta: m_t << "Θ"; break; - case DocSymbol::GrkLambda: m_t << "Λ"; break; - case DocSymbol::GrkXi: m_t << "Ξ"; break; - case DocSymbol::GrkPi: m_t << "Π"; break; - case DocSymbol::GrkSigma: m_t << "Σ"; break; - case DocSymbol::GrkUpsilon: m_t << "Υ"; break; - case DocSymbol::GrkPhi: m_t << "Φ"; break; - case DocSymbol::GrkPsi: m_t << "Ψ"; break; - case DocSymbol::GrkOmega: m_t << "Ω"; break; - case DocSymbol::Grkalpha: m_t << "α"; break; - case DocSymbol::Grkbeta: m_t << "β"; break; - case DocSymbol::Grkgamma: m_t << "γ"; break; - case DocSymbol::Grkdelta: m_t << "δ"; break; - case DocSymbol::Grkepsilon: m_t << "ε"; break; - case DocSymbol::Grkzeta: m_t << "ζ"; break; - case DocSymbol::Grketa: m_t << "η"; break; - case DocSymbol::Grktheta: m_t << "θ"; break; - case DocSymbol::Grkiota: m_t << "ι"; break; - case DocSymbol::Grkkappa: m_t << "κ"; break; - case DocSymbol::Grklambda: m_t << "λ"; break; - case DocSymbol::Grkmu: m_t << "μ"; break; - case DocSymbol::Grknu: m_t << "ν"; break; - case DocSymbol::Grkxi: m_t << "ξ"; break; - case DocSymbol::Grkpi: m_t << "π"; break; - case DocSymbol::Grkrho: m_t << "ρ"; break; - case DocSymbol::Grksigma: m_t << "σ"; break; - case DocSymbol::Grktau: m_t << "τ"; break; - case DocSymbol::Grkupsilon: m_t << "υ"; break; - case DocSymbol::Grkphi: m_t << "φ"; break; - case DocSymbol::Grkchi: m_t << "χ"; break; - case DocSymbol::Grkpsi: m_t << "ψ"; break; - case DocSymbol::Grkomega: m_t << "ω"; break; - case DocSymbol::Grkvarsigma: m_t << "ς"; break; - case DocSymbol::Section: m_t << "§"; break; - case DocSymbol::Degree: m_t << "°"; break; - case DocSymbol::Prime: m_t << "′"; break; - case DocSymbol::DoublePrime: m_t << "″"; break; - case DocSymbol::Infinity: m_t << "∞"; break; - case DocSymbol::EmptySet: m_t << "∅"; break; - case DocSymbol::PlusMinus: m_t << "±"; break; - case DocSymbol::Times: m_t << "×"; break; - case DocSymbol::Minus: m_t << "−"; break; - case DocSymbol::CenterDot: m_t << "⋅"; break; - case DocSymbol::Partial: m_t << "∂"; break; - case DocSymbol::Nabla: m_t << "∇"; break; - case DocSymbol::SquareRoot: m_t << "√"; break; - case DocSymbol::Perpendicular: m_t << "⊥"; break; - case DocSymbol::Sum: m_t << "∑"; break; - case DocSymbol::Integral: m_t << "∫"; break; - case DocSymbol::Product: m_t << "∏"; break; - case DocSymbol::Similar: m_t << "∼"; break; - case DocSymbol::Approx: m_t << "≈"; break; - case DocSymbol::NotEqual: m_t << "≠"; break; - case DocSymbol::Equivalent: m_t << "≡"; break; - case DocSymbol::Proportional: m_t << "∝"; break; - case DocSymbol::LessEqual: m_t << "≤"; break; - case DocSymbol::GreaterEqual: m_t << "≥"; break; - case DocSymbol::LeftArrow: m_t << "←"; break; - case DocSymbol::RightArrow: m_t << "→"; break; - case DocSymbol::SetIn: m_t << "∈"; break; - case DocSymbol::SetNotIn: m_t << "∉"; break; - case DocSymbol::LeftCeil: m_t << "⌈"; break; - case DocSymbol::RightCeil: m_t << "⌉"; break; - case DocSymbol::LeftFloor: m_t << "⌊"; break; - case DocSymbol::RightFloor: m_t << "⌋"; break; - default: - err("unknown symbol found\n"); + m_t << res; + } + else + { + err("text: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } diff --git a/src/textdocvisitor.h b/src/textdocvisitor.h index 9045d21..b17065d 100644 --- a/src/textdocvisitor.h +++ b/src/textdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tooltip.cpp b/src/tooltip.cpp index 041aa16..8085bff 100644 --- a/src/tooltip.cpp +++ b/src/tooltip.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tooltip.h b/src/tooltip.h index b4a4af4..ea8948d 100644 --- a/src/tooltip.h +++ b/src/tooltip.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator.h b/src/translator.h index 49a8135..32eaf09 100644 --- a/src/translator.h +++ b/src/translator.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_am.h b/src/translator_am.h index fd8b1dd..9eaba0e 100644 --- a/src/translator_am.h +++ b/src/translator_am.h @@ -2,7 +2,7 @@ *
*
*
- * Copyright (C) 1997-2013 by Dimitri van Heesch.
+ * Copyright (C) 1997-2014 by Dimitri van Heesch.
*
* Permission to use, copy, modify, and distribute this software and its
* documentation under the terms of the GNU General Public License is hereby
diff --git a/src/translator_ar.h b/src/translator_ar.h index 143170d..5d37b69 100644 --- a/src/translator_ar.h +++ b/src/translator_ar.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_br.h b/src/translator_br.h index f9dba84..b381495 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ca.h b/src/translator_ca.h index 1291a8c..5c3e595 100644 --- a/src/translator_ca.h +++ b/src/translator_ca.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_cn.h b/src/translator_cn.h index f8e03c5..fc01ce0 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_cz.h b/src/translator_cz.h index 2793519..b83eb92 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_de.h b/src/translator_de.h index d13d99c..d936bf1 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_dk.h b/src/translator_dk.h index 16ffae4..74b07f4 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_en.h b/src/translator_en.h index 0535b6b..8de7f8e 100644 --- a/src/translator_en.h +++ b/src/translator_en.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_eo.h b/src/translator_eo.h index 3c5b9a5..e1513cb 100644 --- a/src/translator_eo.h +++ b/src/translator_eo.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_es.h b/src/translator_es.h index d6738e0..ba6e823 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_fa.h b/src/translator_fa.h index bcc0572..7b6f9d7 100644 --- a/src/translator_fa.h +++ b/src/translator_fa.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_fi.h b/src/translator_fi.h index fa42259..eeeb9a5 100644 --- a/src/translator_fi.h +++ b/src/translator_fi.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_fr.h b/src/translator_fr.h index 28468e7..2c548c2 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_gr.h b/src/translator_gr.h index 1523445..fa7a682 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_hr.h b/src/translator_hr.h index 5c79f61..70dba21 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_hu.h b/src/translator_hu.h index 157247c..610af8e 100644 --- a/src/translator_hu.h +++ b/src/translator_hu.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_id.h b/src/translator_id.h index 7ecdbe7..5647bc0 100644 --- a/src/translator_id.h +++ b/src/translator_id.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_it.h b/src/translator_it.h index 912f389..59799a3 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_je.h b/src/translator_je.h index 894452a..4dbcb4e 100644 --- a/src/translator_je.h +++ b/src/translator_je.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_jp.h b/src/translator_jp.h index febf353..ae3605a 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ke.h b/src/translator_ke.h index 357465d..56a70b3 100644 --- a/src/translator_ke.h +++ b/src/translator_ke.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_kr.h b/src/translator_kr.h index 348fa10..6919763 100644 --- a/src/translator_kr.h +++ b/src/translator_kr.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_lt.h b/src/translator_lt.h index 9edbe57..000dc6e 100644 --- a/src/translator_lt.h +++ b/src/translator_lt.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_lv.h b/src/translator_lv.h index 054310c..135cd11 100644 --- a/src/translator_lv.h +++ b/src/translator_lv.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2012 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_mk.h b/src/translator_mk.h index b753756..510561e 100644 --- a/src/translator_mk.h +++ b/src/translator_mk.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_nl.h b/src/translator_nl.h index 2525b4f..2ffacb6 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_no.h b/src/translator_no.h index 3d20f08..2662e47 100644 --- a/src/translator_no.h +++ b/src/translator_no.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_pl.h b/src/translator_pl.h index d819f66..6f2e14c 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_pt.h b/src/translator_pt.h index 8e91181..95a62b0 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ro.h b/src/translator_ro.h index 9bbadeb..ea0988d 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ru.h b/src/translator_ru.h index 07aa63b..ce6335d 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_sc.h b/src/translator_sc.h index af2d7df..84e8756 100644 --- a/src/translator_sc.h +++ b/src/translator_sc.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_si.h b/src/translator_si.h index 57ca5c4..33bc27a 100644 --- a/src/translator_si.h +++ b/src/translator_si.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_sk.h b/src/translator_sk.h index 8c51147..0fc826b 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_sr.h b/src/translator_sr.h index 11ebac2..f58ac13 100644 --- a/src/translator_sr.h +++ b/src/translator_sr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_sv.h b/src/translator_sv.h index 4ef2bc4..f4d0a35 100644 --- a/src/translator_sv.h +++ b/src/translator_sv.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -21,6 +21,7 @@ Svensk översättning av: Samuel Hägglund <sahag96@ite.mh.se> Xet Erixon <xet@xeqt.com> Mikael Hallin <mikaelhallin@yahoo.se> 2003-07-28 +Björn Palmqvist <bjorn@aidium.se> 2014-02-01 ================================================================================== Uppdateringar. 1999/04/29 @@ -69,7 +70,7 @@ Problem! #ifndef TRANSLATOR_SE_H #define TRANSLATOR_SE_H -class TranslatorSwedish : public TranslatorAdapter_1_6_0 +class TranslatorSwedish : public Translator { public: @@ -389,7 +390,7 @@ class TranslatorSwedish : public TranslatorAdapter_1_6_0 { return "Dokumentation över typdefinitioner"; } virtual QCString trEnumerationTypeDocumentation() - { return "Dokumentation över egenuppräknande typer"; } + { return "Dokumentation över egenuppräknande typer"; ; } virtual QCString trFunctionDocumentation() { return "Dokumentation över funktioner"; } @@ -1085,7 +1086,7 @@ class TranslatorSwedish : public TranslatorAdapter_1_6_0 */ virtual QCString trNamespace(bool first_capital, bool singular) { - QCString result((first_capital ? "Namnrymd" : "namnrynd")); + QCString result((first_capital ? "Namnrymd" : "namnrymd")); if (!singular) result+="er"; return result; } @@ -1604,6 +1605,262 @@ class TranslatorSwedish : public TranslatorAdapter_1_6_0 { return "Typbegränsningar"; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.6.0 (mainly for the new search engine) +////////////////////////////////////////////////////////////////////////// + + /*! directory relation for \a name */ + virtual QCString trDirRelation(const char *name) + { + return QCString(name)+" Relation"; + } + + /*! Loading message shown when loading search results */ + virtual QCString trLoading() + { + return "Laddar..."; + } + + /*! Label used for search results in the global namespace */ + virtual QCString trGlobalNamespace() + { + return "Globalnamnrymd"; + } + + /*! Message shown while searching */ + virtual QCString trSearching() + { + return "Söker..."; + } + + /*! Text shown when no search results are found */ + virtual QCString trNoMatches() + { + return "Inga träffar"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.6.3 (missing items for the directory pages) +////////////////////////////////////////////////////////////////////////// + + /*! when clicking a directory dependency label, a page with a + * table is shown. The heading for the first column mentions the + * source file that has a relation to another file. + */ + virtual QCString trFileIn(const char *name) + { + return (QCString)"Fil i "+name; + } + + /*! when clicking a directory dependency label, a page with a + * table is shown. The heading for the second column mentions the + * destination file that is included. + */ + virtual QCString trIncludesFileIn(const char *name) + { + return (QCString)"Inkluderar fil i "+name; + } + + /** Compiles a date string. + * @param year Year in 4 digits + * @param month Month of the year: 1=January + * @param day Day of the Month: 1..31 + * @param dayOfWeek Day of the week: 1=Monday..7=Sunday + * @param hour Hour of the day: 0..23 + * @param minutes Minutes in the hour: 0..59 + * @param seconds Seconds within the minute: 0..59 + * @param includeTime Include time in the result string? + */ + virtual QCString trDateTime(int year,int month,int day,int dayOfWeek, + int hour,int minutes,int seconds, + bool includeTime) + { + static const char *days[] = { "Mån","Tis","Ons","Tor","Fre","Lör","Sön" }; + static const char *months[] = { "Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Oct","Nov","Dec" }; + QCString sdate; + sdate.sprintf("%s %d %s %d",days[dayOfWeek-1],day,months[month-1],year); + if (includeTime) + { + QCString stime; + stime.sprintf(" %.2d:%.2d:%.2d",hour,minutes,seconds); + sdate+=stime; + } + return sdate; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.7.5 +////////////////////////////////////////////////////////////////////////// + + /*! Header for the page with bibliographic citations */ + virtual QCString trCiteReferences() + { return "Bibliografiska Referenser"; } + + /*! Text for copyright paragraph */ + virtual QCString trCopyright() + { return "Copyright"; } + + /*! Header for the graph showing the directory dependencies */ + virtual QCString trDirDepGraph(const char *name) + { return QCString("Katalogberoendegraf för ")+name+":"; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.0 +////////////////////////////////////////////////////////////////////////// + + /*! Detail level selector shown for hierarchical indices */ + virtual QCString trDetailLevel() + { return "detaljnivå"; } + + /*! Section header for list of template parameters */ + virtual QCString trTemplateParameters() + { return "Mall Parametrar"; } + + /*! Used in dot graph when UML_LOOK is enabled and there are many fields */ + virtual QCString trAndMore(const QCString &number) + { return "och "+number+" mera..."; } + + /*! Used file list for a Java enum */ + virtual QCString trEnumGeneratedFromFiles(bool single) + { QCString result = "Dokumentationen för denna enum var genererad från föjlande fil"; + if (!single) result += "er"; + result+=":"; + return result; + } + + /*! Header of a Java enum page (Java enums are represented as classes). */ + virtual QCString trEnumReference(const char *name) + { return QCString(name)+" Enum Referens"; } + + /*! Used for a section containing inherited members */ + virtual QCString trInheritedFrom(const char *members,const char *what) + { return QCString(members)+" ärvd ifrån "+what; } + + /*! Header of the sections with inherited members specific for the + * base class(es) + */ + virtual QCString trAdditionalInheritedMembers() + { return "Ytterliga Ärvda Medlemmar"; } + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.2 +////////////////////////////////////////////////////////////////////////// + + /*! Used as a tooltip for the toggle button that appears in the + * navigation tree in the HTML output when GENERATE_TREEVIEW is + * enabled. This tooltip explains the meaning of the button. + */ + virtual QCString trPanelSynchronisationTooltip(bool enable) + { + QCString opt = enable ? "aktivera" : "inaktivera"; + return "klicka för att "+opt+" panel synkronisering"; + } + + /*! Used in a method of an Objective-C class that is declared in a + * a category. Note that the @1 marker is required and is replaced + * by a link. + */ + virtual QCString trProvidedByCategory() + { + return "Tillhandahålls av kategori @1."; + } + + /*! Used in a method of an Objective-C category that extends a class. + * Note that the @1 marker is required and is replaced by a link to + * the class method. + */ + virtual QCString trExtendsClass() + { + return "Utökar klass @1."; + } + + /*! Used as the header of a list of class methods in Objective-C. + * These are similar to static public member functions in C++. + */ + virtual QCString trClassMethods() + { + return "Klassmetoder"; + } + + /*! Used as the header of a list of instance methods in Objective-C. + * These are similar to public member functions in C++. + */ + virtual QCString trInstanceMethods() + { + return "Instansmetoder"; + } + + /*! Used as the header of the member functions of an Objective-C class. + */ + virtual QCString trMethodDocumentation() + { + return "Metoddokumentation"; + } + + /*! Used as the title of the design overview picture created for the + * VHDL output. + */ + virtual QCString trDesignOverview() + { + return "Designöversikt"; + } + +////////////////////////////////////////////////////////////////////////// +// new since 1.8.4 +////////////////////////////////////////////////////////////////////////// + + /** old style UNO IDL services: implemented interfaces */ + virtual QCString trInterfaces() + { return "Exporterade Interface"; } + + /** old style UNO IDL services: inherited services */ + virtual QCString trServices() + { return "Inkuderade Tjänster"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroups() + { return "Konstant Grupper"; } + + /** UNO IDL constant groups */ + virtual QCString trConstantGroupReference(const char *namespaceName) + { + QCString result=namespaceName; + result+=" Konstant Grupp Referens"; + return result; + } + /** UNO IDL service page title */ + virtual QCString trServiceReference(const char *sName) + { + QCString result=(QCString)sName; + result+=" Tjänstereferens"; + return result; + } + /** UNO IDL singleton page title */ + virtual QCString trSingletonReference(const char *sName) + { + QCString result=(QCString)sName; + result+=" Singleton Referens"; + return result; + } + /** UNO IDL service page */ + virtual QCString trServiceGeneratedFromFiles(bool single) + { + // single is true implies a single file + QCString result=(QCString)"Dokumentationen för denna tjänst " + "genererades från följande fil"; + if (single) result+=":"; else result+="er:"; + return result; + } + /** UNO IDL singleton page */ + virtual QCString trSingletonGeneratedFromFiles(bool single) + { + // single is true implies a single file + QCString result=(QCString)"Dokumentationen för denna singleton" + "genererades från följande fil"; + if (single) result+=":"; else result+="er:"; + return result; + } /*---------- For internal use: ----------------------------------------*/ protected: diff --git a/src/translator_tr.h b/src/translator_tr.h index 2dbfcd8..56b4a19 100644 --- a/src/translator_tr.h +++ b/src/translator_tr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_tw.h b/src/translator_tw.h index 86e0a02..581d7fe 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ua.h b/src/translator_ua.h index 9c89c40..b7ca86a 100644 --- a/src/translator_ua.h +++ b/src/translator_ua.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_vi.h b/src/translator_vi.h index 6657c6b..54c68b8 100644 --- a/src/translator_vi.h +++ b/src/translator_vi.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_za.h b/src/translator_za.h index 184eaa9..f47052e 100644 --- a/src/translator_za.h +++ b/src/translator_za.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/types.h b/src/types.h index 0c269be..a05a72d 100644 --- a/src/types.h +++ b/src/types.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/util.cpp b/src/util.cpp index 91f6fda..cf2d6b9 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1,8 +1,7 @@ /***************************************************************************** - * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -61,6 +60,7 @@ #include "filename.h" #include "membergroup.h" #include "dirdef.h" +#include "htmlentity.h" #define ENABLE_TRACINGSUPPORT 0 @@ -5677,146 +5677,8 @@ QCString convertToJSString(const char *s) QCString convertCharEntitiesToUTF8(const QCString &s) { - static QDict<char> entityMap(127); - static bool init=TRUE; QCString result; - static QRegExp entityPat("&[a-zA-Z]+;"); - - if (init) - { - entityMap.insert("copy", "\xC2\xA9"); - entityMap.insert("tm", "\xE2\x84\xA2"); - entityMap.insert("trade", "\xE2\x84\xA2"); - entityMap.insert("reg", "\xC2\xAE"); - entityMap.insert("lsquo", "\xE2\x80\x98"); - entityMap.insert("rsquo", "\xE2\x80\x99"); - entityMap.insert("ldquo", "\xE2\x80\x9C"); - entityMap.insert("rdquo", "\xE2\x80\x9D"); - entityMap.insert("ndash", "\xE2\x80\x93"); - entityMap.insert("mdash", "\xE2\x80\x94"); - entityMap.insert("Auml", "\xC3\x84"); - entityMap.insert("Euml", "\xC3\x8B"); - entityMap.insert("Iuml", "\xC3\x8F"); - entityMap.insert("Ouml", "\xC3\x96"); - entityMap.insert("Uuml", "\xC3\x9C"); - entityMap.insert("Yuml", "\xC5\xB8"); - entityMap.insert("auml", "\xC3\xA4"); - entityMap.insert("euml", "\xC3\xAB"); - entityMap.insert("iuml", "\xC3\xAF"); - entityMap.insert("ouml", "\xC3\xB6"); - entityMap.insert("uuml", "\xC3\xBC"); - entityMap.insert("yuml", "\xC3\xBF"); - entityMap.insert("Aacute", "\xC3\x81"); - entityMap.insert("Eacute", "\xC3\x89"); - entityMap.insert("Iacute", "\xC3\x8D"); - entityMap.insert("Oacute", "\xC3\x93"); - entityMap.insert("Uacute", "\xC3\x9A"); - entityMap.insert("aacute", "\xC3\xA1"); - entityMap.insert("eacute", "\xC3\xA9"); - entityMap.insert("iacute", "\xC3\xAD"); - entityMap.insert("oacute", "\xC3\xB3"); - entityMap.insert("uacute", "\xC3\xBA"); - entityMap.insert("Agrave", "\xC3\x80"); - entityMap.insert("Egrave", "\xC3\x88"); - entityMap.insert("Igrave", "\xC3\x8C"); - entityMap.insert("Ograve", "\xC3\x92"); - entityMap.insert("Ugrave", "\xC3\x99"); - entityMap.insert("agrave", "\xC3\xA0"); - entityMap.insert("egrave", "\xC3\xA8"); - entityMap.insert("igrave", "\xC3\xAC"); - entityMap.insert("ograve", "\xC3\xB2"); - entityMap.insert("ugrave", "\xC3\xB9"); - entityMap.insert("Acirc", "\xC3\x82"); - entityMap.insert("Ecirc", "\xC3\x8A"); - entityMap.insert("Icirc", "\xC3\x8E"); - entityMap.insert("Ocirc", "\xC3\x94"); - entityMap.insert("Ucirc", "\xC3\x9B"); - entityMap.insert("acirc", "\xC3\xA2"); - entityMap.insert("ecirc", "\xC3\xAA"); - entityMap.insert("icirc", "\xC3\xAE"); - entityMap.insert("ocirc", "\xC3\xB4"); - entityMap.insert("ucirc", "\xC3\xBB"); - entityMap.insert("Atilde", "\xC3\x83"); - entityMap.insert("Ntilde", "\xC3\x91"); - entityMap.insert("Otilde", "\xC3\x95"); - entityMap.insert("atilde", "\xC3\xA3"); - entityMap.insert("ntilde", "\xC3\xB1"); - entityMap.insert("otilde", "\xC3\xB5"); - entityMap.insert("szlig", "\xC3\x9F"); - entityMap.insert("Ccedil", "\xC3\x87"); - entityMap.insert("ccedil", "\xC3\xA7"); - entityMap.insert("Aring", "\xC3\x85"); - entityMap.insert("aring", "\xC3\xA5"); - entityMap.insert("nbsp", "\xC2\xA0"); - entityMap.insert("Gamma", "\xCE\x93"); - entityMap.insert("Delta", "\xCE\x94"); - entityMap.insert("Theta", "\xCE\x98"); - entityMap.insert("Lambda", "\xCE\x9B"); - entityMap.insert("Xi", "\xCE\x9E"); - entityMap.insert("Pi", "\xCE\xA0"); - entityMap.insert("Sigma", "\xCE\xA3"); - entityMap.insert("Upsilon", "\xCE\xA5"); - entityMap.insert("Phi", "\xCE\xA6"); - entityMap.insert("Psi", "\xCE\xA8"); - entityMap.insert("Omega", "\xCE\xA9"); - entityMap.insert("alpha", "\xCE\xB1"); - entityMap.insert("beta", "\xCE\xB2"); - entityMap.insert("gamma", "\xCE\xB3"); - entityMap.insert("delta", "\xCE\xB4"); - entityMap.insert("epsilon", "\xCE\xB5"); - entityMap.insert("zeta", "\xCE\xB6"); - entityMap.insert("eta", "\xCE\xB7"); - entityMap.insert("theta", "\xCE\xB8"); - entityMap.insert("iota", "\xCE\xB9"); - entityMap.insert("kappa", "\xCE\xBA"); - entityMap.insert("lambda", "\xCE\xBB"); - entityMap.insert("mu", "\xCE\xBC"); - entityMap.insert("nu", "\xCE\xBD"); - entityMap.insert("xi", "\xCE\xBE"); - entityMap.insert("pi", "\xCF\x80"); - entityMap.insert("rho", "\xCF\x81"); - entityMap.insert("sigma", "\xCF\x83"); - entityMap.insert("tau", "\xCF\x84"); - entityMap.insert("upsilon", "\xCF\x85"); - entityMap.insert("phi", "\xCF\x86"); - entityMap.insert("chi", "\xCF\x87"); - entityMap.insert("psi", "\xCF\x88"); - entityMap.insert("omega", "\xCF\x89"); - entityMap.insert("sigmaf", "\xCF\x82"); - entityMap.insert("sect", "\xC2\xA7"); - entityMap.insert("deg", "\xC2\xB0"); - entityMap.insert("prime", "\xE2\x80\xB2"); - entityMap.insert("Prime", "\xE2\x80\xB3"); - entityMap.insert("infin", "\xE2\x88\x9E"); - entityMap.insert("empty", "\xE2\x88\x85"); - entityMap.insert("plusmn", "\xC2\xB1"); - entityMap.insert("times", "\xC3\x97"); - entityMap.insert("minus", "\xE2\x88\x92"); - entityMap.insert("sdot", "\xE2\x8B\x85"); - entityMap.insert("part", "\xE2\x88\x82"); - entityMap.insert("nabla", "\xE2\x88\x87"); - entityMap.insert("radic", "\xE2\x88\x9A"); - entityMap.insert("perp", "\xE2\x8A\xA5"); - entityMap.insert("sum", "\xE2\x88\x91"); - entityMap.insert("int", "\xE2\x88\xAB"); - entityMap.insert("prod", "\xE2\x88\x8F"); - entityMap.insert("sim", "\xE2\x88\xBC"); - entityMap.insert("asymp", "\xE2\x89\x88"); - entityMap.insert("ne", "\xE2\x89\xA0"); - entityMap.insert("equiv", "\xE2\x89\xA1"); - entityMap.insert("prop", "\xE2\x88\x9D"); - entityMap.insert("le", "\xE2\x89\xA4"); - entityMap.insert("ge", "\xE2\x89\xA5"); - entityMap.insert("larr", "\xE2\x86\x90"); - entityMap.insert("rarr", "\xE2\x86\x92"); - entityMap.insert("isin", "\xE2\x88\x88"); - entityMap.insert("notin", "\xE2\x88\x89"); - entityMap.insert("lceil", "\xE2\x8C\x88"); - entityMap.insert("rceil", "\xE2\x8C\x89"); - entityMap.insert("lfloor", "\xE2\x8C\x8A"); - entityMap.insert("rfloor", "\xE2\x8C\x8B"); - init=FALSE; - } + static QRegExp entityPat("&[a-zA-Z]+[0-9]*;"); if (s.length()==0) return result; static GrowBuf growBuf; @@ -5824,13 +5686,14 @@ QCString convertCharEntitiesToUTF8(const QCString &s) int p,i=0,l; while ((p=entityPat.match(s,i,&l))!=-1) { - if (p>i) + if (p>i) { growBuf.addStr(s.mid(i,p-i)); } - QCString entity = s.mid(p+1,l-2); - char *code = entityMap.find(entity); - if (code) + QCString entity = s.mid(p,l); + DocSymbol::SymType symType = HtmlEntityMapper::instance()->name2sym(entity); + const char *code=0; + if (symType!=DocSymbol::Sym_Unknown && (code=HtmlEntityMapper::instance()->utf8(symType))) { growBuf.addStr(code); } @@ -8339,3 +8202,4 @@ void convertProtectionLevel( //printf("convertProtectionLevel(type=%d prot=%d): %d,%d\n", // inListType,inProt,*outListType1,*outListType2); } + @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -26,6 +26,7 @@ #include <ctype.h> #include "types.h" #include "sortdict.h" +#include "docparser.h" //-------------------------------------------------------------------- diff --git a/src/version.h b/src/version.h index 9d523c1..b31fe4f 100644 --- a/src/version.h +++ b/src/version.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/vhdlcode.l b/src/vhdlcode.l index 85164bf..d8586ab 100644 --- a/src/vhdlcode.l +++ b/src/vhdlcode.l @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/vhdldocgen.cpp b/src/vhdldocgen.cpp index 262b90f..040a398 100644 --- a/src/vhdldocgen.cpp +++ b/src/vhdldocgen.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h index 7c78373..45ceb06 100644 --- a/src/vhdldocgen.h +++ b/src/vhdldocgen.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/vhdlparser.y b/src/vhdlparser.y index 69f5968..247ac8a 100644 --- a/src/vhdlparser.y +++ b/src/vhdlparser.y @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/vhdlscanner.h b/src/vhdlscanner.h index 1d799d0..9b7c292 100644 --- a/src/vhdlscanner.h +++ b/src/vhdlscanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index 8df1acf..b906fc1 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -30,6 +30,7 @@ #include "parserintf.h" #include "filename.h" #include "config.h" +#include "htmlentity.h" XmlDocVisitor::XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci) : DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE) @@ -70,110 +71,14 @@ void XmlDocVisitor::visit(DocWhiteSpace *w) void XmlDocVisitor::visit(DocSymbol *s) { if (m_hide) return; - switch(s->symbol()) + const char *res = HtmlEntityMapper::instance()->xml(s->symbol()); + if (res) { - case DocSymbol::BSlash: m_t << "\\"; break; - case DocSymbol::At: m_t << "@"; break; - case DocSymbol::Less: m_t << "<"; break; - case DocSymbol::Greater: m_t << ">"; break; - case DocSymbol::Amp: m_t << "&"; 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 << "<trademark/>"; break; - case DocSymbol::Reg: m_t << "<registered/>"; 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 << "<umlaut char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Acute: m_t << "<acute char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Grave: m_t << "<grave char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Circ: m_t << "<circ char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Tilde: m_t << "<tilde char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Szlig: m_t << "<szlig/>"; break; - case DocSymbol::Cedil: m_t << "<cedil char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Ring: m_t << "<ring char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Slash: m_t << "<slash char=\"" << s->letter() << "\"/>"; break; - case DocSymbol::Nbsp: m_t << "<nonbreakablespace/>"; 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("XML: non supported HTML-entity found: %s\n",HtmlEntityMapper::instance()->html(s->symbol(),TRUE)); } } diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h index 6dc189c..3e2236c 100644 --- a/src/xmldocvisitor.h +++ b/src/xmldocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 570901f..c0bfd81 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -45,6 +45,7 @@ #include "membergroup.h" #include "dirdef.h" #include "section.h" +#include "htmlentity.h" // no debug info #define XML_DB(x) do {} while(0) @@ -1897,7 +1898,32 @@ void generateXML() err("Cannot open file %s for writing!\n",fileName.data()); return; } - f.writeBlock(compound_xsd,qstrlen(compound_xsd)); + + // write compound.xsd, but replace special marker with the entities + const char *startLine = compound_xsd; + while (*startLine) + { + // find end of the line + const char *endLine = startLine+1; + while (*endLine && *(endLine-1)!='\n') endLine++; // skip to end of the line including \n + int len=endLine-startLine; + if (len>0) + { + QCString s(len+1); + qstrncpy(s.data(),startLine,len); + s[len]='\0'; + if (s.find("<!-- Automatically insert here the HTML entities -->")!=-1) + { + FTextStream t(&f); + HtmlEntityMapper::instance()->writeXMLSchema(t); + } + else + { + f.writeBlock(startLine,len); + } + } + startLine=endLine; + } f.close(); fileName=outputDirectory+"/index.xml"; diff --git a/src/xmlgen.h b/src/xmlgen.h index b89b10f..9c9ae17 100644 --- a/src/xmlgen.h +++ b/src/xmlgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2013 by Dimitri van Heesch. + * Copyright (C) 1997-2014 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby |