Add UnpackingNode::IsOnlyPackageNode()
It returns whether the given package node is the only package node attached to that node.
This commit is contained in:
@@ -132,6 +132,14 @@ UnpackingDirectory::GetPackageNode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
UnpackingDirectory::IsOnlyPackageNode(PackageNode* node) const
|
||||||
|
{
|
||||||
|
return node == fPackageDirectories.Head()
|
||||||
|
&& node == fPackageDirectories.Tail();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
UnpackingDirectory::OpenAttributeDirectory(AttributeDirectoryCookie*& _cookie)
|
UnpackingDirectory::OpenAttributeDirectory(AttributeDirectoryCookie*& _cookie)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ public:
|
|||||||
virtual void RemovePackageNode(PackageNode* packageNode);
|
virtual void RemovePackageNode(PackageNode* packageNode);
|
||||||
|
|
||||||
virtual PackageNode* GetPackageNode();
|
virtual PackageNode* GetPackageNode();
|
||||||
|
virtual bool IsOnlyPackageNode(PackageNode* node) const;
|
||||||
|
|
||||||
virtual status_t OpenAttributeDirectory(
|
virtual status_t OpenAttributeDirectory(
|
||||||
AttributeDirectoryCookie*& _cookie);
|
AttributeDirectoryCookie*& _cookie);
|
||||||
|
|||||||
@@ -156,6 +156,14 @@ UnpackingLeafNode::GetPackageNode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool
|
||||||
|
UnpackingLeafNode::IsOnlyPackageNode(PackageNode* node) const
|
||||||
|
{
|
||||||
|
PackageLeafNode* head = fPackageNodes.Head();
|
||||||
|
return node == head && fPackageNodes.GetNext(head) == NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
UnpackingLeafNode::Read(off_t offset, void* buffer, size_t* bufferSize)
|
UnpackingLeafNode::Read(off_t offset, void* buffer, size_t* bufferSize)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ public:
|
|||||||
virtual void RemovePackageNode(PackageNode* packageNode);
|
virtual void RemovePackageNode(PackageNode* packageNode);
|
||||||
|
|
||||||
virtual PackageNode* GetPackageNode();
|
virtual PackageNode* GetPackageNode();
|
||||||
|
virtual bool IsOnlyPackageNode(PackageNode* node) const;
|
||||||
|
|
||||||
virtual status_t Read(off_t offset, void* buffer,
|
virtual status_t Read(off_t offset, void* buffer,
|
||||||
size_t* bufferSize);
|
size_t* bufferSize);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ public:
|
|||||||
virtual void RemovePackageNode(PackageNode* packageNode) = 0;
|
virtual void RemovePackageNode(PackageNode* packageNode) = 0;
|
||||||
|
|
||||||
virtual PackageNode* GetPackageNode() = 0;
|
virtual PackageNode* GetPackageNode() = 0;
|
||||||
|
virtual bool IsOnlyPackageNode(PackageNode* node) const = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user