xref: /haiku/headers/private/package/manager/RepositoryBuilder.h (revision 9f81ca838ce7b92b5689e57d3f86765db4705a7b)
183462cc2SIngo Weinhold /*
283462cc2SIngo Weinhold  * Copyright 2013, Haiku, Inc. All Rights Reserved.
383462cc2SIngo Weinhold  * Distributed under the terms of the MIT License.
483462cc2SIngo Weinhold  *
583462cc2SIngo Weinhold  * Authors:
683462cc2SIngo Weinhold  *		Ingo Weinhold <ingo_weinhold@gmx.de>
783462cc2SIngo Weinhold  */
883462cc2SIngo Weinhold #ifndef _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
983462cc2SIngo Weinhold #define _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
1083462cc2SIngo Weinhold 
1183462cc2SIngo Weinhold 
1283462cc2SIngo Weinhold #include <map>
1383462cc2SIngo Weinhold 
1483462cc2SIngo Weinhold #include <package/PackageInfo.h>
1583462cc2SIngo Weinhold #include <package/solver/Solver.h>
1683462cc2SIngo Weinhold #include <package/solver/SolverPackage.h>
1783462cc2SIngo Weinhold #include <package/solver/SolverRepository.h>
1883462cc2SIngo Weinhold 
1983462cc2SIngo Weinhold 
2083462cc2SIngo Weinhold namespace BPackageKit {
2183462cc2SIngo Weinhold 
2283462cc2SIngo Weinhold namespace BManager {
2383462cc2SIngo Weinhold 
2483462cc2SIngo Weinhold namespace BPrivate {
2583462cc2SIngo Weinhold 
2683462cc2SIngo Weinhold 
2783462cc2SIngo Weinhold typedef std::map<BSolverPackage*, BString> BPackagePathMap;
2883462cc2SIngo Weinhold 
2983462cc2SIngo Weinhold 
3083462cc2SIngo Weinhold class BRepositoryBuilder {
3183462cc2SIngo Weinhold public:
3283462cc2SIngo Weinhold 								BRepositoryBuilder(
33*c138f1f2SIngo Weinhold 									BSolverRepository& repository);
34*c138f1f2SIngo Weinhold 								BRepositoryBuilder(
3583462cc2SIngo Weinhold 									BSolverRepository& repository,
3683462cc2SIngo Weinhold 									const BString& name,
3783462cc2SIngo Weinhold 									const BString& errorName = BString());
3883462cc2SIngo Weinhold 								BRepositoryBuilder(
3983462cc2SIngo Weinhold 									BSolverRepository& repository,
4083462cc2SIngo Weinhold 									const BRepositoryConfig& config);
4183462cc2SIngo Weinhold 								BRepositoryBuilder(
4283462cc2SIngo Weinhold 									BSolverRepository& repository,
4383462cc2SIngo Weinhold 									const BRepositoryCache& cache,
4483462cc2SIngo Weinhold 									const BString& errorName = BString());
4583462cc2SIngo Weinhold 
4683462cc2SIngo Weinhold 			BRepositoryBuilder&	SetPackagePathMap(
4783462cc2SIngo Weinhold 									BPackagePathMap* packagePaths);
4883462cc2SIngo Weinhold 
4983462cc2SIngo Weinhold 			BRepositoryBuilder&	AddPackage(const BPackageInfo& info,
5083462cc2SIngo Weinhold 									const char* packageErrorName = NULL,
5183462cc2SIngo Weinhold 									BSolverPackage** _package = NULL);
5283462cc2SIngo Weinhold 			BRepositoryBuilder&	AddPackage(const char* path,
5383462cc2SIngo Weinhold 									BSolverPackage** _package = NULL);
5483462cc2SIngo Weinhold 			BRepositoryBuilder&	AddPackages(
5583462cc2SIngo Weinhold 									BPackageInstallationLocation location,
5683462cc2SIngo Weinhold 									const char* locationErrorName);
5783462cc2SIngo Weinhold 			BRepositoryBuilder&	AddPackagesDirectory(const char* path);
5883462cc2SIngo Weinhold 
5983462cc2SIngo Weinhold 			BRepositoryBuilder&	AddToSolver(BSolver* solver,
6083462cc2SIngo Weinhold 									bool isInstalled = false);
6183462cc2SIngo Weinhold 
6283462cc2SIngo Weinhold private:
6383462cc2SIngo Weinhold 			BSolverRepository&	fRepository;
6483462cc2SIngo Weinhold 			BString				fErrorName;
6583462cc2SIngo Weinhold 			BPackagePathMap*	fPackagePaths;
6683462cc2SIngo Weinhold };
6783462cc2SIngo Weinhold 
6883462cc2SIngo Weinhold 
6983462cc2SIngo Weinhold }	// namespace BPrivate
7083462cc2SIngo Weinhold 
7183462cc2SIngo Weinhold }	// namespace BManager
7283462cc2SIngo Weinhold 
7383462cc2SIngo Weinhold }	// namespace BPackageKit
7483462cc2SIngo Weinhold 
7583462cc2SIngo Weinhold 
7683462cc2SIngo Weinhold #endif	// _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
77