2 * Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
10 #include <package/InstallationLocationInfo.h>
13 namespace BPackageKit
{
16 BInstallationLocationInfo::BInstallationLocationInfo()
18 fLocation(B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT
),
20 fPackageDirectoryRef(),
21 fLatestActivePackageInfos(),
22 fLatestInactivePackageInfos(),
23 fCurrentlyActivePackageInfos(),
30 BInstallationLocationInfo::~BInstallationLocationInfo()
36 BInstallationLocationInfo::Unset()
38 fLocation
= B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT
;
39 fBaseDirectoryRef
= node_ref();
40 fPackageDirectoryRef
= node_ref();
41 fLatestActivePackageInfos
.MakeEmpty();
42 fLatestInactivePackageInfos
.MakeEmpty();
43 fCurrentlyActivePackageInfos
.MakeEmpty();
44 fOldStateName
.Truncate(0);
49 BPackageInstallationLocation
50 BInstallationLocationInfo::Location() const
57 BInstallationLocationInfo::SetLocation(BPackageInstallationLocation location
)
64 BInstallationLocationInfo::BaseDirectoryRef() const
66 return fBaseDirectoryRef
;
71 BInstallationLocationInfo::SetBaseDirectoryRef(const node_ref
& ref
)
73 fBaseDirectoryRef
= ref
;
74 return fBaseDirectoryRef
== ref
? B_OK
: B_NO_MEMORY
;
79 BInstallationLocationInfo::PackagesDirectoryRef() const
81 return fPackageDirectoryRef
;
86 BInstallationLocationInfo::SetPackagesDirectoryRef(const node_ref
& ref
)
88 fPackageDirectoryRef
= ref
;
89 return fPackageDirectoryRef
== ref
? B_OK
: B_NO_MEMORY
;
93 const BPackageInfoSet
&
94 BInstallationLocationInfo::LatestActivePackageInfos() const
96 return fLatestActivePackageInfos
;
101 BInstallationLocationInfo::SetLatestActivePackageInfos(
102 const BPackageInfoSet
& infos
)
104 fLatestActivePackageInfos
= infos
;
108 const BPackageInfoSet
&
109 BInstallationLocationInfo::LatestInactivePackageInfos() const
111 return fLatestInactivePackageInfos
;
116 BInstallationLocationInfo::SetLatestInactivePackageInfos(
117 const BPackageInfoSet
& infos
)
119 fLatestInactivePackageInfos
= infos
;
123 const BPackageInfoSet
&
124 BInstallationLocationInfo::CurrentlyActivePackageInfos() const
126 return fCurrentlyActivePackageInfos
;
131 BInstallationLocationInfo::SetCurrentlyActivePackageInfos(
132 const BPackageInfoSet
& infos
)
134 fCurrentlyActivePackageInfos
= infos
;
139 BInstallationLocationInfo::OldStateName() const
141 return fOldStateName
;
146 BInstallationLocationInfo::SetOldStateName(const BString
& name
)
148 fOldStateName
= name
;
153 BInstallationLocationInfo::ChangeCount() const
160 BInstallationLocationInfo::SetChangeCount(int64 changeCount
)
162 fChangeCount
= changeCount
;
166 } // namespace BPackageKit