Classes | Public Member Functions | Private Attributes | List of all members
DotRunner Class Reference

#include <dot.h>

Classes

struct  CleanupItem
 

Public Member Functions

 DotRunner (const QCString &file, const QCString &fontPath, bool checkResult, const QCString &imageName=QCString())
 
void addJob (const char *format, const char *output)
 
void addPostProcessing (const char *cmd, const char *args)
 
void preventCleanUp ()
 
bool run ()
 
const CleanupItemcleanup () const
 

Private Attributes

DotConstString m_dotExe
 
bool m_multiTargets
 
QList< DotConstStringm_jobs
 
DotConstString m_postArgs
 
DotConstString m_postCmd
 
DotConstString m_file
 
DotConstString m_path
 
bool m_checkResult
 
DotConstString m_imageName
 
DotConstString m_imgExt
 
bool m_cleanUp
 
CleanupItem m_cleanupItem
 

Detailed Description

Helper class to run dot from doxygen.

Definition at line 356 of file dot.h.

Constructor & Destructor Documentation

DotRunner::DotRunner ( const QCString file,
const QCString fontPath,
bool  checkResult,
const QCString imageName = QCString() 
)

Creates a runner for a dot file.

Definition at line 793 of file dot.cpp.

795  : m_dotExe(Config_getString("DOT_PATH")+"dot"),
796  m_file(file), m_path(path),
797  m_checkResult(checkResult), m_imageName(imageName),
799 {
800  static bool dotCleanUp = Config_getBool("DOT_CLEANUP");
801  static bool dotMultiTargets = Config_getBool("DOT_MULTI_TARGETS");
802  m_cleanUp = dotCleanUp;
803  m_multiTargets = dotMultiTargets;
805 }
bool m_checkResult
Definition: dot.h:390
DotConstString m_file
Definition: dot.h:388
DotConstString m_path
Definition: dot.h:389
bool m_cleanUp
Definition: dot.h:393
DotConstString m_imageName
Definition: dot.h:391
#define Config_getString(val)
Definition: config.cpp:660
#define Config_getBool(val)
Definition: config.cpp:664
QCString getDotImageExtension(void)
Definition: util.cpp:8562
DotConstString m_dotExe
Definition: dot.h:383
QList< DotConstString > m_jobs
Definition: dot.h:385
bool m_multiTargets
Definition: dot.h:384
DotConstString m_imgExt
Definition: dot.h:392
void setAutoDelete(bool enable)
Definition: qlist.h:99
const bool TRUE
Definition: qglobal.h:371

Member Function Documentation

void DotRunner::addJob ( const char *  format,
const char *  output 
)

Adds an additional job to the run. Performing multiple jobs one file can be faster.

Definition at line 807 of file dot.cpp.

808 {
809  QCString args = QCString("-T")+format+" -o \""+output+"\"";
810  m_jobs.append(new DotConstString(args));
811 }
void append(const type *d)
Definition: qlist.h:73
static bool format(QChar::Decomposition tag, QString &str, int index, int len)
Definition: qstring.cpp:11496
static QCString args
Definition: declinfo.cpp:674
QList< DotConstString > m_jobs
Definition: dot.h:385
void DotRunner::addPostProcessing ( const char *  cmd,
const char *  args 
)

Definition at line 813 of file dot.cpp.

814 {
815  m_postCmd.set(cmd);
817 }
DotConstString m_postArgs
Definition: dot.h:386
DotConstString m_postCmd
Definition: dot.h:387
static QCString args
Definition: declinfo.cpp:674
void set(const QCString &s)
Definition: dot.h:339
list cmd
Definition: getreco.py:22
const CleanupItem& DotRunner::cleanup ( ) const
inline

Definition at line 380 of file dot.h.

380 { return m_cleanupItem; }
CleanupItem m_cleanupItem
Definition: dot.h:394
void DotRunner::preventCleanUp ( )
inline

Definition at line 376 of file dot.h.

