diff options
author | mueller <mueller@afe2bf4a-e733-0410-8a33-86f594647bc7> | 1999-12-15 19:25:10 (GMT) |
---|---|---|
committer | mueller <mueller@afe2bf4a-e733-0410-8a33-86f594647bc7> | 1999-12-15 19:25:10 (GMT) |
commit | 719f0a35063be88eddcc4ed8fe7a940de47ef20c (patch) | |
tree | cc1cd70cf5761ddf72ff114c0b65576c3f4c1d2a /src/outputgen.cpp | |
parent | bd30c025c4651ddda467f1af09d4c7ccab397bde (diff) | |
download | Doxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.zip Doxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.tar.gz Doxygen-719f0a35063be88eddcc4ed8fe7a940de47ef20c.tar.bz2 |
initial version
Diffstat (limited to 'src/outputgen.cpp')
-rw-r--r-- | src/outputgen.cpp | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/src/outputgen.cpp b/src/outputgen.cpp new file mode 100644 index 0000000..ca07302 --- /dev/null +++ b/src/outputgen.cpp @@ -0,0 +1,77 @@ +/****************************************************************************** + * + * $Id$ + * + * Copyright (C) 1997-1999 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. + * + * All output generated with Doxygen is not covered by this license. + * + */ + +#include <stdlib.h> +#include "outputgen.h" +#include <qstring.h> +#include "message.h" + +OutputGenerator::OutputGenerator() +{ + //printf("OutputGenerator::OutputGenerator()\n"); + file=0; + b.setBuffer(a); + b.open( IO_WriteOnly ); + t.setDevice(&b); + active=TRUE; +} + +OutputGenerator::~OutputGenerator() +{ + //printf("OutputGenerator::~OutputGenerator()\n"); + delete file; +} + +void OutputGenerator::startPlainFile(const char *name) +{ + //printf("startPlainFile(%s)\n",name); + QString fileName=dir+"/"+name; + file = new QFile(fileName); + if (!file) + { + err("Could not create file object for %s\n",fileName.data()); + exit(1); + } + if (!file->open(IO_WriteOnly)) + { + err("Could not open file %s for writing\n",fileName.data()); + exit(1); + } + fs.setDevice(file); +} + +void OutputGenerator::endPlainFile() +{ + //printf("endPlainFile(%s)\n",file->name()); + fs.writeRawBytes(a.data(),a.size()) ; // write string buffer to file + delete file; + file=0; + b.close(); + a.resize(0); + b.setBuffer(a); + b.open(IO_WriteOnly); + t.setDevice(&b); +} + +QString OutputGenerator::getContents() const +{ + QString s; + s.resize(a.size()+1); + memcpy(s.data(),a.data(),a.size()); + s.at(a.size())='\0'; + return s; +} + |