xref: /haiku/headers/os/storage/PathFinder.h (revision 8afbcbeb6fde6bed0a5ca500f71122dd1046008a)
1*8afbcbebSIngo Weinhold /*
2*8afbcbebSIngo Weinhold  * Copyright 2013, Haiku Inc. All Rights Reserved.
3*8afbcbebSIngo Weinhold  * Distributed under the terms of the MIT License.
4*8afbcbebSIngo Weinhold  */
5*8afbcbebSIngo Weinhold #ifndef _PATH_FINDER_H
6*8afbcbebSIngo Weinhold #define _PATH_FINDER_H
7*8afbcbebSIngo Weinhold 
8*8afbcbebSIngo Weinhold 
9*8afbcbebSIngo Weinhold #include <FindDirectory.h>
10*8afbcbebSIngo Weinhold #include <String.h>
11*8afbcbebSIngo Weinhold 
12*8afbcbebSIngo Weinhold 
13*8afbcbebSIngo Weinhold class BPath;
14*8afbcbebSIngo Weinhold class BStringList;
15*8afbcbebSIngo Weinhold struct entry_ref;
16*8afbcbebSIngo Weinhold 
17*8afbcbebSIngo Weinhold 
18*8afbcbebSIngo Weinhold class BPathFinder {
19*8afbcbebSIngo Weinhold public:
20*8afbcbebSIngo Weinhold 								BPathFinder(const void* codePointer = NULL,
21*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
22*8afbcbebSIngo Weinhold 								BPathFinder(const char* path,
23*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
24*8afbcbebSIngo Weinhold 								BPathFinder(const entry_ref& ref,
25*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
26*8afbcbebSIngo Weinhold 
27*8afbcbebSIngo Weinhold 			status_t			SetTo(const void* codePointer = NULL,
28*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
29*8afbcbebSIngo Weinhold 			status_t			SetTo(const char* path,
30*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
31*8afbcbebSIngo Weinhold 			status_t			SetTo(const entry_ref& ref,
32*8afbcbebSIngo Weinhold 									const char* dependency = NULL);
33*8afbcbebSIngo Weinhold 
34*8afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
35*8afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
36*8afbcbebSIngo Weinhold 									BPath& path);
37*8afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
38*8afbcbebSIngo Weinhold 									const char* subPath, BPath& path);
39*8afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
40*8afbcbebSIngo Weinhold 									BPath& path);
41*8afbcbebSIngo Weinhold 
42*8afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
43*8afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
44*8afbcbebSIngo Weinhold 							 		BStringList& paths);
45*8afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
46*8afbcbebSIngo Weinhold 									const char* subPath, BStringList& paths);
47*8afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
48*8afbcbebSIngo Weinhold 									BStringList& paths);
49*8afbcbebSIngo Weinhold 
50*8afbcbebSIngo Weinhold private:
51*8afbcbebSIngo Weinhold 			status_t			_SetTo(const void* codePointer,
52*8afbcbebSIngo Weinhold 									const char* path, const char* dependency);
53*8afbcbebSIngo Weinhold 
54*8afbcbebSIngo Weinhold private:
55*8afbcbebSIngo Weinhold 			const void*			fCodePointer;
56*8afbcbebSIngo Weinhold 			BString				fPath;
57*8afbcbebSIngo Weinhold 			BString				fDependency;
58*8afbcbebSIngo Weinhold 			status_t			fInitStatus;
59*8afbcbebSIngo Weinhold 			uint32				fReserved[4];
60*8afbcbebSIngo Weinhold };
61*8afbcbebSIngo Weinhold 
62*8afbcbebSIngo Weinhold 
63*8afbcbebSIngo Weinhold #endif	// _PATH_FINDER_H
64