Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
dfa20277
Commit
dfa20277
authored
Feb 10, 2014
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Restructered html entity handling
parent
69665ef2
Changes
17
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
603 additions
and
536 deletions
+603
-536
docbookvisitor.cpp
src/docbookvisitor.cpp
+3
-2
docparser.cpp
src/docparser.cpp
+2
-1
dot.cpp
src/dot.cpp
+1
-1
htmldocvisitor.cpp
src/htmldocvisitor.cpp
+3
-2
htmlentity.cpp
src/htmlentity.cpp
+477
-0
htmlentity.h
src/htmlentity.h
+47
-0
latexdocvisitor.cpp
src/latexdocvisitor.cpp
+3
-2
libdoxygen.pro.in
src/libdoxygen.pro.in
+2
-0
mandocvisitor.cpp
src/mandocvisitor.cpp
+2
-1
perlmodgen.cpp
src/perlmodgen.cpp
+14
-8
printdocvisitor.h
src/printdocvisitor.h
+11
-3
rtfdocvisitor.cpp
src/rtfdocvisitor.cpp
+3
-2
textdocvisitor.cpp
src/textdocvisitor.cpp
+3
-2
util.cpp
src/util.cpp
+6
-458
util.h
src/util.h
+0
-14
xmldocvisitor.cpp
src/xmldocvisitor.cpp
+3
-2
xmlgen.cpp
src/xmlgen.cpp
+23
-38
No files found.
src/docbookvisitor.cpp
View file @
dfa20277
...
...
@@ -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,14 +74,14 @@ void DocbookDocVisitor::visit(DocWhiteSpace *w)
void
DocbookDocVisitor
::
visit
(
DocSymbol
*
s
)
{
if
(
m_hide
)
return
;
const
char
*
res
=
get_symbol_
docbook
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
docbook
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
}
else
{
err
(
"DocBook: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"DocBook: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
...
...
src/docparser.cpp
View file @
dfa20277
...
...
@@ -53,6 +53,7 @@
#include "config.h"
#include "growbuf.h"
#include "markdown.h"
#include "htmlentity.h"
// debug off
#define DBG(x) do {} while(0)
...
...
@@ -1573,7 +1574,7 @@ static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribL
DocSymbol
::
SymType
DocSymbol
::
decodeSymbol
(
const
QCString
&
symName
)
{
DBG
((
"decodeSymbol(%s)
\n
"
,
qPrint
(
symName
)));
return
code_symbol
(
symName
);
return
HtmlEntityMapper
::
instance
()
->
name2sym
(
symName
);
}
//---------------------------------------------------------------------------
...
...
src/dot.cpp
View file @
dfa20277
...
...
@@ -1224,7 +1224,7 @@ DotManager *DotManager::instance()
return
m_theInstance
;
}
DotManager
::
DotManager
()
:
m_dotMaps
(
100
7
)
DotManager
::
DotManager
()
:
m_dotMaps
(
100
9
)
{
m_dotRuns
.
setAutoDelete
(
TRUE
);
m_dotMaps
.
setAutoDelete
(
TRUE
);
...
...
src/htmldocvisitor.cpp
View file @
dfa20277
...
...
@@ -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,14 +183,14 @@ void HtmlDocVisitor::visit(DocWhiteSpace *w)
void
HtmlDocVisitor
::
visit
(
DocSymbol
*
s
)
{
if
(
m_hide
)
return
;
const
char
*
res
=
get_symbol_
html
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
}
else
{
err
(
"HTML: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"HTML: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
...
...
src/htmlentity.cpp
0 → 100644
View file @
dfa20277
This diff is collapsed.
Click to expand it.
src/htmlentity.h
0 → 100644
View file @
dfa20277
/******************************************************************************
*
* Copyright (C) 1997-2013 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
)
const
;
const
char
*
html
(
DocSymbol
::
SymType
symb
)
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
src/latexdocvisitor.cpp
View file @
dfa20277
...
...
@@ -31,6 +31,7 @@
#include "cite.h"
#include "filedef.h"
#include "config.h"
#include "htmlentity.h"
static
QCString
escapeLabelName
(
const
char
*
s
)
{
...
...
@@ -135,7 +136,7 @@ void LatexDocVisitor::visit(DocWhiteSpace *w)
void
LatexDocVisitor
::
visit
(
DocSymbol
*
s
)
{
if
(
m_hide
)
return
;
const
char
*
res
=
get_symbol_
latex
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
latex
(
s
->
symbol
());
if
(
res
)
{
if
(((
s
->
symbol
()
==
DocSymbol
::
Sym_lt
)
||
(
s
->
symbol
()
==
DocSymbol
::
Sym_Less
))
&&
(
!
m_insidePre
))
...
...
@@ -153,7 +154,7 @@ void LatexDocVisitor::visit(DocSymbol *s)
}
else
{
err
(
"LaTeX: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"LaTeX: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
...
...
src/libdoxygen.pro.in
View file @
dfa20277
...
...
@@ -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 \
...
...
src/mandocvisitor.cpp
View file @
dfa20277
...
...
@@ -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,7 +76,7 @@ void ManDocVisitor::visit(DocWhiteSpace *w)
void
ManDocVisitor
::
visit
(
DocSymbol
*
s
)
{
if
(
m_hide
)
return
;
const
char
*
res
=
get_symbol_
man
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
man
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
...
...
src/perlmodgen.cpp
View file @
dfa20277
...
...
@@ -42,6 +42,7 @@
#include "membergroup.h"
#include "section.h"
#include "util.h"
#include "htmlentity.h"
#define PERLOUTPUT_MAX_INDENTATION 40
...
...
@@ -541,8 +542,8 @@ void PerlModDocVisitor::visit(DocWhiteSpace *)
void
PerlModDocVisitor
::
visit
(
DocSymbol
*
sy
)
{
const
DocSymbol
::
PerlSymb
*
res
=
get_symbol_
perl
(
sy
->
symbol
());
const
char
*
accent
;
const
DocSymbol
::
PerlSymb
*
res
=
HtmlEntityMapper
::
instance
()
->
perl
(
sy
->
symbol
());
const
char
*
accent
=
0
;
if
(
res
->
symb
)
{
switch
(
res
->
type
)
...
...
@@ -588,19 +589,24 @@ void PerlModDocVisitor::visit(DocSymbol *sy)
case
DocSymbol
:
:
Perl_ring
:
accent
=
"ring"
;
break
;
default
:
break
;
}
leaveText
();
openItem
(
"accent"
);
m_output
.
addFieldQuotedString
(
"accent"
,
accent
)
.
addFieldQuotedChar
(
"letter"
,
res
->
symb
[
0
]);
closeItem
();
if
(
accent
)
{
openItem
(
"accent"
);
m_output
.
addFieldQuotedString
(
"accent"
,
accent
)
.
addFieldQuotedChar
(
"letter"
,
res
->
symb
[
0
]);
closeItem
();
}
break
;
}
}
else
{
err
(
"perl: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
sy
->
symbol
()));
err
(
"perl: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
sy
->
symbol
()));
}
}
...
...
src/printdocvisitor.h
View file @
dfa20277
...
...
@@ -21,6 +21,7 @@
#include <qglobal.h>
#include "docvisitor.h"
#include "htmlentity.h"
/*! Concrete visitor implementation for pretty printing */
class
PrintDocVisitor
:
public
DocVisitor
...
...
@@ -56,14 +57,21 @@ class PrintDocVisitor : public DocVisitor
void
visit
(
DocSymbol
*
s
)
{
indent_leaf
();
const
char
*
res
=
get_symbol_print
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
utf8
(
s
->
symbol
());
if
(
res
)
{
printf
(
"%s"
,
res
);
if
(
qstrcmp
(
res
,
"%"
)
==
0
)
{
printf
(
"%%"
);
}
else
{
printf
(
"%s"
,
res
);
}
}
else
{
printf
(
"print: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
printf
(
"print: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
void
visit
(
DocURL
*
u
)
...
...
src/rtfdocvisitor.cpp
View file @
dfa20277
...
...
@@ -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,14 +122,14 @@ void RTFDocVisitor::visit(DocSymbol *s)
{
if
(
m_hide
)
return
;
DBG_RTF
(
"{
\\
comment RTFDocVisitor::visit(DocSymbol)}
\n
"
);
const
char
*
res
=
get_symbol_
rtf
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
rtf
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
}
else
{
err
(
"RTF: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"RTF: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
m_lastIsPara
=
FALSE
;
}
...
...
src/textdocvisitor.cpp
View file @
dfa20277
...
...
@@ -20,19 +20,20 @@
#include "textdocvisitor.h"
#include "message.h"
#include "util.h"
#include "htmlentity.h"
//-------------------------------------------------------------------------
void
TextDocVisitor
::
visit
(
DocSymbol
*
s
)
{
const
char
*
res
=
get_symbol_text
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
}
else
{
err
(
"text: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"text: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
...
...
src/util.cpp
View file @
dfa20277
This diff is collapsed.
Click to expand it.
src/util.h
View file @
dfa20277
...
...
@@ -455,19 +455,5 @@ void convertProtectionLevel(
int
*
outListType2
);
DocSymbol
::
SymType
code_symbol
(
const
QCString
&
symName
);
const
char
*
get_symbol_item
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_UTF8
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_html
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_print
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_text
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_xml
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_docbook
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_latex
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_man
(
DocSymbol
::
SymType
symb
);
const
char
*
get_symbol_rtf
(
DocSymbol
::
SymType
symb
);
const
DocSymbol
::
PerlSymb
*
get_symbol_perl
(
DocSymbol
::
SymType
symb
);
int
get_num_standard_symbols
(
void
);
void
validate_html_entities
(
void
);
#endif
src/xmldocvisitor.cpp
View file @
dfa20277
...
...
@@ -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,14 +71,14 @@ void XmlDocVisitor::visit(DocWhiteSpace *w)
void
XmlDocVisitor
::
visit
(
DocSymbol
*
s
)
{
if
(
m_hide
)
return
;
const
char
*
res
=
get_symbol_
xml
(
s
->
symbol
());
const
char
*
res
=
HtmlEntityMapper
::
instance
()
->
xml
(
s
->
symbol
());
if
(
res
)
{
m_t
<<
res
;
}
else
{
err
(
"XML: non supported HTML-entity found:
&%s;
\n
"
,
get_symbol_item
(
s
->
symbol
()));
err
(
"XML: non supported HTML-entity found:
%s
\n
"
,
HtmlEntityMapper
::
instance
()
->
html
(
s
->
symbol
()));
}
}
...
...
src/xmlgen.cpp
View file @
dfa20277
...
...
@@ -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,47 +1898,31 @@ void generateXML()
err
(
"Cannot open file %s for writing!
\n
"
,
fileName
.
data
());
return
;
}
/*
* If the compound_xsd contyains the special string
* write part till special string
* for each html entity
* write xsd entry with xml element name without enclosing < and />
* write part after special string
* otherwise
* write original compound_xsd
*/
QCString
cmp_org
(
compound_xsd
);
QCString
ins
(
"<!-- Automatically insert here the HTML entities -->"
);
if
(
cmp_org
.
contains
(
QRegExp
(
ins
)))
{
QCString
xsd_txt
;
QCString
xsd_tmp
;
QCString
cmp_tmp1
;
QCString
cmp_tmp2
;
QRegExp
beg
(
"^<"
);
QRegExp
end
(
"/>$"
);
cmp_tmp1
=
cmp_org
;
cmp_tmp1
=
cmp_tmp1
.
replace
(
QRegExp
(
" *"
+
ins
+
".*"
),
""
);
f
.
writeBlock
(
cmp_tmp1
,
qstrlen
(
cmp_tmp1
));
int
num_std
=
get_num_standard_symbols
();
for
(
int
i
=
0
;
i
<
num_std
;
i
++
)
{
xsd_tmp
=
QCString
(
get_symbol_xml
((
DocSymbol
::
SymType
)
i
));
if
(
xsd_tmp
.
contains
(
beg
))
// 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
-
1
)
&&
*
(
endLine
-
1
)
!=
'\n'
)
endLine
++
;
// skip to end of the line
int
len
=
endLine
-
startLine
;
if
(
len
>
0
)
{
QCString
s
(
len
+
1
);
strlcpy
(
s
.
data
(),
startLine
,
len
);
s
[
len
]
=
'\0'
;
if
(
s
.
find
(
"<!-- Automatically insert here the HTML entities -->"
)
!=-
1
)
{
xsd_txt
=
" <xsd:element name=
\"
"
;
xsd_txt
+=
xsd_tmp
.
replace
(
beg
,
""
).
replace
(
end
,
""
);
xsd_txt
+=
"
\"
type=
\"
docEmptyType
\"
/>
\n
"
;
f
.
writeBlock
(
xsd_txt
,
qstrlen
(
xsd_txt
));
FTextStream
t
(
&
f
);
HtmlEntityMapper
::
instance
()
->
writeXMLSchema
(
t
);
}
else
{
f
.
writeBlock
(
startLine
,
len
);
}
}
cmp_tmp2
=
cmp_org
;
cmp_tmp2
=
cmp_tmp2
.
replace
(
QRegExp
(
".*"
+
ins
),
""
);
f
.
writeBlock
(
cmp_tmp2
,
qstrlen
(
cmp_tmp2
));
}
else
{
f
.
writeBlock
(
compound_xsd
,
qstrlen
(
compound_xsd
));
startLine
=
endLine
;
}
f
.
close
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment