Doxygen
Loading...
Searching...
No Matches
dotgraph.cpp File Reference
#include <mutex>
#include <regex>
#include "config.h"
#include "doxygen.h"
#include "indexlist.h"
#include "md5.h"
#include "message.h"
#include "util.h"
#include "dot.h"
#include "dotrunner.h"
#include "dotgraph.h"
#include "dotnode.h"
#include "dotfilepatcher.h"
#include "fileinfo.h"
#include "portable.h"
+ Include dependency graph for dotgraph.cpp:

Go to the source code of this file.

Macros

#define MAP_CMD   "cmapx"
 

Functions

static bool sameMd5Signature (const QCString &baseName, const QCString &md5)
 
static bool deliverablesPresent (const QCString &file1, const QCString &file2)
 
static bool insertMapFile (TextStream &out, const QCString &mapFile, const QCString &relPath, const QCString &mapLabel)
 

Variables

std::mutex g_dotIndexListMutex
 

Macro Definition Documentation

◆ MAP_CMD

#define MAP_CMD   "cmapx"

Definition at line 34 of file dotgraph.cpp.

Function Documentation

◆ deliverablesPresent()

static bool deliverablesPresent ( const QCString & file1,
const QCString & file2 )
static

Definition at line 69 of file dotgraph.cpp.

70{
71 bool file1Ok = true;
72 bool file2Ok = true;
73 if (!file1.isEmpty())
74 {
75 FileInfo fi(file1.str());
76 file1Ok = (fi.exists() && fi.size()>0);
77 }
78 if (!file2.isEmpty())
79 {
80 FileInfo fi(file2.str());
81 file2Ok = (fi.exists() && fi.size()>0);
82 }
83 return file1Ok && file2Ok;
84}
Minimal replacement for QFileInfo.
Definition fileinfo.h:23
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:150
const std::string & str() const
Definition qcstring.h:526

References FileInfo::exists(), QCString::isEmpty(), FileInfo::size(), and QCString::str().

Referenced by DotGraph::prepareDotFile().

◆ insertMapFile()

static bool insertMapFile ( TextStream & out,
const QCString & mapFile,
const QCString & relPath,
const QCString & mapLabel )
static

Definition at line 86 of file dotgraph.cpp.

88{
89 FileInfo fi(mapFile.str());
90 if (fi.exists() && fi.size()>0) // reuse existing map file
91 {
92 TextStream t;
93 DotFilePatcher::convertMapFile(t,mapFile,relPath,false);
94 if (!t.empty())
95 {
96 out << "<map name=\"" << mapLabel << "\" id=\"" << mapLabel << "\">\n";
97 out << t.str();
98 out << "</map>\n";
99 }
100 return true;
101 }
102 return false; // no map file yet, need to generate it
103}
static bool convertMapFile(TextStream &t, const QCString &mapName, const QCString &relPath, bool urlOnly=FALSE, const QCString &context=QCString())
Text streaming class that buffers data.
Definition textstream.h:36
bool empty() const
Returns true iff the buffer is empty.
Definition textstream.h:253
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:229

References DotFilePatcher::convertMapFile(), TextStream::empty(), FileInfo::exists(), FileInfo::size(), QCString::str(), and TextStream::str().

Referenced by DotGraph::generateCode().

◆ sameMd5Signature()

static bool sameMd5Signature ( const QCString & baseName,
const QCString & md5 )
static

Checks if a file "baseName".md5 exists. If so the contents are compared with md5. If equal FALSE is returned. The .md5 is created or updated after successful creation of the output file.

Definition at line 43 of file dotgraph.cpp.

45{
46 bool same = false;
47 char md5stored[33];
48 md5stored[0]=0;
49 std::ifstream f = Portable::openInputStream(baseName+".md5",true);
50 if (f.is_open())
51 {
52 // read checksum
53 f.read(md5stored,32);
54 md5stored[32]='\0';
55 // compare checksum
56 if (!f.fail() && md5==md5stored)
57 {
58 same = true;
59 }
60 //printf("sameSignature(%s,%s==%s)=%d\n",qPrint(baseName),md5stored,qPrint(md5),same);
61 }
62 else
63 {
64 //printf("sameSignature(%s) not found\n",qPrint(baseName));
65 }
66 return same;
67}
std::ifstream openInputStream(const QCString &name, bool binary=false, bool openAtEnd=false)
Definition portable.cpp:676

References Portable::openInputStream().

Referenced by DotGraph::prepareDotFile().

Variable Documentation

◆ g_dotIndexListMutex

std::mutex g_dotIndexListMutex

Definition at line 113 of file dotgraph.cpp.

Referenced by DotGraph::writeGraph().