BPicture: Fix archive constructor.
[haiku.git] / src / kits / package / InstallationLocationInfo.cpp
blobb4434e92379c646a648d9dbfd7b9e29edf0a1016
1 /*
2 * Copyright 2013-2014, 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/InstallationLocationInfo.h>
13 namespace BPackageKit {
16 BInstallationLocationInfo::BInstallationLocationInfo()
18 fLocation(B_PACKAGE_INSTALLATION_LOCATION_ENUM_COUNT),
19 fBaseDirectoryRef(),
20 fPackageDirectoryRef(),
21 fLatestActivePackageInfos(),
22 fLatestInactivePackageInfos(),
23 fCurrentlyActivePackageInfos(),
24 fOldStateName(),
25 fChangeCount(0)
30 BInstallationLocationInfo::~BInstallationLocationInfo()
35 void
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);
45 fChangeCount = 0;
49 BPackageInstallationLocation
50 BInstallationLocationInfo::Location() const
52 return fLocation;
56 void
57 BInstallationLocationInfo::SetLocation(BPackageInstallationLocation location)
59 fLocation = location;
63 const node_ref&
64 BInstallationLocationInfo::BaseDirectoryRef() const
66 return fBaseDirectoryRef;
70 status_t
71 BInstallationLocationInfo::SetBaseDirectoryRef(const node_ref& ref)
73 fBaseDirectoryRef = ref;
74 return fBaseDirectoryRef == ref ? B_OK : B_NO_MEMORY;
78 const node_ref&
79 BInstallationLocationInfo::PackagesDirectoryRef() const
81 return fPackageDirectoryRef;
85 status_t
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;
100 void
101 BInstallationLocationInfo::SetLatestActivePackageInfos(
102 const BPackageInfoSet& infos)
104 fLatestActivePackageInfos = infos;
108 const BPackageInfoSet&
109 BInstallationLocationInfo::LatestInactivePackageInfos() const
111 return fLatestInactivePackageInfos;
115 void
116 BInstallationLocationInfo::SetLatestInactivePackageInfos(
117 const BPackageInfoSet& infos)
119 fLatestInactivePackageInfos = infos;
123 const BPackageInfoSet&
124 BInstallationLocationInfo::CurrentlyActivePackageInfos() const
126 return fCurrentlyActivePackageInfos;
130 void
131 BInstallationLocationInfo::SetCurrentlyActivePackageInfos(
132 const BPackageInfoSet& infos)
134 fCurrentlyActivePackageInfos = infos;
138 const BString&
139 BInstallationLocationInfo::OldStateName() const
141 return fOldStateName;
145 void
146 BInstallationLocationInfo::SetOldStateName(const BString& name)
148 fOldStateName = name;
152 int64
153 BInstallationLocationInfo::ChangeCount() const
155 return fChangeCount;
159 void
160 BInstallationLocationInfo::SetChangeCount(int64 changeCount)
162 fChangeCount = changeCount;
166 } // namespace BPackageKit