directory.h

Go to the documentation of this file.
00001 #ifndef DIRECTORY_CLASS
00002 #define DIRECTORY_CLASS
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : directory                                                         *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 2001-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00019 
00020 #include "opsysdll.h"
00021 
00022 #include <basis/object_base.h>
00023 
00024 class OPSYSTEM_CLASS_STYLE directory
00025 {
00026 public:
00027   directory(const istring &path, const char *pattern = "*");
00029 
00036   directory(const directory &to_copy);
00037 
00038   virtual ~directory();
00039 
00040   directory &operator =(const directory &to_copy);
00041 
00042   IMPLEMENT_CLASS_NAME("directory");
00043 
00044   bool good() const { return _scanned_okay; }
00046 
00047   const istring &path() const;
00049 
00050   const istring &pattern() const;
00052 
00053   static istring absolute_path(const istring &relative_path);
00055 
00057   bool reset(const istring &path, const char *pattern = "*");
00059 
00061   bool move_up(const char *pattern = "*");
00063 
00064   bool move_down(const istring &subdir, const char *pattern = "*");
00066 
00072   bool rescan();
00074 
00075   const string_array &files() const;
00077 
00081   const string_array &directories() const;
00083 
00087   // static methods of general directory-related interest.
00088 
00089   static istring current();
00091 
00092   static bool make_directory(const istring &path);
00094 
00095   static bool remove_directory(const istring &path);
00097 
00098   static bool recursive_create(const istring &directory_name);
00100 
00104 private:
00105   bool _scanned_okay;  
00106   istring *_path;  
00107   string_array *_files;  
00108   string_array *_folders;  
00109   istring *_pattern;  
00110 };
00111 
00112 #endif
00113 

Generated on Thu Nov 20 04:29:03 2008 for HOOPLE Libraries by  doxygen 1.5.1