18afbcbebSIngo Weinhold /* 2*0eb197d4SIngo 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 188afbcbebSIngo Weinhold class BPathFinder { 198afbcbebSIngo Weinhold public: 208afbcbebSIngo Weinhold BPathFinder(const void* codePointer = NULL, 218afbcbebSIngo Weinhold const char* dependency = NULL); 228afbcbebSIngo Weinhold BPathFinder(const char* path, 238afbcbebSIngo Weinhold const char* dependency = NULL); 248afbcbebSIngo Weinhold BPathFinder(const entry_ref& ref, 258afbcbebSIngo Weinhold const char* dependency = NULL); 268afbcbebSIngo Weinhold 278afbcbebSIngo Weinhold status_t SetTo(const void* codePointer = NULL, 288afbcbebSIngo Weinhold const char* dependency = NULL); 298afbcbebSIngo Weinhold status_t SetTo(const char* path, 308afbcbebSIngo Weinhold const char* dependency = NULL); 318afbcbebSIngo Weinhold status_t SetTo(const entry_ref& ref, 328afbcbebSIngo Weinhold const char* dependency = NULL); 338afbcbebSIngo Weinhold 3460b39cd7SIngo Weinhold status_t FindPath(const char* architecture, 3560b39cd7SIngo Weinhold path_base_directory baseDirectory, 3660b39cd7SIngo Weinhold const char* subPath, uint32 flags, 37*0eb197d4SIngo Weinhold BPath& _path); 388afbcbebSIngo Weinhold status_t FindPath(path_base_directory baseDirectory, 398afbcbebSIngo Weinhold const char* subPath, uint32 flags, 40*0eb197d4SIngo Weinhold BPath& _path); 418afbcbebSIngo Weinhold status_t FindPath(path_base_directory baseDirectory, 42*0eb197d4SIngo Weinhold const char* subPath, BPath& _path); 438afbcbebSIngo Weinhold status_t FindPath(path_base_directory baseDirectory, 44*0eb197d4SIngo Weinhold BPath& _path); 458afbcbebSIngo Weinhold 4660b39cd7SIngo Weinhold static status_t FindPaths(const char* architecture, 4760b39cd7SIngo Weinhold path_base_directory baseDirectory, 4860b39cd7SIngo Weinhold const char* subPath, uint32 flags, 49*0eb197d4SIngo Weinhold BStringList& _paths); 508afbcbebSIngo Weinhold static status_t FindPaths(path_base_directory baseDirectory, 518afbcbebSIngo Weinhold const char* subPath, uint32 flags, 52*0eb197d4SIngo Weinhold BStringList& _paths); 538afbcbebSIngo Weinhold static status_t FindPaths(path_base_directory baseDirectory, 54*0eb197d4SIngo Weinhold const char* subPath, BStringList& _paths); 558afbcbebSIngo Weinhold static status_t FindPaths(path_base_directory baseDirectory, 56*0eb197d4SIngo Weinhold BStringList& _paths); 578afbcbebSIngo Weinhold 588afbcbebSIngo Weinhold private: 598afbcbebSIngo Weinhold status_t _SetTo(const void* codePointer, 608afbcbebSIngo Weinhold const char* path, const char* dependency); 618afbcbebSIngo Weinhold 628afbcbebSIngo Weinhold private: 638afbcbebSIngo Weinhold const void* fCodePointer; 648afbcbebSIngo Weinhold BString fPath; 658afbcbebSIngo Weinhold BString fDependency; 668afbcbebSIngo Weinhold status_t fInitStatus; 678afbcbebSIngo Weinhold uint32 fReserved[4]; 688afbcbebSIngo Weinhold }; 698afbcbebSIngo Weinhold 708afbcbebSIngo Weinhold 718afbcbebSIngo Weinhold #endif // _PATH_FINDER_H 72