00001 // LICENSE: (Please see the file COPYING for details) 00002 // 00003 // NUS - Nemesis Utilities System: A C++ application development framework 00004 // Copyright (C) 2006, 2008 Otavio Rodolfo Piske 00005 // 00006 // This file is part of NUS 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Lesser General Public 00010 // License as published by the Free Software Foundation version 2.1 00011 // of the License. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Lesser General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Lesser General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00021 // 00022 #ifndef NDIR_H_ 00023 #define NDIR_H_ 00024 00025 #include <sys/types.h> 00026 #include <dirent.h> 00027 00028 #include "nobject.h" 00029 #include "nstring.h" 00030 #include "nlist.h" 00031 #include "nioexception.h" 00032 #include "noutput.h" 00033 00044 class NDir: public NObject { 00045 public: 00050 NDir(const NString &name); 00051 00055 ~NDir(void); 00056 00061 NList<NString> getContents(void) const; 00062 00067 NString getName(void) const; 00068 00069 private: 00070 NList<NString> m_contents; 00071 NString m_dir_name; 00072 DIR *m_dir_handle; 00073 00074 void loadContents(struct dirent *ent); 00075 }; 00076 00077 #endif // NDIR_H_