Orb/Doxygen/src/mangen.cpp
changeset 4 468f4c8d3d5b
parent 0 42188c7ea2d9
equal deleted inserted replaced
3:d8fccb2cd802 4:468f4c8d3d5b
     1 /******************************************************************************
     1 /******************************************************************************
     2  *
     2  *
     3  * 
     3  * 
     4  *
     4  *
     5  * Copyright (C) 1997-2008 by Dimitri van Heesch.
     5  * Copyright (C) 1997-2010 by Dimitri van Heesch.
     6  *
     6  *
     7  * Permission to use, copy, modify, and distribute this software and its
     7  * Permission to use, copy, modify, and distribute this software and its
     8  * documentation under the terms of the GNU General Public License is hereby 
     8  * documentation under the terms of the GNU General Public License is hereby 
     9  * granted. No representations are made about the suitability of this software 
     9  * granted. No representations are made about the suitability of this software 
    10  * for any purpose. It is provided "as is" without express or implied warranty.
    10  * for any purpose. It is provided "as is" without express or implied warranty.
    98 }
    98 }
    99 
    99 
   100 static QCString buildFileName(const char *name)
   100 static QCString buildFileName(const char *name)
   101 {
   101 {
   102   QCString fileName;
   102   QCString fileName;
       
   103   if (name==0) return "noname";
   103 
   104 
   104   const char *p=name;
   105   const char *p=name;
   105   char c;
   106   char c;
   106   while ((c=*p++))
   107   while ((c=*p++))
   107   {
   108   {
   252   firstCol=TRUE;
   253   firstCol=TRUE;
   253   paragraph=TRUE;
   254   paragraph=TRUE;
   254   upperCase=FALSE;
   255   upperCase=FALSE;
   255 }
   256 }
   256 
   257 
   257 void ManGenerator::startMemberHeader()
   258 void ManGenerator::startMemberHeader(const char *)
   258 {
   259 {
   259   if (!firstCol) t << endl;
   260   if (!firstCol) t << endl;
   260   t << ".SS \"";
   261   t << ".SS \"";
   261 }
   262 }
   262 
   263 
   405     }
   406     }
   406 
   407 
   407     // the name of the link file is derived from the name of the anchor:
   408     // the name of the link file is derived from the name of the anchor:
   408     // - truncate after an (optional) ::
   409     // - truncate after an (optional) ::
   409     QCString baseName = name;
   410     QCString baseName = name;
   410     int i=baseName.findRev(':');
   411     int i=baseName.findRev("::");
   411     if (i!=-1) baseName=baseName.right(baseName.length()-i-1);
   412     if (i!=-1) baseName=baseName.right(baseName.length()-i-2);
       
   413 
       
   414     //printf("Converting man link '%s'->'%s'->'%s'\n",
       
   415     //       name,baseName.data(),buildFileName(baseName).data());
   412     
   416     
   413     // - remove dangerous characters and append suffix, then add dir prefix
   417     // - remove dangerous characters and append suffix, then add dir prefix
   414     QCString fileName=dir+"/"+buildFileName( baseName );
   418     QCString fileName=dir+"/"+buildFileName( baseName );
   415     QFile linkfile( fileName );
   419     QFile linkfile( fileName );
   416     // - only create file if it doesn't exist already
   420     // - only create file if it doesn't exist already
   582   {
   586   {
   583     switch(type)
   587     switch(type)
   584     {
   588     {
   585       case SectionInfo::Page:          startGroupHeader(); break;
   589       case SectionInfo::Page:          startGroupHeader(); break;
   586       case SectionInfo::Section:       startGroupHeader(); break;
   590       case SectionInfo::Section:       startGroupHeader(); break;
   587       case SectionInfo::Subsection:    startMemberHeader(); break;
   591       case SectionInfo::Subsection:    startMemberHeader(0); break;
   588       case SectionInfo::Subsubsection: startMemberHeader(); break;
   592       case SectionInfo::Subsubsection: startMemberHeader(0); break;
   589       case SectionInfo::Paragraph:     startMemberHeader(); break;
   593       case SectionInfo::Paragraph:     startMemberHeader(0); break;
   590       default: ASSERT(0); break;
   594       default: ASSERT(0); break;
   591     }
   595     }
   592   }
   596   }
   593 }
   597 }
   594 
   598