1 /******************************************************************************
3 * $Id: outputgen.cpp,v 1.15 2001/03/19 19:27:41 root Exp $
5 * Copyright (C) 1997-2012 by Dimitri van Heesch.
7 * Permission to use, copy, modify, and distribute this software and its
8 * documentation under the terms of the GNU General Public License is hereby
9 * granted. No representations are made about the suitability of this software
10 * for any purpose. It is provided "as is" without express or implied warranty.
11 * See the GNU General Public License for more details.
13 * Documents produced by Doxygen are derivative works derived from the
14 * input used in their production; they are not affected by this license.
21 #include "outputgen.h"
25 OutputGenerator::OutputGenerator()
27 //printf("OutputGenerator::OutputGenerator()\n");
30 genStack = new QStack<bool>;
31 genStack->setAutoDelete(TRUE);
34 OutputGenerator::~OutputGenerator()
36 //printf("OutputGenerator::~OutputGenerator()\n");
41 void OutputGenerator::startPlainFile(const char *name)
43 //printf("startPlainFile(%s)\n",name);
44 fileName=dir+"/"+name;
45 file = new QFile(fileName);
48 err("Could not create file object for %s\n",fileName.data());
51 if (!file->open(IO_WriteOnly))
53 err("Could not open file %s for writing\n",fileName.data());
59 void OutputGenerator::endPlainFile()
67 void OutputGenerator::pushGeneratorState()
69 genStack->push(new bool(isEnabled()));
70 //printf("%p:pushGeneratorState(%d) enabled=%d\n",this,genStack->count(),isEnabled());
73 void OutputGenerator::popGeneratorState()
75 //printf("%p:popGeneratorState(%d) enabled=%d\n",this,genStack->count(),isEnabled());
76 bool *lb = genStack->pop();
78 if (lb==0) return; // for some robustness against superfluous \endhtmlonly commands.
79 if (*lb) enable(); else disable();