376 { m_cleanUp = FALSE; }
const bool FALSE
Definition: qglobal.h:370
bool m_cleanUp
Definition: dot.h:393
bool DotRunner::run ( )

Runs dot for all jobs added.

Definition at line 819 of file dot.cpp.

820 {
821  int exitCode=0;
822 
823  QCString dotArgs;
825  DotConstString *s;
826  if (m_multiTargets)
827  {
828  dotArgs=QCString("\"")+m_file.data()+"\"";
829  for (li.toFirst();(s=li.current());++li)
830  {
831  dotArgs+=' ';
832  dotArgs+=s->data();
833  }
834  if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0)
835  {
836  goto error;
837  }
838  }
839  else
840  {
841  for (li.toFirst();(s=li.current());++li)
842  {
843  dotArgs=QCString("\"")+m_file.data()+"\" "+s->data();
844  if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0)
845  {
846  goto error;
847  }
848  }
849  }
851  {
852  err("Problems running '%s' as a post-processing step for dot output\n",m_postCmd.data());
853  return FALSE;
854  }
855  if (m_checkResult)
856  {
858  }
859  if (m_cleanUp)
860  {
861  //printf("removing dot file %s\n",m_file.data());
862  //QDir(path).remove(file);
865  }
866  return TRUE;
867 error:
868  err("Problems running dot: exit code=%d, command='%s', arguments='%s'\n",
869  exitCode,m_dotExe.data(),dotArgs.data());
870  return FALSE;
871 }
DotConstString m_postArgs
Definition: dot.h:386
bool isEmpty() const
Definition: dot.h:338
bool m_checkResult
Definition: dot.h:390
DotConstString file
Definition: dot.h:362
const bool FALSE
Definition: qglobal.h:370
DotConstString m_postCmd
Definition: dot.h:387
error
Definition: include.cc:26
DotConstString m_file
Definition: dot.h:388
DotConstString m_path
Definition: dot.h:389
DotConstString path
Definition: dot.h:361
bool m_cleanUp
Definition: dot.h:393
DotConstString m_imageName
Definition: dot.h:391
void set(const QCString &s)
Definition: dot.h:339
const char * data() const
Definition: qcstring.h:207
static void checkDotResult(const char *imgExt, const char *imgName)
Definition: dot.cpp:662
void err(const char *fmt,...)
Definition: message.cpp:226
DotConstString m_dotExe
Definition: dot.h:383
QList< DotConstString > m_jobs
Definition: dot.h:385
CleanupItem m_cleanupItem
Definition: dot.h:394
bool m_multiTargets
Definition: dot.h:384
DotConstString m_imgExt
Definition: dot.h:392
static QCString * s
Definition: config.cpp:1042
const bool TRUE
Definition: qglobal.h:371
const char * data() const
Definition: dot.h:337
int portable_system(const char *command, const char *args, bool commandHasConsole)
Definition: portable.cpp:33

Member Data Documentation

bool DotRunner::m_checkResult
private

Definition at line 390 of file dot.h.

bool DotRunner::m_cleanUp
private

Definition at line 393 of file dot.h.

CleanupItem DotRunner::m_cleanupItem
private

Definition at line 394 of file dot.h.

DotConstString DotRunner::m_dotExe
private

Definition at line 383 of file dot.h.

DotConstString DotRunner::m_file
private

Definition at line 388 of file dot.h.

DotConstString DotRunner::m_imageName
private

Definition at line 391 of file dot.h.

DotConstString DotRunner::m_imgExt
private

Definition at line 392 of file dot.h.

QList<DotConstString> DotRunner::m_jobs
private

Definition at line 385 of file dot.h.

bool DotRunner::m_multiTargets
private

Definition at line 384 of file dot.h.

DotConstString DotRunner::m_path
private

Definition at line 389 of file dot.h.

DotConstString DotRunner::m_postArgs
private

Definition at line 386 of file dot.h.

DotConstString DotRunner::m_postCmd
private

Definition at line 387 of file dot.h.


The documentation for this class was generated from the following files: