BPicture: Fix archive constructor.
[haiku.git] / src / kits / package / solver / SolverPackage.cpp
blob938c7d5cc425c10c7bedb89b88deeb9fde2cb791
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 */
10 #include <package/solver/SolverPackage.h>
13 namespace BPackageKit {
16 BSolverPackage::BSolverPackage(BSolverRepository* repository,
17 const BPackageInfo& packageInfo)
19 fRepository(repository),
20 fInfo(packageInfo)
25 BSolverPackage::BSolverPackage(const BSolverPackage& other)
27 fRepository(other.fRepository),
28 fInfo(other.fInfo)
33 BSolverPackage::~BSolverPackage()
38 BSolverRepository*
39 BSolverPackage::Repository() const
41 return fRepository;
45 const BPackageInfo&
46 BSolverPackage::Info() const
48 return fInfo;
52 BString
53 BSolverPackage::Name() const
55 return fInfo.Name();
59 BString
60 BSolverPackage::VersionedName() const
62 if (fInfo.Version().InitCheck() != B_OK)
63 return Name();
64 BString result = Name();
65 return result << '-' << fInfo.Version().ToString();
69 const BPackageVersion&
70 BSolverPackage::Version() const
72 return fInfo.Version();
76 BSolverPackage&
77 BSolverPackage::operator=(const BSolverPackage& other)
79 fRepository = other.fRepository;
80 fInfo = other.fInfo;
81 return *this;
85 } // namespace BPackageKit