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