xref: /haiku/headers/os/storage/PathFinder.h (revision 62b164bd7174bb8cbb4f1617c91cd13b3b2a5ccb)
18afbcbebSIngo Weinhold /*
20eb197d4SIngo Weinhold  * Copyright 2013, Haiku, Inc. All Rights Reserved.
38afbcbebSIngo Weinhold  * Distributed under the terms of the MIT License.
48afbcbebSIngo Weinhold  */
58afbcbebSIngo Weinhold #ifndef _PATH_FINDER_H
68afbcbebSIngo Weinhold #define _PATH_FINDER_H
78afbcbebSIngo Weinhold 
88afbcbebSIngo Weinhold 
98afbcbebSIngo Weinhold #include <FindDirectory.h>
108afbcbebSIngo Weinhold #include <String.h>
118afbcbebSIngo Weinhold 
128afbcbebSIngo Weinhold 
138afbcbebSIngo Weinhold class BPath;
148afbcbebSIngo Weinhold class BStringList;
158afbcbebSIngo Weinhold struct entry_ref;
168afbcbebSIngo Weinhold 
178afbcbebSIngo Weinhold 
18*62b164bdSIngo Weinhold namespace BPackageKit {
19*62b164bdSIngo Weinhold 	class BPackageResolvableExpression;
20*62b164bdSIngo Weinhold }
21*62b164bdSIngo Weinhold 
22*62b164bdSIngo Weinhold 
238afbcbebSIngo Weinhold class BPathFinder {
248afbcbebSIngo Weinhold public:
25*62b164bdSIngo Weinhold 			typedef BPackageKit::BPackageResolvableExpression
26*62b164bdSIngo Weinhold 				BResolvableExpression;
27*62b164bdSIngo Weinhold 
28*62b164bdSIngo Weinhold public:
298afbcbebSIngo Weinhold 								BPathFinder(const void* codePointer = NULL,
308afbcbebSIngo Weinhold 									const char* dependency = NULL);
318afbcbebSIngo Weinhold 								BPathFinder(const char* path,
328afbcbebSIngo Weinhold 									const char* dependency = NULL);
338afbcbebSIngo Weinhold 								BPathFinder(const entry_ref& ref,
348afbcbebSIngo Weinhold 									const char* dependency = NULL);
35*62b164bdSIngo Weinhold 								BPathFinder(
36*62b164bdSIngo Weinhold 									const BResolvableExpression& expression,
37*62b164bdSIngo Weinhold 									const char* dependency = NULL);
38*62b164bdSIngo Weinhold 									// requires libpackage
398afbcbebSIngo Weinhold 
408afbcbebSIngo Weinhold 			status_t			SetTo(const void* codePointer = NULL,
418afbcbebSIngo Weinhold 									const char* dependency = NULL);
428afbcbebSIngo Weinhold 			status_t			SetTo(const char* path,
438afbcbebSIngo Weinhold 									const char* dependency = NULL);
448afbcbebSIngo Weinhold 			status_t			SetTo(const entry_ref& ref,
458afbcbebSIngo Weinhold 									const char* dependency = NULL);
46*62b164bdSIngo Weinhold 			status_t			SetTo(const BResolvableExpression& expression,
47*62b164bdSIngo Weinhold 									const char* dependency = NULL);
48*62b164bdSIngo Weinhold 									// requires libpackage
498afbcbebSIngo Weinhold 
5060b39cd7SIngo Weinhold 			status_t			FindPath(const char* architecture,
5160b39cd7SIngo Weinhold 									path_base_directory baseDirectory,
5260b39cd7SIngo Weinhold 									const char* subPath, uint32 flags,
530eb197d4SIngo Weinhold 									BPath& _path);
548afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
558afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
560eb197d4SIngo Weinhold 									BPath& _path);
578afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
580eb197d4SIngo Weinhold 									const char* subPath, BPath& _path);
598afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
600eb197d4SIngo Weinhold 									BPath& _path);
618afbcbebSIngo Weinhold 
6260b39cd7SIngo Weinhold 	static	status_t			FindPaths(const char* architecture,
6360b39cd7SIngo Weinhold 									path_base_directory baseDirectory,
6460b39cd7SIngo Weinhold 									const char* subPath, uint32 flags,
650eb197d4SIngo Weinhold 							 		BStringList& _paths);
668afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
678afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
680eb197d4SIngo Weinhold 							 		BStringList& _paths);
698afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
700eb197d4SIngo Weinhold 									const char* subPath, BStringList& _paths);
718afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
720eb197d4SIngo Weinhold 									BStringList& _paths);
738afbcbebSIngo Weinhold 
748afbcbebSIngo Weinhold private:
758afbcbebSIngo Weinhold 			status_t			_SetTo(const void* codePointer,
768afbcbebSIngo Weinhold 									const char* path, const char* dependency);
778afbcbebSIngo Weinhold 
788afbcbebSIngo Weinhold private:
798afbcbebSIngo Weinhold 			const void*			fCodePointer;
808afbcbebSIngo Weinhold 			BString				fPath;
818afbcbebSIngo Weinhold 			BString				fDependency;
828afbcbebSIngo Weinhold 			status_t			fInitStatus;
83*62b164bdSIngo Weinhold 			addr_t				fReserved[4];
848afbcbebSIngo Weinhold };
858afbcbebSIngo Weinhold 
868afbcbebSIngo Weinhold 
878afbcbebSIngo Weinhold #endif	// _PATH_FINDER_H
88