My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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.

References getExtension().

Referenced by ManGenerator::startDoxyAnchor(), and ManGenerator::startFile().

{
QCString fileName;
if (name==0) return "noname";
const char *p=name;
char c;
while ((c=*p++))
{
switch (c)
{
case ':':
fileName+="_";
if (*p==':') p++;
break;
case '<':
case '>':
case '&':
case '*':
case '!':
case '^':
case '~':
case '%':
case '+':
case '/':
fileName+="_";
break;
default:
fileName+=c;
}
}
QCString manExtension = "." + getExtension();
if (fileName.right(manExtension.length())!=manExtension)
{
fileName+=manExtension;
}
return fileName;
}
static QCString getExtension ( )
static

Definition at line 34 of file mangen.cpp.

References Config_getString.

Referenced by buildFileName(), ManGenerator::endTitleHead(), and getSubdir().

{
/*
* [.][nuber][rest]
* in case of . missing, just ignore it
* in case number missing, just place a 3 in front of it
*/
QCString ext = Config_getString(MAN_EXTENSION);
if (ext.isEmpty())
{
ext = "3";
}
else
{
if (ext.at(0)=='.')
{
if (ext.length()==1)
{
ext = "3";
}
else // strip .
{
ext = ext.mid(1);
}
}
if (ext.at(0)<'0' || ext.at(0)>'9')
{
ext.prepend("3");
}
}
return ext;
}
static QCString getSubdir ( )
static

Definition at line 67 of file mangen.cpp.

References Config_getString, and getExtension().

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

{
QCString dir = Config_getString(MAN_SUBDIR);
if (dir.isEmpty())
{
dir = "man" + getExtension();
}
return dir;
}