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: SearchPath.h /main/4 1996/03/27 14:39:41 barstow $ */
24 /*******************************************************************
25 ** (c) Copyright Hewlett-Packard Company, 1990, 1991, 1992, 1993.
26 ** All rights are reserved. Copying or other reproduction of this
27 ** program except for archival purposes is prohibited without prior
28 ** written consent of Hewlett-Packard Company.
29 ********************************************************************
30 ****************************<+>*************************************/
32 #ifndef _SEARCHPATH_H_
33 #define _SEARCHPATH_H_
47 SearchPath (CDEEnvironment *, const char *, const char *);
48 virtual ~SearchPath();
50 virtual void ExportPath();
52 virtual void AddPredefinedPath();
55 virtual void PrettyPrint (std::ostream &) const;
57 friend std::ostream & operator<< (std::ostream &, const SearchPath &);
59 virtual void PrettyPrint (ostream &) const;
61 friend ostream & operator<< (ostream &, const SearchPath &);
64 const char * GetEnvVar() const { return environment_var; }
65 CString GetSearchPath() const { return final_search_path; }
68 void AssembleString (const CString &);
70 void AddToPath (const CString &);
73 virtual void MakePath (const CString &) {}
74 virtual CString ConstructPath (const CString &, const CString *,
75 unsigned char useTT = 1);
77 int ParseState() const { return parse_state; }
78 CString Separator() const { return separator; }
80 virtual int validSearchPath (const CString &) const;
82 void setSeparator (const char * sep) { separator = sep; }
85 CString norm_search_path;
86 CString final_search_path;
87 CDEEnvironment * user;
90 const char * environment_var;
97 class AppSearchPath : public SearchPath {
99 AppSearchPath (CDEEnvironment *,
100 const char * = "DTAPP",
102 virtual ~AppSearchPath() {}
107 virtual void MakePath (const CString &);
113 class IconSearchPath : public SearchPath {
115 IconSearchPath (CDEEnvironment *,
116 const char * = "XMICON",
117 const char * = ".pm",
118 const char * = ".bm",
120 virtual ~IconSearchPath() {}
123 virtual void MakePath (const CString &);
124 virtual int validSearchPath (const CString &) const;
132 class DatabaseSearchPath : public SearchPath {
134 DatabaseSearchPath (CDEEnvironment *,
135 const char * = "DTDATABASE",
137 virtual ~DatabaseSearchPath() {}
140 virtual void MakePath (const CString &);
141 virtual CString ConstructPath (const CString &, const CString *,
142 unsigned char useTT = 0);
148 class HelpSearchPath : public SearchPath {
150 HelpSearchPath (CDEEnvironment *,
151 const char * = "DTHELP",
153 virtual ~HelpSearchPath() {}
156 virtual void MakePath (const CString &);
157 virtual int validSearchPath (const CString &) const;
163 class InfoLibSearchPath : public SearchPath {
165 InfoLibSearchPath (CDEEnvironment *,
166 const char * = "DTINFOLIB",
168 virtual ~InfoLibSearchPath() {}
171 virtual void MakePath (const CString &);
172 virtual int validSearchPath (const CString &) const;
178 class ManSearchPath : public SearchPath {
180 ManSearchPath (CDEEnvironment *,
181 const char * = "MANPATH",
183 virtual ~ManSearchPath() {}
185 virtual void ExportPath ();
186 virtual void Print();
189 friend std::ostream & operator<< (std::ostream &, const ManSearchPath &);
191 friend ostream & operator<< (ostream &, const ManSearchPath &);
195 virtual void MakePath (const CString &);