summaryrefslogtreecommitdiffstats
path: root/doc/python10/summary.xml
blob: a8f8767e97fb70492a55d5a73c61bae027601bef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?xml version='1.0'?>
<!DOCTYPE sconsdoc [
    <!ENTITY % scons SYSTEM "../scons.mod">
    %scons;
]>

<section id="sect-summary"
         xmlns="http://www.scons.org/dbxsd/v1.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://www.scons.org/dbxsd/v1.0 http://www.scons.org/dbxsd/v1.0/scons.xsd">
<title>Summary</title>

<!--

  __COPYRIGHT__

  Permission is hereby granted, free of charge, to any person obtaining
  a copy of this software and associated documentation files (the
  "Software"), to deal in the Software without restriction, including
  without limitation the rights to use, copy, modify, merge, publish,
  distribute, sublicense, and/or sell copies of the Software, and to
  permit persons to whom the Software is furnished to do so, subject to
  the following conditions:

  The above copyright notice and this permission notice shall be included
  in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
  KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

-->

  <para>

    This paper has introduced &SCons;, a next-generation build tool
    with a modular, embeddable architecture and a direct Python
    interface. &SCons; has a global view of the dependencies in a source
    tree, uses MD5 signatures to decide if derived files are out of date,
    and automatically scans files for dependencies, all of which make &SCons;
    builds exceptionally reliable. The &SCons; development methodology has
    been described, notable for its emphasis on automated regression
    testing to ensure a robust and reliable tool from day one. Several
    future directions for &SCons; have also been discussed.

  </para>

