summaryrefslogtreecommitdiffstats
path: root/src/mangen.cpp
diff options
context:
space:
mode:
authordimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2001-05-17 19:26:02 (GMT)
committerdimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7>2001-05-17 19:26:02 (GMT)
commit75fed7362598edf5a7210505cd38c92821863a39 (patch)
treecb90fc9b85934eb220249aae4ffd7e4979489b16 /src/mangen.cpp
parentf5f5db18c34651c19f63a972e70087ce2131e764 (diff)
downloadDoxygen-75fed7362598edf5a7210505cd38c92821863a39.zip
Doxygen-75fed7362598edf5a7210505cd38c92821863a39.tar.gz
Doxygen-75fed7362598edf5a7210505cd38c92821863a39.tar.bz2
Release-20010517
Diffstat (limited to 'src/mangen.cpp')
-rw-r--r--src/mangen.cpp78
1 files changed, 70 insertions, 8 deletions
diff --git a/src/mangen.cpp b/src/mangen.cpp
index 758be75..2082e2b 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -28,14 +28,31 @@
#include "util.h"
#include "doxygen.h"
+static QCString getExtension()
+{
+ QCString ext = Config_getString("MAN_EXTENSION");
+ if( ext.length() >= 2 &&
+ ext.data()[0] == '.' &&
+ isdigit( ext.data()[1] ) )
+ {
+ ext = ext.mid(1, 1);
+ }
+ else
+ {
+ ext = "3";
+ }
+ return ext;
+}
+
ManGenerator::ManGenerator() : OutputGenerator()
{
- dir=Config_getString("MAN_OUTPUT")+"/man3";
+ dir=Config_getString("MAN_OUTPUT")+"/man" + getExtension();
firstCol=TRUE;
paragraph=FALSE;
col=0;
upperCase=FALSE;
insideTabbing=FALSE;
+ inHeader=FALSE;
}
ManGenerator::~ManGenerator()
@@ -54,21 +71,25 @@ void ManGenerator::append(const OutputGenerator *g)
else
firstCol = ((ManGenerator *)g)->firstCol;
col+=((ManGenerator *)g)->col;
+ inHeader=((ManGenerator *)g)->inHeader;
paragraph=FALSE;
}
void ManGenerator::init()
{
- QDir d(Config_getString("MAN_OUTPUT"));
- if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT")))
+ QCString ext = getExtension();
+ QCString &manOutput = Config_getString("MAN_OUTPUT");
+
+ QDir d(manOutput);
+ if (!d.exists() && !d.mkdir(manOutput))
{
- err("Could not create output directory %s\n",Config_getString("MAN_OUTPUT").data());
+ err("Could not create output directory %s\n",manOutput.data());
exit(1);
}
- d.setPath(Config_getString("MAN_OUTPUT")+"/man3");
- if (!d.exists() && !d.mkdir(Config_getString("MAN_OUTPUT")+"/man3"))
+ d.setPath(manOutput+"/man"+ext);
+ if (!d.exists() && !d.mkdir(manOutput+"/man"+ext))
{
- err("Could not create output directory %s/man3\n",Config_getString("MAN_OUTPUT").data());
+ err("Could not create output directory %s/man%s\n",manOutput.data(),ext.data());
exit(1);
}
}
@@ -123,7 +144,8 @@ void ManGenerator::endFile()
void ManGenerator::endTitleHead(const char *,const char *name)
{
- t << ".TH \"" << name << "\" 3 \"" << dateToString(FALSE) << "\" \"";
+ t << ".TH \"" << name << "\" " << getExtension() << " \""
+ << dateToString(FALSE) << "\" \"";
if (Config_getString("PROJECT_NAME").isEmpty())
t << "Doxygen";
else
@@ -134,6 +156,7 @@ void ManGenerator::endTitleHead(const char *,const char *name)
t << ".SH NAME" << endl;
t << name << " \\- ";
firstCol=FALSE;
+ inHeader=TRUE;
}
void ManGenerator::newParagraph()
@@ -470,3 +493,42 @@ void ManGenerator::endMemberGroup(bool)
t << "\n.in -1c";
firstCol=FALSE;
}
+
+void ManGenerator::startSection(const char *,const char *,bool sub)
+{
+ if( !inHeader )
+ {
+ if( sub )
+ {
+ startMemberHeader();
+ }
+ else
+ {
+ startGroupHeader();
+ }
+ }
+}
+
+void ManGenerator::endSection(const char *,bool sub)
+{
+ if( !inHeader )
+ {
+ if( sub )
+ {
+ endMemberHeader();
+ }
+ else
+ {
+ endGroupHeader();
+ }
+ }
+ else
+ {
+ t << "\n";
+ firstCol=TRUE;
+ paragraph=FALSE;
+ inHeader=FALSE;
+ }
+}
+
+