"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/sgmlnorm/SGMLGenerator.h" (14 May 2005, 2097 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "SGMLGenerator.h" see the Fossies "Dox" file reference documentation.

    1 // Copyright (c) 1995 James Clark
    2 // See the file COPYING for copying permission.
    3 
    4 #ifndef SGMLGenerator_INCLUDED
    5 #define SGMLGenerator_INCLUDED 1
    6 #ifdef __GNUG__
    7 #pragma interface
    8 #endif
    9 
   10 #include "Boolean.h"
   11 #include "OutputCharStream.h"
   12 #include "StringOf.h"
   13 #include "StringC.h"
   14 
   15 #include "SGMLApplication.h"
   16 
   17 class SGMLGenerator : public SGMLApplication {
   18 public:
   19   enum {
   20     generateDtd = 01
   21   };
   22   SGMLGenerator(SP_NAMESPACE_SCOPE OutputCharStream *, unsigned flags = 0);
   23   ~SGMLGenerator();
   24   void startElement(const StartElementEvent &);
   25   void endElement(const EndElementEvent &);
   26   void data(const DataEvent &);
   27   void sdata(const SdataEvent &);
   28   void pi(const PiEvent &);
   29   void externalDataEntityRef(const ExternalDataEntityRefEvent &);
   30   void subdocEntityRef(const SubdocEntityRefEvent &);
   31   void nonSgmlChar(const NonSgmlCharEvent &);
   32   void endProlog(const EndPrologEvent &);
   33   void commentDecl(const CommentDeclEvent &);
   34   void markedSectionStart(const MarkedSectionStartEvent &);
   35   void markedSectionEnd(const MarkedSectionEndEvent &);
   36   void ignoredChars(const IgnoredCharsEvent &);
   37   void generalEntity(const GeneralEntityEvent &);
   38   void startDtd(const StartDtdEvent &);
   39 private:
   40   SP_NAMESPACE_SCOPE OutputCharStream &os();
   41   void numCharRef(Char);
   42   void numCharRefNum(unsigned long n);
   43   void entityRef(const CharString &);
   44   void flushRe();
   45   void outputRe();
   46   bool isSgmlChar(Char);
   47   void attributeChars(const CharString &str);
   48   SP_NAMESPACE_SCOPE StringC *charEntityName(Char);
   49 
   50   SP_NAMESPACE_SCOPE OutputCharStream *os_;
   51   enum {
   52     other,
   53     pendingRe,
   54     afterStartTag
   55     };
   56   char outputState_;
   57   SP_NAMESPACE_SCOPE String<char> outputStateStack_;
   58   SP_NAMESPACE_SCOPE String<char> isElementContentStack_;
   59   SP_NAMESPACE_SCOPE StringC lt_;
   60   SP_NAMESPACE_SCOPE StringC gt_;
   61   SP_NAMESPACE_SCOPE StringC amp_;
   62   SP_NAMESPACE_SCOPE StringC quot_;
   63   bool mustOmitEndTag_;
   64   enum {
   65     normalMode,
   66     cdataMode,
   67     rcdataMode
   68     } parseMode_;
   69   char nonSgml_[256];       // bool
   70   bool inInstance_;
   71   unsigned flags_;
   72 };
   73 
   74 #endif /* not SGMLGenerator_INCLUDED */