2013-11-06 00:38:22 +04:00
|
|
|
/*
|
2013-11-19 05:03:00 +04:00
|
|
|
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
2013-11-06 00:38:22 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _PATH_FINDER_H
|
|
|
|
#define _PATH_FINDER_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <FindDirectory.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
|
|
|
|
class BPath;
|
|
|
|
class BStringList;
|
|
|
|
struct entry_ref;
|
|
|
|
|
|
|
|
|
2013-11-21 16:06:09 +04:00
|
|
|
namespace BPackageKit {
|
|
|
|
class BPackageResolvableExpression;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-11-06 00:38:22 +04:00
|
|
|
class BPathFinder {
|
2013-11-21 16:06:09 +04:00
|
|
|
public:
|
|
|
|
typedef BPackageKit::BPackageResolvableExpression
|
|
|
|
BResolvableExpression;
|
|
|
|
|
2013-11-06 00:38:22 +04:00
|
|
|
public:
|
|
|
|
BPathFinder(const void* codePointer = NULL,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
BPathFinder(const char* path,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
BPathFinder(const entry_ref& ref,
|
|
|
|
const char* dependency = NULL);
|
2013-11-21 16:06:09 +04:00
|
|
|
BPathFinder(
|
|
|
|
const BResolvableExpression& expression,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
// requires libpackage
|
2013-11-06 00:38:22 +04:00
|
|
|
|
|
|
|
status_t SetTo(const void* codePointer = NULL,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
status_t SetTo(const char* path,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
status_t SetTo(const entry_ref& ref,
|
|
|
|
const char* dependency = NULL);
|
2013-11-21 16:06:09 +04:00
|
|
|
status_t SetTo(const BResolvableExpression& expression,
|
|
|
|
const char* dependency = NULL);
|
|
|
|
// requires libpackage
|
2013-11-06 00:38:22 +04:00
|
|
|
|
2013-11-17 01:27:47 +04:00
|
|
|
status_t FindPath(const char* architecture,
|
|
|
|
path_base_directory baseDirectory,
|
|
|
|
const char* subPath, uint32 flags,
|
2013-11-19 05:03:00 +04:00
|
|
|
BPath& _path);
|
2013-11-06 00:38:22 +04:00
|
|
|
status_t FindPath(path_base_directory baseDirectory,
|
|
|
|
const char* subPath, uint32 flags,
|
2013-11-19 05:03:00 +04:00
|
|
|
BPath& _path);
|
2013-11-06 00:38:22 +04:00
|
|
|
status_t FindPath(path_base_directory baseDirectory,
|
2013-11-19 05:03:00 +04:00
|
|
|
const char* subPath, BPath& _path);
|
2013-11-06 00:38:22 +04:00
|
|
|
status_t FindPath(path_base_directory baseDirectory,
|
2013-11-19 05:03:00 +04:00
|
|
|
BPath& _path);
|
2013-11-06 00:38:22 +04:00
|
|
|
|
2013-11-17 01:27:47 +04:00
|
|
|
static status_t FindPaths(const char* architecture,
|
|
|
|
path_base_directory baseDirectory,
|
|
|
|
const char* subPath, uint32 flags,
|
2013-11-19 05:03:00 +04:00
|
|
|
BStringList& _paths);
|
2013-11-06 00:38:22 +04:00
|
|
|
static status_t FindPaths(path_base_directory baseDirectory,
|
|
|
|
const char* subPath, uint32 flags,
|
2013-11-19 05:03:00 +04:00
|
|
|
BStringList& _paths);
|
2013-11-06 00:38:22 +04:00
|
|
|
static status_t FindPaths(path_base_directory baseDirectory,
|
2013-11-19 05:03:00 +04:00
|
|
|
const char* subPath, BStringList& _paths);
|
2013-11-06 00:38:22 +04:00
|
|
|
static status_t FindPaths(path_base_directory baseDirectory,
|
2013-11-19 05:03:00 +04:00
|
|
|
BStringList& _paths);
|
2013-11-06 00:38:22 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
status_t _SetTo(const void* codePointer,
|
|
|
|
const char* path, const char* dependency);
|
|
|
|
|
|
|
|
private:
|
|
|
|
const void* fCodePointer;
|
|
|
|
BString fPath;
|
|
|
|
BString fDependency;
|
|
|
|
status_t fInitStatus;
|
2013-11-21 16:06:09 +04:00
|
|
|
addr_t fReserved[4];
|
2013-11-06 00:38:22 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _PATH_FINDER_H
|