34#define MAP_CMD "cmapx"
95 for (
const auto &job :
m_jobs)
97 if (job.absPath == newJob.
absPath && job.relDotName == newJob.
relDotName && job.format == newJob.
format)
return;
100 err(
"md5 hash does not match for two different runs of {}{} !\n", newJob.
absPath, newJob.
relDotName);
116 return &(rv.first->second);
122 if (
m_jobs.size()+numFilePatchers > 0)
126 msg(
"Generating {:d} dot graphs in single threaded mode with batch size {:d}...\n",
131 msg(
"Generating {:d} dot graphs using {:d} parallel threads with batch size {:d}...\n",
165 if (!ok)
return false;
175 if (fp.second.isSVGFile())
177 msg(
"Patching output file {}/{}\n",i,numFilePatchers);
178 if (!fp.second.run())
return false;
184 if (!fp.second.isSVGFile())
186 msg(
"Patching output file {}/{}\n",i,numFilePatchers);
187 if (!fp.second.run())
return false;
198 const DString &srcFile,
int srcLine,
bool toIndex)
203 term(
"Output dir {} does not exist!\n",outDir);
207 DString imgName = outFile+
"."+imgExt;
220 dotArgs =
DString(
"-Tpdf -o \"") + absOutFile +
".pdf\" \"" + inFile +
"\"";
224 dotArgs =
DString(
"-Teps -o \"") + absOutFile +
".eps\" \"" + inFile +
"\"";
252 const DString &context,
int graphId,
253 const DString &srcFile,
int srcLine,
bool newFile)
259 term(
"Output dir {} does not exist!\n",outDir);
262 DString mapName = baseName+
".cmapx";
264 DString imgName = baseName+
"."+imgExt;
275 DString svgName = outDir+
"/"+baseName+
".svg";
287 t <<
"<img src=\"" << relPath << imgName <<
"\" alt=\""
288 << imgName <<
"\" border=\"0\" usemap=\"#" << mapName <<
"\"/>\n";
292 t <<
"<map name=\"" << mapName <<
"\" id=\"" << mapName <<
"\">";
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
DString & prepend(const char *s)
const std::string & str() const
Class representing a directory in the file system.
std::string absPath() const
bool remove(const std::string &path, bool acceptsAbsPath=true) const
Helper class to insert a set of map file into an output file.
int addSVGConversion(const DString &relPath, bool urlOnly, const DString &context, bool zoomable, int graphId)
static bool writeSVGFigureLink(TextStream &out, const DString &relPath, const DString &baseName, const DString &absImgName)
Check if a reference to a SVG figure can be written and do so if possible.
static bool convertMapFile(TextStream &t, const DString &mapName, const DString &relPath, bool urlOnly=false, const DString &context=DString())
DotFilePatcher * createFilePatcher(const DString &fileName)
std::map< std::string, DotFilePatcher > m_filePatchers
void addJob(const DotJob &newJob)
static DotManager * instance()
bool run(const DotJobs &jobs)
Runs dot for all given jobs.
static DString verifiedDotPath
static IndexList * indexList
void addImageFile(const DString &name)
Text streaming class that buffers data.
bool empty() const
Returns true iff the buffer is empty.
std::string str() const
Return the contents of the buffer as a std::string object.
#define Config_getInt(name)
#define Config_getEnumAsString(name)
#define Config_getBool(name)
#define Config_getString(name)
void writeDotGraphFromFile(const DString &inFile, const DString &outDir, const DString &outFile, GraphOutputFormat format, const DString &srcFile, int srcLine, bool toIndex)
static void unsetDotFontPath()
void writeDotImageMapFromFile(TextStream &t, const DString &inFile, const DString &outDir, const DString &relPath, const DString &baseName, const DString &context, int graphId, const DString &srcFile, int srcLine, bool newFile)
static std::mutex g_dotManagerMutex
static DString g_dotFontPath
static void setDotFontPath(const DString &path)
void setenv(const DString &variable, const DString &value)
int system(const DString &command, const DString &args, bool commandHasConsole=true)
DString getenv(const DString &variable)
DString pathListSeparator()
void unsetenv(const DString &variable)
Portable versions of functions that are platform dependent.
DString getDotImageExtension()
A bunch of utility functions.