1/* 2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. 3 * Distributed under the terms of the MIT License. 4 */ 5#ifndef PACKAGE_DIRECTORY_H 6#define PACKAGE_DIRECTORY_H 7 8 9#include <util/DoublyLinkedList.h> 10 11#include "PackageNode.h" 12 13 14class PackageDirectory : public PackageNode, 15 public DoublyLinkedListLinkImpl<PackageDirectory> { 16public: 17 PackageDirectory(Package* package, mode_t mode); 18 virtual ~PackageDirectory(); 19 20 void AddChild(PackageNode* node); 21 void RemoveChild(PackageNode* node); 22 23 inline PackageNode* FirstChild() const; 24 inline PackageNode* NextChild(PackageNode* node) const; 25 26 const PackageNodeList& Children() const 27 { return fChildren; } 28 29private: 30 PackageNodeList fChildren; 31}; 32 33 34PackageNode* 35PackageDirectory::FirstChild() const 36{ 37 return fChildren.First(); 38} 39 40 41PackageNode* 42PackageDirectory::NextChild(PackageNode* node) const 43{ 44 return fChildren.GetNext(node); 45} 46 47 48typedef DoublyLinkedList<PackageDirectory> PackageDirectoryList; 49 50 51#endif // PACKAGE_DIRECTORY_H 52