00001 #ifndef _WINC_WMOFILE
00002 #define _WINC_WMOFILE
00003
00004 #include <WXP/File.h>
00005 #include <WXP/Socket.h>
00006 #include <WXP/WmoData.h>
00007
00008 namespace WXP {
00009 class WmoFile {
00010 int type;
00011 Socket sock;
00012 File file;
00013 unsigned char buf[1000];
00014 int bsize;
00015 int boff;
00016 static const int buf_len = 1000;
00017 unsigned char pbuf[5];
00018 int psize;
00019 bool opened;
00020
00021 int prod_size;
00022 int prod_line;
00023 int total_prods;
00024 int total_bytes;
00025
00026 bool end;
00027
00028 public:
00029 WmoFile();
00030 ~WmoFile();
00031 int init();
00032 bool isOpen();
00033 int open( const char *filename );
00034 int close();
00035 int read( unsigned char &ch );
00036 int read( unsigned char *buf, int len );
00037 int read( WmoData &data );
00038
00039 inline int getProdLine(){ return prod_line; };
00040 inline int getProdSize(){ return prod_size; };
00041 inline int getProdCount(){ return total_prods; };
00042 inline int getByteCount(){ return total_bytes; };
00043
00044 enum Type {
00045 UNK,
00046 FILE,
00047 SOCKET
00048 };
00049 };
00050 }
00051 #endif