summaryrefslogtreecommitdiff
path: root/tools.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools.h')
-rw-r--r--tools.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/tools.h b/tools.h
index 83bdeb41..f348b2e5 100644
--- a/tools.h
+++ b/tools.h
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: tools.h 1.80 2005/10/09 11:13:06 kls Exp $
+ * $Id: tools.h 1.81 2005/10/31 12:54:36 kls Exp $
*/
#ifndef __TOOLS_H
@@ -198,6 +198,27 @@ public:
bool Close(void);
};
+/// cUnbufferedFile is used for large files that are mainly written or read
+/// in a streaming manner, and thus should not be cached.
+
+class cUnbufferedFile {
+private:
+ int fd;
+ off_t begin;
+ off_t end;
+ off_t ahead;
+ ssize_t written;
+public:
+ cUnbufferedFile(void);
+ ~cUnbufferedFile();
+ int Open(const char *FileName, int Flags, mode_t Mode = DEFFILEMODE);
+ int Close(void);
+ off_t Seek(off_t Offset, int Whence);
+ ssize_t Read(void *Data, size_t Size);
+ ssize_t Write(const void *Data, size_t Size);
+ static cUnbufferedFile *Create(const char *FileName, int Flags, mode_t Mode = DEFFILEMODE);
+ };
+
class cLockFile {
private:
char *fileName;