File: ExtendEntityManager.h

package info (click to toggle)
jade 1.2.1-43
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 8,808 kB
  • ctags: 16,989
  • sloc: cpp: 120,657; sh: 10,452; ansic: 8,228; perl: 378; makefile: 296; sed: 5
file content (129 lines) | stat: -rw-r--r-- 3,273 bytes parent folder | download | duplicates (15)
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
// Copyright (c) 1994, 1995 James Clark
// See the file COPYING for copying permission.

#ifndef ExtendEntityManager_INCLUDED
#define ExtendEntityManager_INCLUDED 1

#ifdef __GNUG__
#pragma interface
#endif

#include "EntityManager.h"
#include "CharsetInfo.h"
#include "types.h"
#include "Boolean.h"
#include "StringC.h"
#include "types.h"
#include "Vector.h"
#include "Location.h"
#include "CodingSystemKit.h"

#ifdef SP_NAMESPACE
namespace SP_NAMESPACE {
#endif

class StorageManager;
class InputCodingSystem;
class Messenger;

struct SP_API StorageObjectSpec {
  StorageObjectSpec();
  StorageManager *storageManager;
  const char *codingSystemName;
  const InputCodingSystem *codingSystem;
  StringC specId;		// specified id
  StringC baseId;		// id that specified id is relative to
  enum Records {
    find,
    cr,
    lf,
    crlf,
    asis
    };
  Records records;
  PackedBoolean notrack;
  PackedBoolean zapEof;		// zap a final Ctrl-Z
  PackedBoolean search;
  enum {
    encoding,
    bctf,
    special
  };
  char codingSystemType;
};


struct SP_API ParsedSystemId : public Vector<StorageObjectSpec> {
  ParsedSystemId();
  void unparse(const CharsetInfo &resultCharset, Boolean isNdata, StringC &result) const;
  struct SP_API Map {
    enum Type {
      catalogDocument,
      catalogPublic
    };
    Type type;
    StringC publicId;
  };
  Vector<Map> maps;
};

struct SP_API StorageObjectLocation {
  const StorageObjectSpec *storageObjectSpec;
  StringC actualStorageId;
  unsigned long lineNumber;
  unsigned long columnNumber;
  unsigned long byteIndex;
  unsigned long storageObjectOffset;
};

class SP_API ExtendEntityManager : public EntityManager {
public:
  class SP_API CatalogManager {
  public:
    virtual ~CatalogManager();
    virtual ConstPtr<EntityCatalog>
      makeCatalog(StringC &systemId,
		  const CharsetInfo &docCharset,
		  ExtendEntityManager *,
		  Messenger &) const = 0;
    virtual Boolean mapCatalog(ParsedSystemId &systemId,
			       ExtendEntityManager *em,
			       Messenger &mgr) const = 0;
  };
  // Additional flags for open.
  enum { mayNotExist = 0100, isNdata = 0200 };
  virtual void registerStorageManager(StorageManager *) = 0;
  virtual void setCatalogManager(CatalogManager *) = 0;
  virtual Boolean expandSystemId(const StringC &,
				 const Location &,
				 Boolean isNdata,
				 const CharsetInfo &,
				 const StringC *mapCatalogPublic,
				 Messenger &,
				 StringC &) = 0;
  virtual Boolean mergeSystemIds(const Vector<StringC> &sysids,
				 Boolean mapCatalogDocument,
				 const CharsetInfo &,
				 Messenger &mgr,
				 StringC &) const = 0;
  virtual Boolean parseSystemId(const StringC &str,
				const CharsetInfo &docCharset,
				Boolean isNdata,
				const StorageObjectLocation *defLoc,
				Messenger &mgr,
				ParsedSystemId &parsedSysid) const = 0;
  static const ParsedSystemId *externalInfoParsedSystemId(const ExternalInfo *);
  static Boolean externalize(const ExternalInfo *,
			     Offset,
			     StorageObjectLocation &);
  static ExtendEntityManager *make(StorageManager *,
				   const InputCodingSystem *,
				   const ConstPtr<InputCodingSystemKit> &,
				   Boolean internalCharsetIsDocCharset);
};

#ifdef SP_NAMESPACE
}
#endif

#endif /* not ExtendEntityManager_INCLUDED */