xref: /haiku/headers/os/storage/PathFinder.h (revision e661df29804f2703a65e23f5789c3c87c0915298)
18afbcbebSIngo Weinhold /*
2*e661df29SAxel Dörfler  * Copyright 2013-2015, 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>
10*e661df29SAxel Dörfler #include <StringList.h>
118afbcbebSIngo Weinhold 
128afbcbebSIngo Weinhold 
138afbcbebSIngo Weinhold class BPath;
148afbcbebSIngo Weinhold struct entry_ref;
158afbcbebSIngo Weinhold 
168afbcbebSIngo Weinhold 
1762b164bdSIngo Weinhold namespace BPackageKit {
1862b164bdSIngo Weinhold 	class BPackageResolvableExpression;
1962b164bdSIngo Weinhold }
2062b164bdSIngo Weinhold 
2162b164bdSIngo Weinhold 
228afbcbebSIngo Weinhold class BPathFinder {
238afbcbebSIngo Weinhold public:
2462b164bdSIngo Weinhold 			typedef BPackageKit::BPackageResolvableExpression
2562b164bdSIngo Weinhold 				BResolvableExpression;
2662b164bdSIngo Weinhold 
2762b164bdSIngo Weinhold public:
288afbcbebSIngo Weinhold 								BPathFinder(const void* codePointer = NULL,
298afbcbebSIngo Weinhold 									const char* dependency = NULL);
308afbcbebSIngo Weinhold 								BPathFinder(const char* path,
318afbcbebSIngo Weinhold 									const char* dependency = NULL);
328afbcbebSIngo Weinhold 								BPathFinder(const entry_ref& ref,
338afbcbebSIngo Weinhold 									const char* dependency = NULL);
3462b164bdSIngo Weinhold 								BPathFinder(
3562b164bdSIngo Weinhold 									const BResolvableExpression& expression,
3662b164bdSIngo Weinhold 									const char* dependency = NULL);
3762b164bdSIngo Weinhold 									// requires libpackage
388afbcbebSIngo Weinhold 
398afbcbebSIngo Weinhold 			status_t			SetTo(const void* codePointer = NULL,
408afbcbebSIngo Weinhold 									const char* dependency = NULL);
418afbcbebSIngo Weinhold 			status_t			SetTo(const char* path,
428afbcbebSIngo Weinhold 									const char* dependency = NULL);
438afbcbebSIngo Weinhold 			status_t			SetTo(const entry_ref& ref,
448afbcbebSIngo Weinhold 									const char* dependency = NULL);
4562b164bdSIngo Weinhold 			status_t			SetTo(const BResolvableExpression& expression,
4662b164bdSIngo Weinhold 									const char* dependency = NULL);
4762b164bdSIngo Weinhold 									// requires libpackage
488afbcbebSIngo Weinhold 
4960b39cd7SIngo Weinhold 			status_t			FindPath(const char* architecture,
5060b39cd7SIngo Weinhold 									path_base_directory baseDirectory,
5160b39cd7SIngo Weinhold 									const char* subPath, uint32 flags,
520eb197d4SIngo Weinhold 									BPath& _path);
538afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
548afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
550eb197d4SIngo Weinhold 									BPath& _path);
568afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
570eb197d4SIngo Weinhold 									const char* subPath, BPath& _path);
588afbcbebSIngo Weinhold 			status_t			FindPath(path_base_directory baseDirectory,
590eb197d4SIngo Weinhold 									BPath& _path);
608afbcbebSIngo Weinhold 
6160b39cd7SIngo Weinhold 	static	status_t			FindPaths(const char* architecture,
6260b39cd7SIngo Weinhold 									path_base_directory baseDirectory,
6360b39cd7SIngo Weinhold 									const char* subPath, uint32 flags,
640eb197d4SIngo Weinhold 							 		BStringList& _paths);
658afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
668afbcbebSIngo Weinhold 									const char* subPath, uint32 flags,
670eb197d4SIngo Weinhold 							 		BStringList& _paths);
688afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
690eb197d4SIngo Weinhold 									const char* subPath, BStringList& _paths);
708afbcbebSIngo Weinhold 	static	status_t			FindPaths(path_base_directory baseDirectory,
710eb197d4SIngo Weinhold 									BStringList& _paths);
728afbcbebSIngo Weinhold 
738afbcbebSIngo Weinhold private:
748afbcbebSIngo Weinhold 			status_t			_SetTo(const void* codePointer,
758afbcbebSIngo Weinhold 									const char* path, const char* dependency);
768afbcbebSIngo Weinhold 
778afbcbebSIngo Weinhold private:
788afbcbebSIngo Weinhold 			const void*			fCodePointer;
798afbcbebSIngo Weinhold 			BString				fPath;
808afbcbebSIngo Weinhold 			BString				fDependency;
818afbcbebSIngo Weinhold 			status_t			fInitStatus;
8262b164bdSIngo Weinhold 			addr_t				fReserved[4];
838afbcbebSIngo Weinhold };
848afbcbebSIngo Weinhold 
858afbcbebSIngo Weinhold 
868afbcbebSIngo Weinhold #endif	// _PATH_FINDER_H
87