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.

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

Function Documentation

◆ deliverablesPresent()

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

Definition at line 67 of file dotgraph.cpp.

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

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

Referenced by DotGraph::prepareDotFile().

◆ insertMapFile()

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

Definition at line 84 of file dotgraph.cpp.

86{
87 FileInfo fi(mapFile.str());
88 if (fi.exists() && fi.size()>0) // reuse existing map file
89 {
90 TextStream t;
91 DotFilePatcher::convertMapFile(t,mapFile,relPath,false);
92 if (!t.empty())
93 {
94 out << "<map name=\"" << mapLabel << "\" id=\"" << mapLabel << "\">\n";
95 out << t.str();
96 out << "</map>\n";
97 }
98 return true;
99 }
100 return false; // no map file yet, need to generate it
101}
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:240
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:216

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

Referenced by DotGraph::generateCode().

◆ sameMd5Signature()

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 41 of file dotgraph.cpp.

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

References Portable::openInputStream().

Referenced by DotGraph::prepareDotFile().

Variable Documentation

◆ g_dotIndexListMutex

std::mutex g_dotIndexListMutex

Definition at line 111 of file dotgraph.cpp.

Referenced by DotGraph::writeGraph().