summaryrefslogtreecommitdiffstats
path: root/src/dotfilepatcher.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/dotfilepatcher.cpp')
-rw-r--r--src/dotfilepatcher.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp
index bb2bf15..326c1e1 100644
--- a/src/dotfilepatcher.cpp
+++ b/src/dotfilepatcher.cpp
@@ -123,7 +123,7 @@ static const char svgZoomFooter[] =
"</svg>\n"
;
-static QCString replaceRef(const QCString &buf,const QCString relPath,
+static QCString replaceRef(const QCString &buf,const QCString &relPath,
bool urlOnly,const QCString &context,const QCString &target=QCString())
{
// search for href="...", store ... part in link
@@ -152,7 +152,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
DocRef *df = new DocRef( (DocNode*) 0, link.mid(5), context );
result+=externalRef(relPath,df->ref(),TRUE);
if (!df->file().isEmpty())
- result += df->file().data() + Doxygen::htmlFileExtension;
+ result += df->file() + Doxygen::htmlFileExtension;
if (!df->anchor().isEmpty())
result += "#" + df->anchor();
delete df;
@@ -191,7 +191,7 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
QCString leftPart = buf.left(indexS);
QCString rightPart = buf.mid(indexE+1);
//printf("replaceRef(\n'%s'\n)->\n'%s+%s+%s'\n",
- // buf.data(),leftPart.data(),result.data(),rightPart.data());
+ // qPrint(buf),qPrint(leftPart),qPrint(result),qPrint(rightPart));
return leftPart + result + rightPart;
}
else
@@ -211,16 +211,16 @@ static QCString replaceRef(const QCString &buf,const QCString relPath,
* map file was found
* \returns TRUE if successful.
*/
-bool DotFilePatcher::convertMapFile(TextStream &t,const char *mapName,
- const QCString relPath, bool urlOnly,
+bool DotFilePatcher::convertMapFile(TextStream &t,const QCString &mapName,
+ const QCString &relPath, bool urlOnly,
const QCString &context)
{
- std::ifstream f(mapName,std::ifstream::in);
+ std::ifstream f(mapName.str(),std::ifstream::in);
if (!f.is_open())
{
err("problems opening map file %s for inclusion in the docs!\n"
"If you installed Graphviz/dot after a previous failing run, \n"
- "try deleting the output directory and rerun doxygen.\n",mapName);
+ "try deleting the output directory and rerun doxygen.\n",qPrint(mapName));
return FALSE;
}
std::string line;
@@ -245,7 +245,7 @@ bool DotFilePatcher::convertMapFile(TextStream &t,const char *mapName,
return TRUE;
}
-DotFilePatcher::DotFilePatcher(const char *patchFile)
+DotFilePatcher::DotFilePatcher(const QCString &patchFile)
: m_patchFile(patchFile)
{
}
@@ -291,7 +291,7 @@ int DotFilePatcher::addSVGObject(const QCString &baseName,
bool DotFilePatcher::run() const
{
- //printf("DotFilePatcher::run(): %s\n",m_patchFile.data());
+ //printf("DotFilePatcher::run(): %s\n",qPrint(m_patchFile));
bool interactiveSVG_local = Config_getBool(INTERACTIVE_SVG);
bool isSVGFile = m_patchFile.right(4)==".svg";
int graphId = -1;
@@ -303,14 +303,14 @@ bool DotFilePatcher::run() const
graphId = map.graphId;
relPath = map.relPath;
//printf("DotFilePatcher::addSVGConversion: file=%s zoomable=%d\n",
- // m_patchFile.data(),map->zoomable);
+ // qPrint(m_patchFile),map->zoomable);
}
std::string tmpName = m_patchFile.str()+".tmp";
std::string patchFile = m_patchFile.str();
Dir thisDir;
if (!thisDir.rename(patchFile,tmpName))
{
- err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.c_str());
+ err("Failed to rename file %s to %s!\n",qPrint(m_patchFile),tmpName.c_str());
return FALSE;
}
std::ifstream fi(tmpName, std::ifstream::in);
@@ -323,7 +323,7 @@ bool DotFilePatcher::run() const
}
if (!fo.is_open())
{
- err("problem opening file %s for patching!\n",m_patchFile.data());
+ err("problem opening file %s for patching!\n",qPrint(m_patchFile));
thisDir.rename(tmpName,patchFile);
return FALSE;
}
@@ -337,7 +337,7 @@ bool DotFilePatcher::run() const
while (getline(fi,lineStr))
{
QCString line = lineStr+'\n';
- //printf("line=[%s]\n",line.stripWhiteSpace().data());
+ //printf("line=[%s]\n",qPrint(line.stripWhiteSpace()));
int i;
if (isSVGFile)
{
@@ -392,16 +392,16 @@ bool DotFilePatcher::run() const
int e = std::max(line.find("--]"),line.find("-->"));
const Map &map = m_maps.at(mapId);
//printf("DotFilePatcher::writeSVGFigure: file=%s zoomable=%d\n",
- // m_patchFile.data(),map.zoomable);
+ // qPrint(m_patchFile),map.zoomable);
if (!writeSVGFigureLink(t,map.relPath,map.label,map.mapFile))
{
- err("Problem extracting size from SVG file %s\n",map.mapFile.data());
+ err("Problem extracting size from SVG file %s\n",qPrint(map.mapFile));
}
if (e!=-1) t << line.mid(e+3);
}
else // error invalid map id!
{
- err("Found invalid SVG id in file %s!\n",m_patchFile.data());
+ err("Found invalid SVG id in file %s!\n",qPrint(m_patchFile));
t << line.mid(i);
}
}
@@ -415,7 +415,7 @@ bool DotFilePatcher::run() const
TextStream tt;
const Map &map = m_maps.at(mapId);
//printf("patching MAP %d in file %s with contents of %s\n",
- // mapId,m_patchFile.data(),map.mapFile.data());
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
convertMapFile(tt,map.mapFile,map.relPath,map.urlOnly,map.context);
if (!tt.empty())
{
@@ -426,7 +426,7 @@ bool DotFilePatcher::run() const
}
else // error invalid map id!
{
- err("Found invalid MAP id in file %s!\n",m_patchFile.data());
+ err("Found invalid MAP id in file %s!\n",qPrint(m_patchFile));
t << line.mid(i);
}
}
@@ -434,12 +434,12 @@ bool DotFilePatcher::run() const
{
int mapId=-1;
int n = sscanf(line.data()+i+2,"FIG %d",&mapId);
- //printf("line='%s' n=%d\n",line.data()+i,n);
+ //printf("line='%s' n=%d\n",qPrint(line)+i,n);
if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
const Map &map = m_maps.at(mapId);
//printf("patching FIG %d in file %s with contents of %s\n",
- // mapId,m_patchFile.data(),map.mapFile.data());
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
if (!writeVecGfxFigure(t,map.label,map.mapFile))
{
err("problem writing FIG %d figure!\n",mapId);
@@ -448,7 +448,7 @@ bool DotFilePatcher::run() const
}
else // error invalid map id!
{
- err("Found invalid bounding FIG %d in file %s!\n",mapId,m_patchFile.data());
+ err("Found invalid bounding FIG %d in file %s!\n",mapId,qPrint(m_patchFile));
t << line;
}
}
@@ -468,7 +468,7 @@ bool DotFilePatcher::run() const
// keep original SVG file so we can refer to it, we do need to replace
// dummy link by real ones
fi.open(tmpName,std::ifstream::in);
- fo.open(orgName,std::ofstream::out | std::ofstream::binary);
+ fo.open(orgName.str(),std::ofstream::out | std::ofstream::binary);
if (!fi.is_open())
{
err("problem opening file %s for reading!\n",tmpName.c_str());
@@ -476,7 +476,7 @@ bool DotFilePatcher::run() const
}
if (!fo.is_open())
{
- err("problem opening file %s for writing!\n",orgName.data());
+ err("problem opening file %s for writing!\n",qPrint(orgName));
return FALSE;
}
t.setStream(&fo);