WvStreams
|
00001 /* -*- Mode: C++ -*- 00002 * Worldvisions Weaver Software: 00003 * Copyright (C) 1997-2002 Net Integration Technologies, Inc. 00004 * 00005 * A simple class to access filesystem files using WvStreams. 00006 */ 00007 #ifndef __WVFILE_H 00008 #define __WVFILE_H 00009 00010 #include "wvfdstream.h" 00011 #include <fcntl.h> 00012 00013 #ifdef _WIN32 00014 #define O_NONBLOCK 0 00015 #define O_LARGEFILE 0 00016 #define fcntl(a,b,c) 00017 #endif 00018 00028 class WvFile : public WvFDStream 00029 { 00030 public: 00032 WvFile(); 00033 00035 WvFile(int rwfd); 00036 00038 WvFile(WvStringParm filename, int mode, int create_mode = 0666); 00039 bool open(WvStringParm filename, int mode, int create_mode = 0666); 00040 bool open(int _rwfd); 00041 00042 bool readable, writable; 00043 00044 virtual void pre_select(SelectInfo &si); 00045 virtual bool post_select(SelectInfo &si); 00046 00047 public: 00048 const char *wstype() const { return "WvFile"; } 00049 }; 00050 00051 #endif // __WVFILE_H