BPicture: Fix archive constructor.
[haiku.git] / src / kits / package / GlobalWritableFileInfo.cpp
blobb2eff631c20318774900c1a02c7bd8a9b0bcfc36
1 /*
2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <package/GlobalWritableFileInfo.h>
9 #include <package/hpkg/PackageInfoAttributeValue.h>
12 namespace BPackageKit {
15 BGlobalWritableFileInfo::BGlobalWritableFileInfo()
17 fPath(),
18 fUpdateType(B_WRITABLE_FILE_UPDATE_TYPE_ENUM_COUNT)
23 BGlobalWritableFileInfo::BGlobalWritableFileInfo(
24 const BHPKG::BGlobalWritableFileInfoData& infoData)
26 fPath(infoData.path),
27 fUpdateType(infoData.updateType),
28 fIsDirectory(infoData.isDirectory)
33 BGlobalWritableFileInfo::BGlobalWritableFileInfo(const BString& path,
34 BWritableFileUpdateType updateType, bool isDirectory)
36 fPath(path),
37 fUpdateType(updateType),
38 fIsDirectory(isDirectory)
43 BGlobalWritableFileInfo::~BGlobalWritableFileInfo()
48 status_t
49 BGlobalWritableFileInfo::InitCheck() const
51 if (fPath.IsEmpty())
52 return B_NO_INIT;
53 return B_OK;
57 const BString&
58 BGlobalWritableFileInfo::Path() const
60 return fPath;
64 bool
65 BGlobalWritableFileInfo::IsIncluded() const
67 return fUpdateType != B_WRITABLE_FILE_UPDATE_TYPE_ENUM_COUNT;
71 BWritableFileUpdateType
72 BGlobalWritableFileInfo::UpdateType() const
74 return fUpdateType;
78 bool
79 BGlobalWritableFileInfo::IsDirectory() const
81 return fIsDirectory;
85 void
86 BGlobalWritableFileInfo::SetTo(const BString& path,
87 BWritableFileUpdateType updateType, bool isDirectory)
89 fPath = path;
90 fUpdateType = updateType;
91 fIsDirectory = isDirectory;
95 } // namespace BPackageKit