Functions
mangen.cpp File Reference
#include <stdlib.h>
#include <qdir.h>
#include "message.h"
#include "mangen.h"
#include "config.h"
#include "util.h"
#include "doxygen.h"
#include <string.h>
#include "docparser.h"
#include "mandocvisitor.h"
#include "language.h"

Go to the source code of this file.

Functions

static QCString getExtension ()
 
static QCString getSubdir ()
 
static QCString buildFileName (const char *name)
 

Function Documentation

static QCString buildFileName ( const char *  name)
static

Definition at line 127 of file mangen.cpp.

128 {
130  if (name==0) return "noname";
131 
132  const char *p=name;
133  char c;
134  while ((c=*p++))
135  {
136  switch (c)
137  {
138  case ':':
139  fileName+="_";
140  if (*p==':') p++;
141  break;
142  case '<':
143  case '>':
144  case '&':
145  case '*':
146  case '!':
147  case '^':
148  case '~':
149  case '%':
150  case '+':
151  case '/':
152  fileName+="_";
153  break;
154  default:
155  fileName+=c;
156  }
157  }
158 
159  QCString manExtension = "." + getExtension();
160  if (fileName.right(manExtension.length())!=manExtension)
161  {
162  fileName+=manExtension;
163  }
164 
165  return fileName;
166 }
static QCString name
Definition: declinfo.cpp:673
uint length() const
Definition: qcstring.h:195
fileName
Definition: dumpTree.py:9
QCString right(uint len) const
Definition: qcstring.cpp:231
p
Definition: test.py:223
static QCString getExtension()
Definition: mangen.cpp:34
static QCString getExtension ( )
static

Definition at line 34 of file mangen.cpp.

35 {
36  /*
37  * [.][nuber][rest]
38  * in case of . missing, just ignore it
39  * in case number missing, just place a 3 in front of it
40  */
41  QCString ext = Config_getString("MAN_EXTENSION");
42  if (ext.isEmpty())
43  {
44  ext = "3";
45  }
46  else
47  {
48  if (ext.at(0)=='.')
49  {
50  if (ext.length()==1)
51  {
52  ext = "3";
53  }
54  else // strip .
55  {
56  ext = ext.mid(1);
57  }
58  }
59  if (ext.at(0)<'0' || ext.at(0)>'9')
60  {
61  ext.prepend("3");
62  }
63  }
64  return ext;
65 }
bool isEmpty() const
Definition: qcstring.h:189
uint length() const
Definition: qcstring.h:195
char & at(uint i) const
Definition: qcstring.h:326
QCString & prepend(const char *s)
Definition: qcstring.cpp:387
#define Config_getString(val)
Definition: config.cpp:660
QCString mid(uint index, uint len=0xffffffff) const
Definition: qcstring.cpp:246
static QCString getSubdir ( )
static

Definition at line 67 of file mangen.cpp.

68 {
69  QCString dir = Config_getString("MAN_SUBDIR");
70  if (dir.isEmpty())
71  {
72  dir = "man" + getExtension();
73  }
74  return dir;
75 }
bool isEmpty() const
Definition: qcstring.h:189
string dir
#define Config_getString(val)
Definition: config.cpp:660
static QCString getExtension()
Definition: mangen.cpp:34