|
| LatexCodeGenerator (TextStream *t, const QCString &relPath, const QCString &sourceFile) |
|
| LatexCodeGenerator (TextStream *t) |
|
void | setTextStream (TextStream *t) |
|
OutputType | type () const override |
|
std::unique_ptr< OutputCodeIntf > | clone () override |
|
void | codify (const QCString &text) override |
|
void | stripCodeComments (bool b) override |
|
void | startSpecialComment () override |
|
void | endSpecialComment () override |
|
void | setStripIndentAmount (size_t amount) override |
|
void | writeCodeLink (CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override |
|
void | writeTooltip (const QCString &, const DocLinkInfo &, const QCString &, const QCString &, const SourceLinkInfo &, const SourceLinkInfo &) override |
|
void | writeLineNumber (const QCString &, const QCString &, const QCString &, int, bool) override |
|
void | startCodeLine (int) override |
|
void | endCodeLine () override |
|
void | startFontClass (const QCString &) override |
|
void | endFontClass () override |
|
void | writeCodeAnchor (const QCString &) override |
|
void | startCodeFragment (const QCString &style) override |
|
void | endCodeFragment (const QCString &style) override |
|
void | startFold (int, const QCString &, const QCString &) override |
|
void | endFold () override |
|
void | incUsedTableLevel () |
|
void | decUsedTableLevel () |
|
int | usedTableLevel () const |
|
void | setRelativePath (const QCString &path) |
|
void | setSourceFileName (const QCString &sourceFileName) |
|
void | setInsideTabbing (bool b) |
|
bool | insideTabbing () const |
|
| OutputCodeIntf ()=default |
|
Generator for LaTeX code fragments.
Definition at line 27 of file latexgen.h.
void LatexCodeGenerator::codify |
( |
const QCString & | text | ) |
|
|
overridevirtual |
Implements OutputCodeIntf.
Definition at line 76 of file latexgen.cpp.
77{
78 if (!str.isEmpty())
79 {
80 const char *p=str.data();
81 char c = 0;
82
87 {
89 }
90 else
91 {
92 while ((c=*p))
93 {
94 switch(c)
95 {
96 case 0x0c: p++;
97 break;
99 {
101 }
103 p++;
104 break;
105 case '^': *
m_t <<
"\\string^";
107 p++;
108 break;
109 case '`': *
m_t <<
"\\`{}";
111 p++;
112 break;
113 case '\t': {
114 int spacesToNextTabStop = tabSize - (
m_col%tabSize);
115 while (spacesToNextTabStop--)
116 {
118 {
120 }
122 }
123 p++;
124 }
125 break;
126 case '\n': *
m_t <<
'\n';
128 p++;
129 break;
130 default:
131 {
132 int i=0;
133
134#undef COPYCHAR
135
136#define COPYCHAR() do { \
137 int bytes = getUTF8CharNumBytes(c); \
138 if (lresult < (i + bytes + 1)) \
139 { \
140 lresult += 512; \
141 result = static_cast<char *>(realloc(result, lresult)); \
142 } \
143 for (int j=0; j<bytes && *p; j++) \
144 { \
145 result[i++]=*p++; \
146 } \
147 m_col++; \
148 } while(0)
149
150
152 while ((c=*p) &&
153 c!=0x0c && c!='\t' && c!='\n' && c!=' ' && c!='^'
154 )
155 {
157 }
158 result[i]=0;
161 true,
162 false,
164 false
165 );
166 }
167 break;
168 }
169 }
170 }
171 }
172}
size_t m_stripIndentAmount
#define Config_getInt(name)
void filterLatexString(TextStream &t, const QCString &str, bool insideTabbing, bool insidePre, bool insideItem, bool insideTable, bool keepSpaces, const bool retainNewline=false)
size_t updateColumnCount(const char *s, size_t col)
References Config_getInt, COPYCHAR, QCString::data(), filterLatexString(), QCString::isEmpty(), m_col, m_doxyCodeLineOpen, m_hide, m_insideTabbing, m_stripIndentAmount, m_t, m_usedTableLevel, THREAD_LOCAL, and updateColumnCount().
Referenced by endCodeLine(), writeCodeLink(), and writeLineNumber().
void LatexCodeGenerator::writeLineNumber |
( |
const QCString & | ref, |
|
|
const QCString & | fileName, |
|
|
const QCString & | anchor, |
|
|
int | l, |
|
|
bool | writeLineAnchor ) |
|
overridevirtual |
Implements OutputCodeIntf.
Definition at line 220 of file latexgen.cpp.
221{
226 {
227 *
m_t <<
"\\DoxyCodeLine{";
229 }
231 {
232 QCString lineNumber;
234
235 QCString lineAnchor;
237 {
238 lineAnchor.
sprintf(
"_l%05d",l);
240 }
241 bool showTarget = usePDFLatex && pdfHyperlinks && !lineAnchor.
isEmpty() && writeLineAnchor;
242 if (showTarget)
243 {
244 *
m_t <<
"\\Hypertarget{" <<
stripPath(lineAnchor) <<
"}";
245 }
247 {
249 }
250 else
251 {
253 }
255 }
256 else
257 {
258 QCString lineNumber;
262 }
264}
void writeCodeLink(CodeSymbolType type, const QCString &ref, const QCString &file, const QCString &anchor, const QCString &name, const QCString &tooltip) override
QCString & prepend(const char *s)
QCString & sprintf(const char *format,...)
QCString stripExtensionGeneral(const QCString &fName, const QCString &ext)
References codify(), Config_getBool, Default, QCString::isEmpty(), m_col, m_doxyCodeLineOpen, m_hide, m_sourceFileName, m_t, QCString::prepend(), QCString::sprintf(), stripExtensionGeneral(), stripPath(), TRUE, and writeCodeLink().