Add GNU LGPL headers to all .c .C and .h files
[oweals/cde.git] / cde / programs / nsgmls / PosixStorage.h
1 /*
2  * CDE - Common Desktop Environment
3  *
4  * Copyright (c) 1993-2012, The Open Group. All rights reserved.
5  *
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)
10  * any later version.
11  *
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
16  * details.
17  *
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
22  */
23 /* $XConsortium: PosixStorage.h /main/1 1996/07/29 17:01:53 cde-hp $ */
24 // Copyright (c) 1994, 1995 James Clark
25 // See the file COPYING for copying permission.
26
27 #ifndef PosixStorage_INCLUDED
28 #define PosixStorage_INCLUDED 1
29 #ifdef __GNUG__
30 #pragma interface
31 #endif
32
33 #include "StorageManager.h"
34 #include "DescriptorManager.h"
35 #include "Vector.h"
36 #include "StringC.h"
37 #include "CharsetInfo.h"
38
39 #ifdef SP_NAMESPACE
40 namespace SP_NAMESPACE {
41 #endif
42
43 class Messenger;
44 class CharsetInfo;
45 class UnivCharsetDesc;
46 class Filename;
47 class OutputCodingSystem;
48
49 class SP_API PosixStorageManager : public IdStorageManager {
50 public:
51   PosixStorageManager(const char *type,
52                       const UnivCharsetDesc &filenameCharset,
53 #ifndef SP_WIDE_SYSTEM
54                       const OutputCodingSystem *filenameCodingSystem,
55 #endif
56                       int maxFDs);
57   StorageObject *makeStorageObject(const StringC &id,
58                                    const StringC &baseId,
59                                    Boolean search,
60                                    Boolean mayRewind,
61                                    Messenger &,
62                                    StringC &foundId);
63   Boolean resolveRelative(const StringC &, StringC &, Boolean syntactic = 0)
64     const;
65   const char *type() const;
66   void addSearchDir(const StringC &);
67   Boolean transformNeutral(StringC &, Boolean fold, Messenger &) const;
68 private:
69   Boolean isAbsolute(const StringC &) const;
70   StringC extractDir(const StringC &) const;
71   StringC combineDir(const StringC &, const StringC &) const;
72   PosixStorageManager(const PosixStorageManager &); // undefined
73   void operator=(const PosixStorageManager &);      // undefined
74   DescriptorManager descriptorManager_;
75 #ifndef SP_WIDE_SYSTEM
76   const OutputCodingSystem *filenameCodingSystem_;
77 #endif
78   const char *type_;
79   Vector<StringC> searchDirs_;
80 };
81
82 class SP_API PosixFdStorageManager : public IdStorageManager {
83 public:
84   PosixFdStorageManager(const char *type,
85                         const UnivCharsetDesc &filenameCharset);
86   StorageObject *makeStorageObject(const StringC &id,
87                                    const StringC &baseId,
88                                    Boolean,
89                                    Boolean mayRewind,
90                                    Messenger &mgr,
91                                    StringC &foundId);
92   const char *type() const;
93   Boolean inheritable() const;
94 private:
95   PosixFdStorageManager(const PosixFdStorageManager &); // undefined
96   void operator=(const PosixFdStorageManager &);            // undefined
97   const char *type_;
98
99 };
100
101 #ifdef SP_NAMESPACE
102 }
103 #endif
104
105 #endif /* not PosixStorage_INCLUDED */