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

Go to the source code of this file.

Functions

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

Variables

std::mutex g_dotIndexListMutex

Function Documentation

◆ deliverablesPresent()

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

Definition at line 69 of file dotgraph.cpp.

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

References DString::empty(), FileInfo::exists(), FileInfo::size(), and DString::str().

Referenced by DotGraph::prepareDotFile().

◆ insertMapFile()

bool insertMapFile ( TextStream & out,
const DString & mapFile,
const DString & relPath,
const DString & 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 DString &mapName, const DString &relPath, bool urlOnly=false, const DString &context=DString())
Text streaming class that buffers data.
Definition textstream.h:36
bool empty() const
Returns true iff the buffer is empty.
Definition textstream.h:256
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:232

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

Referenced by DotGraph::generateCode().

◆ sameMd5Signature()

bool sameMd5Signature ( const DString & baseName,
const DString & 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 DString &name, bool binary=false, bool openAtEnd=false)
Definition portable.cpp:692

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().