File: SGMLGenerator.h

package info (click to toggle)
opensp 1.5.2-15.2
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,168 kB
  • sloc: cpp: 65,784; ansic: 17,124; sh: 11,193; xml: 2,704; makefile: 895; perl: 561; yacc: 288; sed: 16
file content (74 lines) | stat: -rw-r--r-- 2,097 bytes parent folder | download | duplicates (22)
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// Copyright (c) 1995 James Clark
// See the file COPYING for copying permission.

#ifndef SGMLGenerator_INCLUDED
#define SGMLGenerator_INCLUDED 1
#ifdef __GNUG__
#pragma interface
#endif

#include "Boolean.h"
#include "OutputCharStream.h"
#include "StringOf.h"
#include "StringC.h"

#include "SGMLApplication.h"

class SGMLGenerator : public SGMLApplication {
public:
  enum {
    generateDtd = 01
  };
  SGMLGenerator(SP_NAMESPACE_SCOPE OutputCharStream *, unsigned flags = 0);
  ~SGMLGenerator();
  void startElement(const StartElementEvent &);
  void endElement(const EndElementEvent &);
  void data(const DataEvent &);
  void sdata(const SdataEvent &);
  void pi(const PiEvent &);
  void externalDataEntityRef(const ExternalDataEntityRefEvent &);
  void subdocEntityRef(const SubdocEntityRefEvent &);
  void nonSgmlChar(const NonSgmlCharEvent &);
  void endProlog(const EndPrologEvent &);
  void commentDecl(const CommentDeclEvent &);
  void markedSectionStart(const MarkedSectionStartEvent &);
  void markedSectionEnd(const MarkedSectionEndEvent &);
  void ignoredChars(const IgnoredCharsEvent &);
  void generalEntity(const GeneralEntityEvent &);
  void startDtd(const StartDtdEvent &);
private:
  SP_NAMESPACE_SCOPE OutputCharStream &os();
  void numCharRef(Char);
  void numCharRefNum(unsigned long n);
  void entityRef(const CharString &);
  void flushRe();
  void outputRe();
  bool isSgmlChar(Char);
  void attributeChars(const CharString &str);
  SP_NAMESPACE_SCOPE StringC *charEntityName(Char);

  SP_NAMESPACE_SCOPE OutputCharStream *os_;
  enum {
    other,
    pendingRe,
    afterStartTag
    };
  char outputState_;
  SP_NAMESPACE_SCOPE String<char> outputStateStack_;
  SP_NAMESPACE_SCOPE String<char> isElementContentStack_;
  SP_NAMESPACE_SCOPE StringC lt_;
  SP_NAMESPACE_SCOPE StringC gt_;
  SP_NAMESPACE_SCOPE StringC amp_;
  SP_NAMESPACE_SCOPE StringC quot_;
  bool mustOmitEndTag_;
  enum {
    normalMode,
    cdataMode,
    rcdataMode
    } parseMode_;
  char nonSgml_[256];		// bool
  bool inInstance_;
  unsigned flags_;
};

#endif /* not SGMLGenerator_INCLUDED */