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

References Config_getBool, m_cleanUp, m_jobs, and m_multiTargets.

: m_dotExe(Config_getString(DOT_PATH)+"dot"),
m_file(file), m_path(path),
m_checkResult(checkResult), m_imageName(imageName),
{
static bool dotCleanUp = Config_getBool(DOT_CLEANUP);
static bool dotMultiTargets = Config_getBool(DOT_MULTI_TARGETS);
m_cleanUp = dotCleanUp;
m_multiTargets = dotMultiTargets;
m_jobs.setAutoDelete(TRUE);
}

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 765 of file dot.cpp.

References m_jobs.

Referenced by DotGfxHierarchyTable::createGraph(), generateGraphLegend(), writeDotGraphFromFile(), writeDotImageMapFromFile(), DotClassGraph::writeGraph(), DotInclDepGraph::writeGraph(), DotCallGraph::writeGraph(), DotDirDeps::writeGraph(), and DotGroupCollaboration::writeGraph().

{
QCString args = QCString("-T")+format+" -o \""+output+"\"";
m_jobs.append(new DotConstString(args));
}
void DotRunner::addPostProcessing ( const char *  cmd,
const char *  args 
)

Definition at line 771 of file dot.cpp.

References m_postArgs, m_postCmd, and DotConstString::set().

{
m_postCmd.set(cmd);
m_postArgs.set(args);
}
const CleanupItem& DotRunner::cleanup ( ) const
inline

Definition at line 388 of file dot.h.

References m_cleanupItem.

Referenced by DotWorkerThread::run().

{ return m_cleanupItem; }
void DotRunner::preventCleanUp ( )
inline

Definition at line 384 of file dot.h.

References m_cleanUp.

{ m_cleanUp = FALSE; }
bool DotRunner::run ( )

Runs dot for all jobs added.

Definition at line 777 of file dot.cpp.

References checkDotResult(), DotConstString::data(), err(), DotRunner::CleanupItem::file, DotConstString::isEmpty(), m_checkResult, m_cleanUp, m_cleanupItem, m_dotExe, m_file, m_imageName, m_imgExt, m_jobs, m_multiTargets, m_path, m_postArgs, m_postCmd, DotRunner::CleanupItem::path, portable_system(), and DotConstString::set().

Referenced by DotWorkerThread::run(), and DotManager::run().

{
int exitCode=0;
QCString dotArgs;
QListIterator<DotConstString> li(m_jobs);
{
dotArgs=QCString("\"")+m_file.data()+"\"";
for (li.toFirst();(s=li.current());++li)
{
dotArgs+=' ';
dotArgs+=s->data();
}
if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0)
{
goto error;
}
}
else
{
for (li.toFirst();(s=li.current());++li)
{
dotArgs=QCString("\"")+m_file.data()+"\" "+s->data();
if ((exitCode=portable_system(m_dotExe.data(),dotArgs,FALSE))!=0)
{
goto error;
}
}
}
{
err("Problems running '%s' as a post-processing step for dot output\n",m_postCmd.data());
return FALSE;
}
{
}
if (m_cleanUp)
{
//printf("removing dot file %s\n",m_file.data());
//QDir(path).remove(file);
}
return TRUE;
error:
err("Problems running dot: exit code=%d, command='%s', arguments='%s'\n",
exitCode,m_dotExe.data(),dotArgs.data());
return FALSE;
}

Member Data Documentation

bool DotRunner::m_checkResult
private

Definition at line 398 of file dot.h.

Referenced by run().

bool DotRunner::m_cleanUp
private

Definition at line 401 of file dot.h.

Referenced by DotRunner(), preventCleanUp(), and run().

CleanupItem DotRunner::m_cleanupItem
private

Definition at line 402 of file dot.h.

Referenced by cleanup(), and run().

DotConstString DotRunner::m_dotExe
private

Definition at line 391 of file dot.h.

Referenced by run().

DotConstString DotRunner::m_file
private

Definition at line 396 of file dot.h.

Referenced by run().

DotConstString DotRunner::m_imageName
private

Definition at line 399 of file dot.h.

Referenced by run().

DotConstString DotRunner::m_imgExt
private

Definition at line 400 of file dot.h.

Referenced by run().

QList<DotConstString> DotRunner::m_jobs
private

Definition at line 393 of file dot.h.

Referenced by addJob(), DotRunner(), and run().

bool DotRunner::m_multiTargets
private

Definition at line 392 of file dot.h.

Referenced by DotRunner(), and run().

DotConstString DotRunner::m_path
private

Definition at line 397 of file dot.h.

Referenced by run().

DotConstString DotRunner::m_postArgs
private

Definition at line 394 of file dot.h.

Referenced by addPostProcessing(), and run().

DotConstString DotRunner::m_postCmd
private

Definition at line 395 of file dot.h.

Referenced by addPostProcessing(), and run().


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