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 libraries 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: StorageManager.h /main/1 1996/07/29 17:05:01 cde-hp $ */
24 // Copyright (c) 1994, 1995 James Clark
25 // See the file COPYING for copying permission.
27 #ifndef StorageManager_INCLUDED
28 #define StorageManager_INCLUDED 1
35 #include "CharsetInfo.h"
39 namespace SP_NAMESPACE {
45 class InputCodingSystem;
47 class SP_API StorageObject {
50 virtual ~StorageObject();
51 virtual Boolean read(char *buf, size_t bufSize, Messenger &,
53 virtual Boolean rewind(Messenger &) = 0;
54 virtual void willNotRewind();
55 virtual size_t getBlockSize() const;
57 StorageObject(const StorageObject &); // undefined
58 void operator=(const StorageObject &); // undefined
61 class SP_API StorageManager {
64 virtual StorageObject *makeStorageObject(const StringC &specId,
65 const StringC &baseId,
69 StringC &actualId) = 0;
70 virtual const char *type() const = 0;
71 virtual Boolean inheritable() const;
72 virtual Boolean transformNeutral(StringC &, Boolean fold, Messenger &) const;
73 // Resolve a possibly relative ID by examining the base and specified IDs.
74 // Put the resolved ID in specID.
75 // Return 0 if it cannot be resolved yet becase the specified ID is relative
76 // and physical searching is required to resolve it and search is true;
77 // in this case the base will be passed to makeStorageObject.
78 // Otherwise return 1; in this case the base will be discarded, and the
79 // resolved ID will be passed to makeStorageObject.
80 virtual Boolean resolveRelative(const StringC &base,
82 Boolean search) const;
83 virtual Boolean guessIsId(const StringC &, const CharsetInfo &) const;
84 virtual const InputCodingSystem *requiredCodingSystem() const;
85 virtual Boolean requiresCr() const;
86 virtual ~StorageManager();
87 virtual const CharsetInfo *idCharset() const;
88 virtual const StringC *reString() const;
90 StorageManager(const StorageManager &); // undefined
91 void operator=(const StorageManager &); // undefined
94 class SP_API IdStorageManager : public StorageManager {
96 IdStorageManager(const UnivCharsetDesc &idCharset);
97 const CharsetInfo *idCharset() const;
98 const StringC *reString() const;
102 IdStorageManager(const IdStorageManager &); // undefined
103 void operator=(const IdStorageManager &); // undefined
105 CharsetInfo idCharset_;
112 #endif /* not StorageManager_INCLUDED */