2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
8 #ifndef _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
9 #define _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
14 #include <package/PackageInfo.h>
15 #include <package/solver/Solver.h>
16 #include <package/solver/SolverPackage.h>
17 #include <package/solver/SolverRepository.h>
20 namespace BPackageKit
{
27 typedef std::map
<BSolverPackage
*, BString
> BPackagePathMap
;
30 class BRepositoryBuilder
{
33 BSolverRepository
& repository
);
35 BSolverRepository
& repository
,
37 const BString
& errorName
= BString());
39 BSolverRepository
& repository
,
40 const BRepositoryConfig
& config
);
42 BSolverRepository
& repository
,
43 const BRepositoryCache
& cache
,
44 const BString
& errorName
= BString());
46 BRepositoryBuilder
& SetPackagePathMap(
47 BPackagePathMap
* packagePaths
);
49 BRepositoryBuilder
& AddPackage(const BPackageInfo
& info
,
50 const char* packageErrorName
= NULL
,
51 BSolverPackage
** _package
= NULL
);
52 BRepositoryBuilder
& AddPackage(const char* path
,
53 BSolverPackage
** _package
= NULL
);
54 BRepositoryBuilder
& AddPackages(
55 BPackageInstallationLocation location
,
56 const char* locationErrorName
);
57 BRepositoryBuilder
& AddPackagesDirectory(const char* path
);
59 BRepositoryBuilder
& AddToSolver(BSolver
* solver
,
60 bool isInstalled
= false);
63 BSolverRepository
& fRepository
;
65 BPackagePathMap
* fPackagePaths
;
69 } // namespace BPrivate
71 } // namespace BManager
73 } // namespace BPackageKit
76 #endif // _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_