BPicture: Fix archive constructor.
[haiku.git] / src / kits / package / UserSettingsFileInfo.cpp
blobf3395318994b449729e12a3c06a0324fb898ff25
1 /*
2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
7 #include <package/UserSettingsFileInfo.h>
9 #include <package/hpkg/PackageInfoAttributeValue.h>
12 namespace BPackageKit {
15 BUserSettingsFileInfo::BUserSettingsFileInfo()
17 fPath(),
18 fTemplatePath()
23 BUserSettingsFileInfo::BUserSettingsFileInfo(
24 const BHPKG::BUserSettingsFileInfoData& infoData)
26 fPath(infoData.path),
27 fTemplatePath(infoData.templatePath),
28 fIsDirectory(infoData.isDirectory)
33 BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
34 const BString& templatePath)
36 fPath(path),
37 fTemplatePath(templatePath),
38 fIsDirectory(false)
43 BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
44 bool isDirectory)
46 fPath(path),
47 fTemplatePath(),
48 fIsDirectory(isDirectory)
53 BUserSettingsFileInfo::~BUserSettingsFileInfo()
58 status_t
59 BUserSettingsFileInfo::InitCheck() const
61 return fPath.IsEmpty() ? B_NO_INIT : B_OK;
65 const BString&
66 BUserSettingsFileInfo::Path() const
68 return fPath;
72 const BString&
73 BUserSettingsFileInfo::TemplatePath() const
75 return fTemplatePath;
79 bool
80 BUserSettingsFileInfo::IsDirectory() const
82 return fIsDirectory;
86 void
87 BUserSettingsFileInfo::SetTo(const BString& path, const BString& templatePath)
89 fPath = path;
90 fTemplatePath = templatePath;
91 fIsDirectory = false;
95 void
96 BUserSettingsFileInfo::SetTo(const BString& path, bool isDirectory)
98 fPath = path;
99 fTemplatePath.Truncate(0);
100 fIsDirectory = isDirectory;
104 } // namespace BPackageKit