]>
Commit | Line | Data |
---|---|---|
b24c88b3 RC |
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_CYGFILE_H_ | |
17 | #define _IO_STREAM_CYGFILE_H_ | |
18 | ||
19 | ||
20 | /* io_stream on disk files using cygwin paths | |
21 | * and potentially understanding links in the future | |
22 | */ | |
23 | ||
24 | extern int cygmkdir_p (int isadir, const char *path); | |
25 | ||
26 | class io_stream_cygfile:public io_stream | |
27 | { | |
28 | public: | |
29 | static int exists (const char *); | |
30 | static int remove (const char *); | |
31 | static int mklink (const char *, const char *, io_stream_link_t); | |
32 | io_stream_cygfile (const char *, const char *); | |
33 | virtual ~io_stream_cygfile (); | |
34 | /* read data (duh!) */ | |
35 | virtual ssize_t read (void *buffer, size_t len); | |
36 | /* provide data to (double duh!) */ | |
ca9506cc | 37 | virtual ssize_t write (const void *buffer, size_t len); |
b24c88b3 RC |
38 | /* read data without removing it from the class's internal buffer */ |
39 | virtual ssize_t peek (void *buffer, size_t len); | |
40 | virtual long tell (); | |
ca9506cc | 41 | virtual int seek (long where, io_stream_seek_t whence); |
b24c88b3 RC |
42 | /* can't guess, oh well */ |
43 | virtual int error (); | |
44 | virtual int set_mtime (int); | |
45 | /* not relevant yet */ | |
7939f6d1 | 46 | virtual int get_mtime () { return 0;}; |
b24c88b3 RC |
47 | /* dummy for io_stream_file */ |
48 | virtual const char *next_file_name () | |
49 | { | |
50 | return NULL; | |
51 | }; | |
52 | private: | |
53 | /* always require parameters */ | |
54 | io_stream_cygfile () | |
55 | { | |
56 | }; | |
57 | FILE *fp; | |
58 | int lasterr; | |
59 | char *fname; | |
60 | char *lmode; | |
61 | }; | |
62 | ||
63 | #endif /* _IO_STREAM_CYGFILE_H_ */ |