diff options
Diffstat (limited to 'includes/cdutils.h')
-rw-r--r-- | includes/cdutils.h | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/includes/cdutils.h b/includes/cdutils.h index 12746dd..cf1af4a 100644 --- a/includes/cdutils.h +++ b/includes/cdutils.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: cdutils.h,v 1.11 2003-11-25 01:55:45 pixel Exp $ */ +/* $Id: cdutils.h,v 1.12 2003-12-04 00:57:35 pixel Exp $ */ #ifndef __CDUTILS_H__ #define __CDUTILS_H__ @@ -71,14 +71,13 @@ class cdutils : public Base { char id[1]; } PACKED; - - struct DirEntry rootDir; + struct DirEntry * rootDir; Handle * open_ppf(String ppf, String comment) throw(GeneralException); void close_ppf() throw(GeneralException); void set_iso_w(Handle *); - unsigned short int swap_word(unsigned short int i); - unsigned long int swap_dword(unsigned long int i); + static unsigned short int swap_word(unsigned short int i); + static unsigned long int swap_dword(unsigned long int i); int guess_type(int number = -1); void sector_seek(long sector); long read_sector(Byte * buffer, int type, int number = -1); @@ -93,16 +92,18 @@ class cdutils : public Base { int show_pt_infos(); struct DirEntry find_path(String path); struct DirEntry find_parent(String path); + struct DirEntry * find_path(Byte ** buffer, String path); + struct DirEntry * find_parent(Byte ** buffer, String path); void show_head_entry(void); int show_entry(struct DirEntry * dir); int show_dir(struct DirEntry * dir); struct DirEntry find_dir_entry(struct DirEntry * dir, String name); struct DirEntry * find_dir_entry(Byte ** buffer, struct DirEntry * dir, String name); - unsigned char from_BCD(unsigned char x); - unsigned char to_BCD(unsigned char x); - bool is_valid_BCD(unsigned char x); - unsigned long from_MSF(unsigned long msf, unsigned long start = 150); - unsigned long from_MSF(unsigned char m, unsigned char s, unsigned char f, unsigned long start = 150); + static unsigned char from_BCD(unsigned char x); + static unsigned char to_BCD(unsigned char x); + static bool is_valid_BCD(unsigned char x); + static unsigned long from_MSF(unsigned long msf, unsigned long start = 150); + static unsigned long from_MSF(unsigned char m, unsigned char s, unsigned char f, unsigned long start = 150); private: void write_ppf(Byte * old_sec, Byte * new_sec, int sec_num); String format_date(String input); @@ -112,4 +113,24 @@ class cdutils : public Base { int pt1, pt2, snum, ptl, root; }; +class cdfile : public Handle { + public: + cdfile(cdutils *, const cdutils::DirEntry *, int = GUESS); + cdfile(cdutils *, int sector, ssize_t = -1, int = GUESS); + virtual ~cdfile(); + virtual ssize_t read(void *buf, size_t count) throw (GeneralException); + virtual bool CanRead() const; + virtual String GetName() const; + virtual bool CanWatch() const; + virtual ssize_t GetSize() const; + virtual bool CanSeek() const; + virtual off_t seek(off_t, int = SEEK_SET) throw (GeneralException); + private: + cdutils * cd; + int sector, mode; + size_t size; + String name; + cdutils::DirEntry * dir; +}; + #endif |