1 /******************************************************************************** 2 * Nepenthes 3 * - finest collection - 4 * 5 * 6 * 7 * Copyright (C) 2005 Paul Baecher & Markus Koetter 8 * 9 * This program is free software; you can redistribute it and/or 10 * modify it under the terms of the GNU General Public License 11 * as published by the Free Software Foundation; either version 2 12 * of the License, or (at your option) any later version. 13 * 14 * This program is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU General Public License for more details. 18 * 19 * You should have received a copy of the GNU General Public License 20 * along with this program; if not, write to the Free Software 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 22 * 23 * 24 * contact nepenthesdev@users.sourceforge.net 25 * 26 *******************************************************************************/ 27 28 /* $Id: VFSNode.hpp 1644 2005-07-14 16:19:15Z dp $ */ 29 30 #ifndef HAVE_VFSNODE_HPP 31 #define HAVE_VFSNODE_HPP 32 33 #include <list> 34 #include <string> 35 36 using namespace std; 37 38 39 40 41 typedef enum 42 { 43 VFS_DIR, 44 VFS_FILE, 45 VFS_EXE 46 } vfs_type; 47 48 49 namespace nepenthes 50 { 51 class VFSNode; 52 class VFSNode 53 { 54 public: 55 ~VFSNode()56 virtual ~VFSNode(){}; getName()57 string getName() 58 { 59 return m_Name; 60 } getParent()61 VFSNode * getParent() 62 { 63 return m_ParentNode; 64 } getType()65 vfs_type getType() 66 { 67 return m_Type; 68 } getPath()69 string getPath() 70 { 71 VFSNode *parent = m_ParentNode; 72 string path = m_Name; 73 while ( parent != NULL ) 74 { 75 path = "\\" + path; 76 path = parent->getName() + path; 77 parent = parent->getParent(); 78 } 79 return path; 80 } 81 // virtual string list(); 82 protected: 83 VFSNode *m_ParentNode; 84 list <VFSNode *> m_Nodes; 85 vfs_type m_Type; 86 string m_Name; 87 88 }; 89 90 } 91 92 #endif 93