wvwatcher.h

00001 /* -*- Mode: C++ -*-
00002  * Worldvisions Weaver Software:
00003  *   Copyright (C) 1997-2002 Net Integration Technologies, Inc.
00004  *
00005  * Provides support for monitoring file changes.
00006  */ 
00007 #ifndef __WVWATCHER_H
00008 #define __WVWATCHER_H
00009 
00010 #include "wvfile.h"
00011 #include <sys/stat.h>
00012 
00013 struct stat;
00014 
00024 class WvFileWatcher : public WvFile
00025 {
00026     WvString filename;
00027     int openmode;
00028     bool once_ok;
00029     struct stat last_st;
00030     off_t fpos;
00031 
00032 protected:
00033     bool make_ok(bool retry);
00034     
00035 public:
00036     WvFileWatcher(const char *_filename, int _mode);
00037     virtual bool isok() const;
00038     virtual size_t uread(void *buf, size_t size);
00039     virtual size_t uwrite(const void *buf, size_t size);
00040     virtual bool pre_select(SelectInfo &si);
00041     
00042 public:
00043     const char *wstype() const { return "WvFileWatcher"; }
00044 };
00045 
00046 #endif // __WVWATCHER_H

Generated on Fri Oct 5 18:20:29 2007 for WvStreams by  doxygen 1.5.3