|
| 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 78 of file latexgen.cpp.
79{
80 if (!str.isEmpty())
81 {
82 const char *p=str.data();
83 char c = 0;
84
89 {
91 }
92 else
93 {
94 while ((c=*p))
95 {
96 switch(c)
97 {
98 case 0x0c: p++;
99 break;
101 {
103 }
105 p++;
106 break;
107 case '^': *
m_t <<
"\\string^";
109 p++;
110 break;
111 case '`': *
m_t <<
"\\`{}";
113 p++;
114 break;
115 case '\t': {
116 int spacesToNextTabStop = tabSize - (
m_col%tabSize);
117 while (spacesToNextTabStop--)
118 {
120 {
122 }
124 }
125 p++;
126 }
127 break;
128 case '\n': *
m_t <<
'\n';
130 p++;
131 break;
132 default:
133 {
134 int i=0;
135
136#undef COPYCHAR
137
138#define COPYCHAR() do { \
139 int bytes = getUTF8CharNumBytes(c); \
140 if (lresult < (i + bytes + 1)) \
141 { \
142 lresult += 512; \
143 result = static_cast<char *>(realloc(result, lresult)); \
144 } \
145 for (int j=0; j<bytes && *p; j++) \
146 { \
147 result[i++]=*p++; \
148 } \
149 m_col++; \
150 } while(0)
151
152
154 while ((c=*p) &&
155 c!=0x0c && c!='\t' && c!='\n' && c!=' ' && c!='^'
156 )
157 {
159 }
160 result[i]=0;
163 true,
164 false,
166 false
167 );
168 }
169 break;
170 }
171 }
172 }
173 }
174}
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 222 of file latexgen.cpp.
223{
228 {
229 *
m_t <<
"\\DoxyCodeLine{";
231 }
233 {
234 QCString lineNumber;
236
237 QCString lineAnchor;
239 {
240 lineAnchor.
sprintf(
"_l%05d",l);
242 }
243 bool showTarget = usePDFLatex && pdfHyperlinks && !lineAnchor.
isEmpty() && writeLineAnchor;
244 if (showTarget)
245 {
246 *
m_t <<
"\\Hypertarget{" <<
stripPath(lineAnchor) <<
"}";
247 }
249 {
251 }
252 else
253 {
255 }
257 }
258 else
259 {
260 QCString lineNumber;
264 }
266}
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().