00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _FL_DIRECTORY_DS_H_
00023 #define _FL_DIRECTORY_DS_H_
00024
00025 #include "Fl_Memory_DS.h"
00026
00028 class FL_API Fl_Directory_DS : public Fl_Memory_DS {
00029 public:
00030
00031 Fl_Directory_DS() : Fl_Memory_DS(), m_showpolicy(0) { }
00032 virtual ~Fl_Directory_DS() { close(); }
00033
00034 enum {
00035 SHOW_ALL = 0,
00036 HIDE_FILES = 1,
00037 HIDE_DOT_FILES = 2,
00038 HIDE_DIRECTORIES = 4,
00039 NO_SORT = 8
00040 };
00041
00042 char showpolicy() const { return m_showpolicy; }
00043 void showpolicy(char type) { m_showpolicy = type; }
00044
00045 void directory(const char *d) { m_directory = d; }
00046 void directory(const Fl_String &d) { m_directory = d; }
00047 const Fl_String &directory() const { return m_directory; }
00048
00049 void pattern(const char *pattern) { m_pattern = pattern; }
00050 void pattern(const Fl_String &pattern) { m_pattern = pattern; }
00051 const Fl_String &pattern() const { return m_pattern; }
00052
00053
00054 virtual bool open();
00055
00056 protected:
00057
00058 Fl_String get_file_type(const struct stat &st, const Fl_Image *&image) const;
00059
00060 private:
00061 Fl_String m_directory;
00062 Fl_String m_pattern;
00063 char m_showpolicy;
00064 };
00065
00066 #endif