btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / package / manager / RepositoryBuilder.h
blobebb993dd6dad4c89416c8f7665eaf43c3c5f430d
1 /*
2 * Copyright 2013, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8 #ifndef _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
9 #define _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_
12 #include <map>
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 {
22 namespace BManager {
24 namespace BPrivate {
27 typedef std::map<BSolverPackage*, BString> BPackagePathMap;
30 class BRepositoryBuilder {
31 public:
32 BRepositoryBuilder(
33 BSolverRepository& repository);
34 BRepositoryBuilder(
35 BSolverRepository& repository,
36 const BString& name,
37 const BString& errorName = BString());
38 BRepositoryBuilder(
39 BSolverRepository& repository,
40 const BRepositoryConfig& config);
41 BRepositoryBuilder(
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);
62 private:
63 BSolverRepository& fRepository;
64 BString fErrorName;
65 BPackagePathMap* fPackagePaths;
69 } // namespace BPrivate
71 } // namespace BManager
73 } // namespace BPackageKit
76 #endif // _PACKAGE__MANAGER__PRIVATE__REPOSITORY_BUILDER_H_