]> cygwin.com Git - cygwin-apps/setup.git/blob - io_stream_file.h
2001-11-23 Robert Collins <rbtcollins@hotmail.com>
[cygwin-apps/setup.git] / io_stream_file.h
1 /*
2 * Copyright (c) 2001, Robert Collins.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
11 *
12 * Written by Robert Collins <rbtcollins@hotmail.com>
13 *
14 */
15
16 #ifndef _IO_STREAM_FILE_H_
17 #define _IO_STREAM_FILE_H_
18
19
20 /* io_stream on disk files
21 */
22
23 class io_stream_file:public io_stream
24 {
25 public:
26 static int exists (const char *);
27 static int remove (const char *);
28 static int mklink (const char *, const char *, io_stream_link_t);
29 io_stream_file (const char *, const char *);
30 virtual ~ io_stream_file ();
31 /* read data (duh!) */
32 virtual ssize_t read (void *buffer, size_t len);
33 /* provide data to (double duh!) */
34 virtual ssize_t write (const void *buffer, size_t len);
35 /* read data without removing it from the class's internal buffer */
36 virtual ssize_t peek (void *buffer, size_t len);
37 virtual long tell ();
38 virtual int seek (long where, io_stream_seek_t whence);
39 /* can't guess, oh well */
40 virtual int error ();
41 virtual int set_mtime (int);
42 /* not relevant yet */
43 virtual int get_mtime ()
44 {
45 return 0;
46 };
47 /* dummy for io_stream_file */
48 virtual const char *next_file_name ()
49 {
50 return NULL;
51 };
52 static int move (char const *, char const *);
53 private:
54 /* always require parameters */
55 io_stream_file ()
56 {
57 };
58 FILE *fp;
59 int lasterr;
60 char *fname;
61 char *lmode;
62 };
63
64 #endif /* _IO_STREAM_FILE_H_ */
This page took 0.037379 seconds and 6 git commands to generate.