home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / Directory / src / Directory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-06-14  |  727 b   |  33 lines

  1. #ifndef RJS_DIRECTORY_CLASS_H
  2. #define RJS_DIRECTORY_CLASS_H
  3.  
  4. #include <sys/types.h>
  5. #include <sys/dir.h>
  6.  
  7. #include<RJS/String.h>
  8. #include<RJS/Status.h>
  9.  
  10. class RJS_Directory : public RJS_Status {
  11. public:
  12.     enum DirFmt { NoPath, FullPath };
  13.     static const RJS_Status NoDirSpecified;
  14.     RJS_Directory();
  15.     RJS_Directory(const RJS_String &path, DirFmt fmt=NoPath);
  16.     ~RJS_Directory();
  17.     set(const RJS_String &path, DirFmt fmt=NoPath);
  18.     const RJS_String &name() { return dirname; }
  19.     int next(RJS_String &name);
  20.     long position();
  21.     void moveto(long pos);
  22.     int number();
  23.     void reset();
  24.     int done();
  25.     DirFmt format() { return dirfmt; }
  26. private:
  27.     DIR *dir;
  28.     RJS_String dirname;
  29.     DirFmt dirfmt; // return filename with dir prepended
  30. };
  31.     
  32. #endif
  33.