1/*
2 * Copyright 2013, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5
6
7#include <package/UserSettingsFileInfo.h>
8
9#include <package/hpkg/PackageInfoAttributeValue.h>
10
11
12namespace BPackageKit {
13
14
15BUserSettingsFileInfo::BUserSettingsFileInfo()
16	:
17	fPath(),
18	fTemplatePath()
19{
20}
21
22
23BUserSettingsFileInfo::BUserSettingsFileInfo(
24	const BHPKG::BUserSettingsFileInfoData& infoData)
25	:
26	fPath(infoData.path),
27	fTemplatePath(infoData.templatePath),
28	fIsDirectory(infoData.isDirectory)
29{
30}
31
32
33BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
34	const BString& templatePath)
35	:
36	fPath(path),
37	fTemplatePath(templatePath),
38	fIsDirectory(false)
39{
40}
41
42
43BUserSettingsFileInfo::BUserSettingsFileInfo(const BString& path,
44	bool isDirectory)
45	:
46	fPath(path),
47	fTemplatePath(),
48	fIsDirectory(isDirectory)
49{
50}
51
52
53BUserSettingsFileInfo::~BUserSettingsFileInfo()
54{
55}
56
57
58status_t
59BUserSettingsFileInfo::InitCheck() const
60{
61	return fPath.IsEmpty() ? B_NO_INIT : B_OK;
62}
63
64
65const BString&
66BUserSettingsFileInfo::Path() const
67{
68	return fPath;
69}
70
71
72const BString&
73BUserSettingsFileInfo::TemplatePath() const
74{
75	return fTemplatePath;
76}
77
78
79bool
80BUserSettingsFileInfo::IsDirectory() const
81{
82	return fIsDirectory;
83}
84
85
86void
87BUserSettingsFileInfo::SetTo(const BString& path, const BString& templatePath)
88{
89	fPath = path;
90	fTemplatePath = templatePath;
91	fIsDirectory = false;
92}
93
94
95void
96BUserSettingsFileInfo::SetTo(const BString& path, bool isDirectory)
97{
98	fPath = path;
99	fTemplatePath.Truncate(0);
100	fIsDirectory = isDirectory;
101}
102
103
104}	// namespace BPackageKit
105