xref: /haiku/src/add-ons/kernel/file_systems/packagefs/nodes/OldUnpackingNodeAttributes.cpp (revision 04a0e9c7b68cbe3a43d38e2bca8e860fd80936fb)
1 /*
2  * Copyright 2011, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include "OldUnpackingNodeAttributes.h"
8 
9 #include "PackageNode.h"
10 
11 
12 OldUnpackingNodeAttributes::OldUnpackingNodeAttributes(
13 	PackageNode* packageNode)
14 	:
15 	fPackageNode(packageNode)
16 {
17 }
18 
19 
20 timespec
21 OldUnpackingNodeAttributes::ModifiedTime() const
22 {
23 	if (fPackageNode != NULL)
24 		return fPackageNode->ModifiedTime();
25 
26 	timespec time = { 0, 0 };
27 	return time;
28 }
29 
30 
31 off_t
32 OldUnpackingNodeAttributes::FileSize() const
33 {
34 	return fPackageNode != NULL ? fPackageNode->FileSize() : 0;
35 }
36 
37 
38 void*
39 OldUnpackingNodeAttributes::IndexCookieForAttribute(const StringKey& name) const
40 {
41 	return fPackageNode != NULL
42 		? fPackageNode->IndexCookieForAttribute(name) : NULL;
43 }
44