2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 /* $XConsortium: ExtendEntityManager.h /main/1 1996/07/29 16:51:47 cde-hp $ */
24 // Copyright (c) 1994, 1995 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef ExtendEntityManager_INCLUDED
28 #define ExtendEntityManager_INCLUDED 1
34 #include "EntityManager.h"
35 #include "CharsetInfo.h"
44 namespace SP_NAMESPACE {
48 class InputCodingSystem;
51 struct SP_API StorageObjectSpec {
53 StorageManager *storageManager;
54 const char *codingSystemName;
55 const InputCodingSystem *codingSystem;
56 StringC specId; // specified id
57 StringC baseId; // id that specified id is relative to
58 StringC id; // actual id used (filled in after opening)
67 PackedBoolean notrack;
68 PackedBoolean zapEof; // zap a final Ctrl-Z
72 struct SP_API ParsedSystemIdMap {
81 struct SP_API ParsedSystemId : public Vector<StorageObjectSpec> {
83 void unparse(const CharsetInfo &charset, StringC &result) const;
84 Vector<ParsedSystemIdMap> maps;
87 struct SP_API StorageObjectLocation {
88 const StorageObjectSpec *storageObjectSpec;
89 unsigned long lineNumber;
90 unsigned long columnNumber;
91 unsigned long byteIndex;
92 unsigned long storageObjectOffset;
95 class SP_API ExtendEntityManager : public EntityManager {
97 class SP_API CatalogManager {
99 virtual ~CatalogManager();
100 virtual ConstPtr<EntityCatalog>
101 makeCatalog(StringC &systemId,
102 const CharsetInfo &charset,
103 ExtendEntityManager *,
104 Messenger &) const = 0;
105 virtual Boolean mapCatalog(ParsedSystemId &systemId,
106 ExtendEntityManager *em,
107 Messenger &mgr) const = 0;
109 virtual void registerStorageManager(StorageManager *) = 0;
110 virtual void registerCodingSystem(const char *, const InputCodingSystem *)
112 virtual void setCatalogManager(CatalogManager *) = 0;
113 virtual InputSource *openIfExists(const StringC &sysid,
118 virtual Boolean expandSystemId(const StringC &,
122 const StringC *mapCatalogPublic,
125 virtual Boolean mergeSystemIds(const Vector<StringC> &sysids,
126 Boolean mapCatalogDocument,
129 StringC &) const = 0;
130 virtual Boolean parseSystemId(const StringC &str,
131 const CharsetInfo &idCharset,
133 const StorageObjectSpec *defSpec,
135 ParsedSystemId &parsedSysid) const = 0;
136 static Boolean externalize(const ExternalInfo *,
138 StorageObjectLocation &);
139 static const ParsedSystemId *
140 externalInfoParsedSystemId(const ExternalInfo *);
141 static ExtendEntityManager *make(StorageManager *,
142 const InputCodingSystem *);
149 #endif /* not ExtendEntityManager_INCLUDED */