Skip to main content

The mangen.cpp File Reference

Included Headers

#include <stdlib.h> #include <string.h> #include "message.h" #include "mangen.h" #include "config.h" #include "util.h" #include "doxygen.h" #include "docparser.h" #include "mandocvisitor.h" #include "language.h" #include "dir.h" #include "utf8.h" #include "datetime.h" #include "portable.h" #include "outputlist.h"

Functions Index

static QCStringgetExtension ()
static QCStringgetSubdir ()
static QCStringdocifyToString (const QCString &str)
static QCStringobjectLinkToString (const QCString &text)
static QCStringbuildFileName (const QCString &name)

Functions

buildFileName()

QCString buildFileName (const QCString & name)
static

Definition at line 296 of file mangen.cpp.

296static QCString buildFileName(const QCString &name)
297{
298 QCString fileName;
299 if (name.isEmpty()) return "noname";
300
301 const char *p=name.data();
302 char c = 0;
303 while ((c=*p++))
304 {
305 switch (c)
306 {
307 case ':':
308 fileName+="_";
309 if (*p==':') p++;
310 break;
311 case '<':
312 case '>':
313 case '&':
314 case '*':
315 case '!':
316 case '^':
317 case '~':
318 case '%':
319 case '+':
320 case '/':
321 fileName+="_";
322 break;
323 default:
324 fileName+=c;
325 }
326 }
327
328 QCString manExtension = "." + getExtension();
329 if (fileName.right(manExtension.length())!=manExtension)
330 {
331 fileName+=manExtension;
332 }
333
334 return fileName;
335}

References QCString::data, getExtension, QCString::isEmpty, QCString::length and QCString::right.

Referenced by ManGenerator::startDoxyAnchor and ManGenerator::startFile.

docifyToString()

QCString docifyToString (const QCString & str)
static

Definition at line 79 of file mangen.cpp.

80{
81 QCString result;
82 result.reserve(str.length());
83 if (!str.isEmpty())
84 {
85 const char *p=str.data();
86 char c=0;
87 while ((c=*p++))
88 {
89 switch(c)
90 {
91 case '-': result += "\\-"; break; // see bug747780
92 case '.': result += "\\&."; break; // see bug652277
93 case '\\': result += "\\\\"; break;
94 case '\n': result += "\n"; break;
95 case '\"': c = '\''; // no break!
96 default: result += c; break;
97 }
98 }
99 //printf("%s",str);fflush(stdout);
100 }
101 return result;
102}

References QCString::data, QCString::isEmpty, QCString::length and QCString::reserve.

Referenced by RTFGenerator::docify, objectLinkToString, ManGenerator::writeInheritedSectionTitle and RTFGenerator::writeInheritedSectionTitle.

getExtension()

QCString getExtension ()
static

Definition at line 36 of file mangen.cpp.

37{
38 /*
39 * [.][number][rest]
40 * in case of . missing, just ignore it
41 * in case number missing, just place a 3 in front of it
42 */
43 QCString ext = Config_getString(MAN_EXTENSION);
44 if (ext.isEmpty())
45 {
46 ext = "3";
47 }
48 else
49 {
50 if (ext.at(0)=='.')
51 {
52 if (ext.length()==1)
53 {
54 ext = "3";
55 }
56 else // strip .
57 {
58 ext = ext.mid(1);
59 }
60 }
61 if (ext.at(0)<'0' || ext.at(0)>'9')
62 {
63 ext.prepend("3");
64 }
65 }
66 return ext;
67}

References QCString::at, Config_getString, QCString::isEmpty, QCString::length, QCString::mid and QCString::prepend.

Referenced by buildFileName, ManGenerator::endTitleHead and getSubdir.

getSubdir()

QCString getSubdir ()
static

Definition at line 69 of file mangen.cpp.

70{
71 QCString dir = Config_getString(MAN_SUBDIR);
72 if (dir.isEmpty())
73 {
74 dir = "man" + getExtension();
75 }
76 return dir;
77}

References Config_getString, getExtension and QCString::isEmpty.

Referenced by ManGenerator::init, ManGenerator::ManGenerator and ManGenerator::startDoxyAnchor.

objectLinkToString()

QCString objectLinkToString (const QCString & text)
static

Definition at line 104 of file mangen.cpp.

105{
106 return "\\fB" + docifyToString(text) + "\\fP";
107}

Reference docifyToString.


Generated via doxygen2docusaurus by Doxygen 1.14.0.