• Main Page
  • Classes
  • Files
  • File List
  • File Members

doxyout.h

Go to the documentation of this file.
00001 // Copyright (C) 2012 by Konrad Rosenbaum <konrad@silmor.de>
00002 // protected under the GNU GPL version 3 or at your option any newer.
00003 // See COPYING.GPL file that comes with this distribution.
00004 //
00005 
00006 #ifndef WOC_DOXYOUT_H
00007 #define WOC_DOXYOUT_H
00008 #include <QStringList>
00009 
00010 inline QString doxyFormat(const QString&in,int level=0)
00011 {
00012         //split to lines
00013         QStringList inl=in.trimmed().split('\n');
00014         QString pre,ret;
00015         //create indent and comment prefix
00016         for(int i=0;i<level;i++)pre+='\t';
00017         pre+="/// ";
00018         //add comment
00019         foreach(QString line,inl){
00020                 ret+=pre;
00021                 ret+=line;
00022                 ret+="\n";
00023         }
00024         //done
00025         return ret;
00026 }
00027 
00028 inline QString doxyFormat(const QStringList&inl,int level=0)
00029 {
00030         QString ret;
00031         foreach(QString in,inl){
00032                 in=in.trimmed();
00033                 if(in.isEmpty())continue;
00034                 if(!ret.isEmpty())ret+=doxyFormat("",level);
00035                 ret+=doxyFormat(in,level);
00036         }
00037         return ret;
00038 }
00039 
00040 #endif

Generated on Sun Apr 15 2012 21:13:24 for PACK WOC by  doxygen 1.7.1