00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef _UXDIRSTREAM_HPP_
00019 #define _UXDIRSTREAM_HPP_
00020
00021 #include <dirent.h>
00022
00023 namespace Ux {
00024
00025
00026
00027
00028 class DirStream : public Base {
00029 protected:
00030 DIR *dirstream;
00031 struct dirent *entry;
00032
00033 public:
00034 DirStream(void)
00035 : dirstream(NULL), entry(NULL)
00036 { }
00037 struct dirent *get_entry(void)
00038 { return entry; }
00039 const char *get_name(void)
00040 { return entry == NULL ? NULL : entry->d_name; }
00041 void alloc(const char *path = "/");
00042 void free(void);
00043 size_t get_max_name(const char *path = "/");
00044
00045 void open(const char *path);
00046 void open_alloc(const char *path);
00047 void close(void);
00048 bool read(void);
00049 void rewind(void);
00050 void seek(long loc);
00051 long tell(void);
00052 };
00053
00054 }
00055
00056 #endif // _UXDIRSTREAM_HPP_