// FileNode.h: interface for the FileNode class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_)
#define AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <Stuff\Stuff.hpp>

using namespace Stuff;

class FileNode
{
protected:
	FileNode *Parent;
	DynamicArrayOf<FileNode *> Children;
	void RemoveChild(int loc);
	void OrganizeTree(FileNode *root_node);
	int ChildTot;
	bool IsSorted;
	const char *FileName;
public:
	const char *GetName() {return FileName;}
	FileNode *GetParent() {return Parent;}
	void AddChild(FileNode *new_child);
	void RemoveChild(FileNode *child) {	RemoveChild(FindChild(child));}
	void OrganizeTree();

	int FindChild(FileNode *child);
	FileNode(const char *fname);

	virtual ~FileNode();

};

#endif // !defined(AFX_FILENODE_H__E0A7188F_D467_4033_AF12_9402FF6B791E__INCLUDED_)