</section>
; - while (s) + bool firstSpan=true; + for (const auto &s : sl) { - ol.docify(s); - s=sl.next(); - if (s) ol.writeString(""); + if (!firstSpan) + { + ol.writeString(""); + firstSpan=false; + } + ol.docify(s.c_str()); } ol.writeString(""); } diff --git a/src/code.l b/src/code.l index be1f179..90c1ff3 100644 --- a/src/code.l +++ b/src/code.l @@ -38,7 +38,6 @@ #include #include #include -#include #include "code.h" #include "entry.h" @@ -58,6 +57,7 @@ #include "tooltip.h" #include "scopedtypevariant.h" #include "symbolresolver.h" +#include "dir.h" // Toggle for some debugging info //#define DBG_CTX(x) fprintf x @@ -92,7 +92,7 @@ struct codeYY_state std::unordered_map< std::string, ScopedTypeVariant > codeClassMap; QCString curClassName; - QStrList curClassBases; + StringVector curClassBases; QCString parmType; QCString parmName; @@ -497,7 +497,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale if (ambig) // multiple input files match the name { DBG_CTX((stderr,"===== yes %s is ambiguous\n",yytext)); - QCString name = QDir::cleanDirPath(yytext).utf8(); + QCString name = Dir::cleanDirPath(yytext); if (!name.isEmpty() && yyextra->sourceFileDef) { const FileName *fn = Doxygen::inputNameLinkedMap->find(name); @@ -783,8 +783,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale DBG_CTX((stderr,"Adding new class %s\n",yyextra->curClassName.data())); ScopedTypeVariant var(yyextra->curClassName); // insert base classes. - char *s=yyextra->curClassBases.first(); - while (s) + for (const auto &s : yyextra->curClassBases) { const ClassDef *bcd=0; auto it = yyextra->codeClassMap.find(s); @@ -792,12 +791,11 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale { bcd = toClassDef(it->second.globalDef()); } - if (bcd==0) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s); + if (bcd==0) bcd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s.c_str()); if (bcd && bcd->name()!=yyextra->curClassName) { var.localDef()->insertBaseClass(bcd->name()); } - s=yyextra->curClassBases.next(); } yyextra->codeClassMap.emplace(std::make_pair(yyextra->curClassName.str(),std::move(var))); } @@ -819,7 +817,7 @@ ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"seale } {SEP}?({ID}{SEP})*{ID} { DBG_CTX((stderr,"%s:addBase(%s)\n",yyextra->curClassName.data(),yytext)); - yyextra->curClassBases.inSort(yytext); + yyextra->curClassBases.push_back(yytext); generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext); } "<" { diff --git a/src/configimpl.l b/src/configimpl.l index d237714..2f1aefc 100644 --- a/src/configimpl.l +++ b/src/configimpl.l @@ -27,11 +27,11 @@ #include #include -#include - #include #include +#include + #include "regex.h" #include "configimpl.h" #include "version.h" @@ -41,6 +41,7 @@ #include "lang_cfg.h" #include "configoptions.h" #include "fileinfo.h" +#include "dir.h" #define YY_NO_INPUT 1 #define YY_NO_UNISTD_H 1 @@ -1529,10 +1530,8 @@ void Config::checkAndCorrect() StringVector stripFromPath = Config_getList(STRIP_FROM_PATH); if (stripFromPath.empty()) // by default use the current path { - QString p = QDir::currentDirPath(); - if (p.at(p.length()-1)!='/') - p.append('/'); - stripFromPath.push_back(p.utf8().str()); + std::string p = Dir::currentDirPath()+"/"; + stripFromPath.push_back(p); } else { @@ -1871,7 +1870,7 @@ void Config::checkAndCorrect() if (inputSources.empty()) { // use current dir as the default - inputSources.push_back(QDir::currentDirPath().utf8().str()); + inputSources.push_back(Dir::currentDirPath()); } else { diff --git a/src/context.cpp b/src/context.cpp index f4614dd..dc7c31f 100644 --- a/src/context.cpp +++ b/src/context.cpp @@ -14,7 +14,6 @@ */ #include -#include #include "context.h" #include "config.h" @@ -54,6 +53,7 @@ #include "groupdef.h" #include "searchindex.h" #include "resourcemgr.h" +#include "dir.h" // TODO: pass the current file to Dot*::writeGraph, so the user can put dot graphs in other // files as well @@ -4687,16 +4687,11 @@ class MemberContext::Private : public DefinitionContext Cachable &cache = getCache(); if (!cache.labels) { - QStrList sl; - m_memberDef->getLabels(sl,m_memberDef->getOuterScope()); + StringVector sl = m_memberDef->getLabels(m_memberDef->getOuterScope()); TemplateList *tl = TemplateList::alloc(); - if (sl.count()>0) + for (const auto &s : sl) { - QStrListIterator it(sl); - for (;it.current();++it) - { - tl->append(*it); - } + tl->append(s.c_str()); } cache.labels.reset(tl); } @@ -10118,7 +10113,7 @@ void generateOutputViaTemplate() g_globals.outputFormat = ContextOutputFormat_Html; g_globals.dynSectionId = 0; g_globals.outputDir = Config_getString(HTML_OUTPUT); - QDir dir(g_globals.outputDir); + Dir dir(g_globals.outputDir.str()); createSubDirs(dir); HtmlEscaper htmlEsc; ctx->setEscapeIntf(Config_getString(HTML_FILE_EXTENSION),&htmlEsc); @@ -10143,7 +10138,7 @@ void generateOutputViaTemplate() g_globals.outputFormat = ContextOutputFormat_Latex; g_globals.dynSectionId = 0; g_globals.outputDir = Config_getString(LATEX_OUTPUT); - QDir dir(g_globals.outputDir); + Dir dir(g_globals.outputDir.str()); createSubDirs(dir); LatexEscaper latexEsc; ctx->setEscapeIntf(".tex",&latexEsc); @@ -10173,17 +10168,17 @@ void generateOutputViaTemplate() void generateTemplateFiles(const char *templateDir) { if (!templateDir) return; - QDir thisDir; + Dir thisDir; if (!thisDir.exists(templateDir) && !thisDir.mkdir(templateDir)) { err("Failed to create output directory '%s'\n",templateDir); return; } - QCString outDir = QCString(templateDir)+"/html"; + std::string outDir = std::string(templateDir)+"/html"; if (!thisDir.exists(outDir) && !thisDir.mkdir(outDir)) { - err("Failed to create output directory '%s'\n",outDir.data()); + err("Failed to create output directory '%s'\n",outDir.c_str()); return; } - ResourceMgr::instance().writeCategory("html",outDir); + ResourceMgr::instance().writeCategory("html",outDir.c_str()); } diff --git a/src/defgen.cpp b/src/defgen.cpp index 1cb09f5..4ad2d41 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -33,8 +33,8 @@ #include "namespacedef.h" #include "filedef.h" #include "filename.h" +#include "dir.h" -#include #include #define DEF_DB(x) @@ -522,50 +522,15 @@ static void generateDEFForFile(const FileDef *fd,FTextStream &t) void generateDEF() { - QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY); - if (outputDirectory.isEmpty()) - { - outputDirectory=QDir::currentDirPath().utf8(); - } - else - { - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - term("tag OUTPUT_DIRECTORY: Output directory '%s' does not " - "exist and cannot be created\n",outputDirectory.data()); - } - else - { - msg("Notice: Output directory '%s' does not exist. " - "I have created it for you.\n", outputDirectory.data()); - } - dir.cd(outputDirectory); - } - outputDirectory=dir.absPath().utf8(); - } - - QDir dir(outputDirectory); - if (!dir.exists()) - { - dir.setPath(QDir::currentDirPath()); - if (!dir.mkdir(outputDirectory)) - { - err("Cannot create directory %s\n",outputDirectory.data()); - return; - } - } - QDir defDir(outputDirectory+"/def"); - if (!defDir.exists() && !defDir.mkdir(outputDirectory+"/def")) + QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY)+"/def"; + Dir defDir(outputDirectory.str()); + if (!defDir.exists() && !defDir.mkdir(outputDirectory.str())) { err("Could not create def directory in %s\n",outputDirectory.data()); return; } - QCString fileName=outputDirectory+"/def/doxygen.def"; + QCString fileName=outputDirectory+"/doxygen.def"; QFile f(fileName); if (!f.open(IO_WriteOnly)) { diff --git a/src/dia.cpp b/src/dia.cpp index 4a00a17..11c5270 100644 --- a/src/dia.cpp +++ b/src/dia.cpp @@ -1,12 +1,10 @@ /****************************************************************************** * - * - * - * Copyright (C) 1997-2015 by Dimitri van Heesch. + * Copyright (C) 1997-2021 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -20,8 +18,8 @@ #include "config.h" #include "message.h" #include "util.h" +#include "dir.h" -#include static const int maxCmdLine = 40960; @@ -33,10 +31,10 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir, absOutFile+=outFile; // chdir to the output dir, so dot can find the font file. - QCString oldDir = QDir::currentDirPath().utf8(); + std::string oldDir = Dir::currentDirPath(); // go to the html output directory (i.e. path) - QDir::setCurrent(outDir); - //printf("Going to dir %s\n",QDir::currentDirPath().data()); + Dir::setCurrent(outDir); + //printf("Going to dir %s\n",Dir::currentDirPath().c_str()); QCString diaExe = Config_getString(DIA_PATH)+"dia"+Portable::commandExtension(); QCString diaArgs; QCString extension; @@ -85,6 +83,6 @@ void writeDiaGraphFromFile(const char *inFile,const char *outDir, } error: - QDir::setCurrent(oldDir); + Dir::setCurrent(oldDir); } diff --git a/src/dir.cpp b/src/dir.cpp new file mode 100644 index 0000000..caef5c7 --- /dev/null +++ b/src/dir.cpp @@ -0,0 +1,292 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2021 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#include "filesystem.hpp" +#include "dir.h" + +namespace fs = ghc::filesystem; + +//----------------------------------------------------------------------------------------------- + +struct DirEntry::Private +{ + fs::directory_entry entry; +}; + +DirEntry::DirEntry() : p(std::make_unique()) +{ +} + +DirEntry::~DirEntry() +{ +} + +bool DirEntry::is_directory() const +{ + return p->entry.is_directory(); +} + +bool DirEntry::is_regular_file() const +{ + return p->entry.is_regular_file(); +} + +bool DirEntry::is_symlink() const +{ + return p->entry.is_symlink(); +} + +std::string DirEntry::path() const +{ + return p->entry.path().string(); +} + +//----------------------------------------------------------------------------------------------- + +struct DirIterator::Private +{ + Private() : it() {} + Private(const std::string &path) : it(path) {} + fs::directory_iterator it; + mutable DirEntry current; +}; + +DirIterator::DirIterator() : p(std::make_unique()) +{ +} + +DirIterator::DirIterator(const std::string &path) : p(std::make_unique(path)) +{ +} + +DirIterator::DirIterator(const DirIterator &it) : p(std::make_unique()) +{ + p->it = it.p->it; +} + +DirIterator::~DirIterator() +{ +} + +DirIterator &DirIterator::operator=(const DirIterator &it) +{ + if (&it!=this) + { + p->it = it.p->it; + } + return *this; +} + +DirIterator DirIterator::operator++() +{ + DirIterator result; + result.p->it = ++p->it; + return result; +} + +const DirIterator::value_type &DirIterator::operator*() const +{ + p->current.p->entry = *p->it; + return p->current; +} + +const DirIterator::value_type *DirIterator::operator->() const +{ + p->current.p->entry = *p->it; + return &p->current; +} + +bool operator==(const DirIterator &it1,const DirIterator &it2) +{ + return it1.p->it!=it2.p->it; +} + +bool operator!=(const DirIterator &it1,const DirIterator &it2) +{ + return it1.p->it!=it2.p->it; +} + +DirIterator begin(DirIterator it) noexcept +{ + return it; +} + +DirIterator end(const DirIterator &) noexcept +{ + return DirIterator(); +} + + +//----------------------------------------------------------------------------------------------- + + +struct Dir::Private +{ + fs::path path; +}; + +Dir::Dir() : p(std::make_unique()) +{ + std::error_code ec; + p->path = fs::current_path(ec); +} + +Dir::Dir(const Dir &d) : p(std::make_unique()) +{ + p->path = d.p->path; +} + +Dir &Dir::operator=(const Dir &d) +{ + if (&d!=this) + { + p->path = d.p->path; + } + return *this; +} + +Dir::Dir(const std::string &path) : p(std::make_unique()) +{ + setPath(path); +} + +Dir::~Dir() +{ +} + +void Dir::setPath(const std::string &path) +{ + p->path = path; +} + +std::string Dir::path() const +{ + return p->path.string(); +} + +DirIterator Dir::iterator() const +{ + return DirIterator(p->path.string()); +} + +static void correctPath(std::string &s) +{ + std::replace( s.begin(), s.end(), '\\', '/' ); +} + +bool Dir::exists(const std::string &path,bool acceptsAbsPath) const +{ + std::string result = filePath(path,acceptsAbsPath); + std::error_code ec; + bool exist = fs::exists(fs::path(result),ec); + return !ec && exist; +} + +bool Dir::exists() const +{ + return exists(p->path.string()); +} + +bool Dir::isRelative() const +{ + return isRelativePath(p->path.string()); +} + +bool Dir::isRelativePath(const std::string &path) +{ + return fs::path(path).is_relative(); +} + +std::string Dir::filePath(const std::string &path,bool acceptsAbsPath) const +{ + std::string result; + if (acceptsAbsPath && !isRelativePath(path)) + { + result = path; + } + else + { + result = (p->path / path).string(); + } + correctPath(result); + return result; +} + +bool Dir::mkdir(const std::string &path,bool acceptsAbsPath) const +{ + std::error_code ec; + std::string result = filePath(path,acceptsAbsPath); + if (exists(path,acceptsAbsPath)) + { + return true; + } + else + { + return fs::create_directory(result,ec); + } +} + +bool Dir::rmdir(const std::string &path,bool acceptsAbsPath) const +{ + return remove(path,acceptsAbsPath); +} + +bool Dir::remove(const std::string &path,bool acceptsAbsPath) const +{ + std::error_code ec; + std::string result = filePath(path,acceptsAbsPath); + return fs::remove(result,ec); +} + +bool Dir::rename(const std::string &orgName,const std::string &newName,bool acceptsAbsPath) const +{ + std::error_code ec; + std::string fn1 = filePath(orgName,acceptsAbsPath); + std::string fn2 = filePath(newName,acceptsAbsPath); + fs::rename(fn1,fn2,ec); + return !ec; +} + +std::string Dir::currentDirPath() +{ + std::error_code ec; + std::string result = fs::current_path(ec).string(); + correctPath(result); + return result; +} + +bool Dir::setCurrent(const std::string &path) +{ + std::error_code ec; + fs::current_path(path,ec); + return !ec; +} + +std::string Dir::cleanDirPath(const std::string &path) +{ + std::error_code ec; + std::string result = fs::path(path).lexically_normal().string(); + correctPath(result); + return result; +} + +std::string Dir::absPath() const +{ + std::error_code ec; + std::string result = fs::absolute(p->path,ec).string(); + correctPath(result); + return result; +} + diff --git a/src/dir.h b/src/dir.h new file mode 100644 index 0000000..c02c60d --- /dev/null +++ b/src/dir.h @@ -0,0 +1,103 @@ +/****************************************************************************** + * + * Copyright (C) 1997-2021 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#ifndef DIR_H +#define DIR_H + +#include +#include + +#include "fileinfo.h" + +class DirEntry +{ + public: + ~DirEntry(); + bool is_directory() const; + bool is_regular_file() const; + bool is_symlink() const; + std::string path() const; + private: + friend class DirIterator; + DirEntry(); + struct Private; + std::unique_ptr p; +}; + +class DirIterator +{ + public: + using value_type = DirEntry; + using difference_type = std::ptrdiff_t; + using pointer = value_type*; + using reference = value_type&; + using iterator_category = std::input_iterator_tag; + DirIterator(const DirIterator &it); + DirIterator &operator=(const DirIterator &it); + DirIterator operator++(); + const value_type &operator*() const; + const value_type *operator->() const; + + friend bool operator==(const DirIterator &it1,const DirIterator &it2); + friend bool operator!=(const DirIterator &it1,const DirIterator &it2); + friend DirIterator begin(DirIterator it) noexcept; + friend DirIterator end(const DirIterator &) noexcept; + ~DirIterator(); + + private: + friend class Dir; + DirIterator(); + DirIterator(const std::string &path); + struct Private; + std::unique_ptr p; +}; + +/** Class representing a directory in the file system */ +class Dir final +{ + public: + Dir(); + Dir(const std::string &path); + Dir(const Dir &d); + Dir &operator=(const Dir &d); + ~Dir(); + void setPath(const std::string &path); + std::string path() const; + + DirIterator iterator() const; + + bool exists() const; + std::string filePath(const std::string &path,bool acceptsAbsPath=true) const; + bool exists(const std::string &path,bool acceptsAbsPath=true) const; + bool mkdir(const std::string &path,bool acceptsAbsPath=true) const; + bool rmdir(const std::string &path,bool acceptsAbsPath=true) const; + bool remove(const std::string &path,bool acceptsAbsPath=true) const; + bool rename(const std::string &orgName,const std::string &newName, + bool acceptsAbsPath=true) const; + std::string absPath() const; + + bool isRelative() const; + + static bool isRelativePath(const std::string &path); + static std::string currentDirPath(); + static bool setCurrent(const std::string &path); + static std::string cleanDirPath(const std::string &path); + + private: + struct Private; + std::unique_ptr p; +}; + +#endif diff --git a/src/dirdef.h b/src/dirdef.h index 0e3db91..5bc49e7 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -24,7 +24,6 @@ #include class FileList; -class QStrList; class FileDef; class OutputList; class UsedDir; diff --git a/src/docbookgen.cpp b/src/docbookgen.cpp index 4319dda..1f10029 100644 --- a/src/docbookgen.cpp +++ b/src/docbookgen.cpp @@ -17,7 +17,6 @@ #include -#include #include #include "docbookgen.h" #include "doxygen.h" @@ -51,6 +50,7 @@ #include "membergroup.h" #include "dirdef.h" #include "section.h" +#include "dir.h" // no debug info #define Docbook_DB(x) do {} while(0) @@ -296,8 +296,8 @@ DB_GEN_C void DocbookGenerator::init() { QCString dir=Config_getString(DOCBOOK_OUTPUT); - QDir d(dir); - if (!d.exists() && !d.mkdir(dir)) + Dir d(dir.str()); + if (!d.exists() && !d.mkdir(dir.str())) { term("Could not create output directory %s\n",dir.data()); } diff --git a/src/dot.cpp b/src/dot.cpp index ddabbc7..cc0f070 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -16,8 +16,6 @@ #include #include -#include - #include "config.h" #include "dot.h" #include "dotrunner.h" @@ -29,6 +27,7 @@ #include "doxygen.h" #include "language.h" #include "index.h" +#include "dir.h" #define MAP_CMD "cmapx" @@ -273,7 +272,7 @@ bool DotManager::run() const void writeDotGraphFromFile(const char *inFile,const char *outDir, const char *outFile,GraphOutputFormat format) { - QDir d(outDir); + Dir d(outDir); if (!d.exists()) { term("Output dir %s does not exist!\n",outDir); @@ -281,8 +280,8 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, QCString imgExt = getDotImageExtension(); QCString imgName = (QCString)outFile+"."+imgExt; - QCString absImgName = d.absPath().utf8()+"/"+imgName; - QCString absOutFile = d.absPath().utf8()+"/"+outFile; + QCString absImgName = QCString(d.absPath())+"/"+imgName; + QCString absOutFile = QCString(d.absPath())+"/"+outFile; DotRunner dotRun(inFile); if (format==GOF_BITMAP) @@ -326,7 +325,7 @@ void writeDotImageMapFromFile(FTextStream &t, const QCString &context,int graphId) { - QDir d(outDir); + Dir d(outDir.str()); if (!d.exists()) { term("Output dir %s does not exist!\n",outDir.data()); @@ -335,7 +334,7 @@ void writeDotImageMapFromFile(FTextStream &t, QCString mapName = baseName+".map"; QCString imgExt = getDotImageExtension(); QCString imgName = baseName+"."+imgExt; - QCString absOutFile = d.absPath().utf8()+"/"+mapName; + QCString absOutFile = QCString(d.absPath())+"/"+mapName; DotRunner dotRun(inFile.data()); dotRun.addJob(MAP_CMD,absOutFile); @@ -368,5 +367,5 @@ void writeDotImageMapFromFile(FTextStream &t, t << "" << endl; } } - d.remove(absOutFile); + d.remove(absOutFile.str()); } diff --git a/src/dotfilepatcher.cpp b/src/dotfilepatcher.cpp index aafca34..4960cf4 100644 --- a/src/dotfilepatcher.cpp +++ b/src/dotfilepatcher.cpp @@ -18,13 +18,13 @@ #include "qstring.h" #include "config.h" -#include "qdir.h" #include "message.h" #include "ftextstream.h" #include "docparser.h" #include "doxygen.h" #include "util.h" #include "dot.h" +#include "dir.h" static const char svgZoomHeader[] = "\n" @@ -312,25 +312,26 @@ bool DotFilePatcher::run() const //printf("DotFilePatcher::addSVGConversion: file=%s zoomable=%d\n", // m_patchFile.data(),map->zoomable); } - QCString tmpName = m_patchFile+".tmp"; - QCString patchFile = m_patchFile; - if (!QDir::current().rename(patchFile,tmpName)) + 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.data()); + err("Failed to rename file %s to %s!\n",m_patchFile.data(),tmpName.c_str()); return FALSE; } - QFile fi(tmpName); - QFile fo(patchFile); + QFile fi(tmpName.c_str()); + QFile fo(patchFile.c_str()); if (!fi.open(IO_ReadOnly)) { - err("problem opening file %s for patching!\n",tmpName.data()); - QDir::current().rename(tmpName,patchFile); + err("problem opening file %s for patching!\n",tmpName.c_str()); + thisDir.rename(tmpName,patchFile); return FALSE; } if (!fo.open(IO_WriteOnly)) { err("problem opening file %s for patching!\n",m_patchFile.data()); - QDir::current().rename(tmpName,patchFile); + thisDir.rename(tmpName,patchFile); return FALSE; } FTextStream t(&fo); @@ -481,11 +482,11 @@ bool DotFilePatcher::run() const fo.close(); // keep original SVG file so we can refer to it, we do need to replace // dummy link by real ones - fi.setName(tmpName); + fi.setName(tmpName.c_str()); fo.setName(orgName); if (!fi.open(IO_ReadOnly)) { - err("problem opening file %s for reading!\n",tmpName.data()); + err("problem opening file %s for reading!\n",tmpName.c_str()); return FALSE; } if (!fo.open(IO_Write