summaryrefslogtreecommitdiff
path: root/utils/DirPath.h
blob: 538a4ff2cf074eff0d66f2aabfed0090d2a4ae84 (plain)
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
/*
 *	CENA C++ Utilities
 *
 *	by Stephane Chatty
 *
 *	Copyright 1991, 1992
 *	Laboratoire de Recherche en Informatique (LRI)
 *	Centre d'Etudes de la Navigation Aerienne (CENA)
 *
 *	management of search paths
 *
 *	$Id$
 *	$CurLog$
 */

#ifndef DirPath_H_
#define DirPath_H_

#include "cplus_bugs.h"
#include "List.h"

class IvlDirPath : public IvlList {
public:
	enum	alloc_mode	{ DontAllocNames, DoAllocNames };
private:
	alloc_mode	Alloc;
public:
		IvlDirPath ();
		IvlDirPath (alloc_mode);
		IvlDirPath (const char*);
		IvlDirPath (const char*, const char*, ...);
		~IvlDirPath ();
	void	Append (const char*);
	void Prepend (const char*);
	void	AppendEnvPath (const char*, char sep = ':');
	int	Remove (const char*);
inline	void	SetAlloc (alloc_mode alloc)		{ Alloc = alloc; }
	const char*	FindFile (const char*, alloc_mode);
inline	const char*	FindFile (const char* fn)	{ return FindFile (fn, Alloc); }
};

#endif	/* DirPath_H_ */