xref: /haiku/src/kits/package/solver/SolverPackageSpecifier.cpp (revision a3e794ae459fec76826407f8ba8c94cd3535f128)
1 /*
2  * Copyright 2013, Haiku, Inc. All Rights Reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Ingo Weinhold <ingo_weinhold@gmx.de>
7  */
8 
9 
10 #include <package/solver/SolverPackageSpecifier.h>
11 
12 
13 namespace BPackageKit {
14 
15 
16 BSolverPackageSpecifier::BSolverPackageSpecifier()
17 	:
18 	fType(B_UNSPECIFIED),
19 	fPackage(NULL),
20 	fSelectString()
21 {
22 }
23 
24 
25 BSolverPackageSpecifier::BSolverPackageSpecifier(BSolverPackage* package)
26 	:
27 	fType(B_PACKAGE),
28 	fPackage(package),
29 	fSelectString()
30 {
31 }
32 
33 
34 BSolverPackageSpecifier::BSolverPackageSpecifier(const BString& selectString)
35 	:
36 	fType(B_SELECT_STRING),
37 	fPackage(NULL),
38 	fSelectString(selectString)
39 {
40 }
41 
42 
43 BSolverPackageSpecifier::BSolverPackageSpecifier(
44 	const BSolverPackageSpecifier& other)
45 	:
46 	fType(other.fType),
47 	fPackage(other.fPackage),
48 	fSelectString(other.fSelectString)
49 {
50 }
51 
52 
53 BSolverPackageSpecifier::~BSolverPackageSpecifier()
54 {
55 }
56 
57 
58 BSolverPackageSpecifier::BType
59 BSolverPackageSpecifier::Type() const
60 {
61 	return fType;
62 }
63 
64 
65 BSolverPackage*
66 BSolverPackageSpecifier::Package() const
67 {
68 	return fPackage;
69 }
70 
71 
72 const BString&
73 BSolverPackageSpecifier::SelectString() const
74 {
75 	return fSelectString;
76 }
77 
78 
79 BSolverPackageSpecifier&
80 BSolverPackageSpecifier::operator=(const BSolverPackageSpecifier& other)
81 {
82 	fType = other.fType;
83 	fPackage = other.fPackage;
84 	fSelectString = other.fSelectString;
85 	return *this;
86 }
87 
88 
89 }	// namespace BPackageKit
90