Added translation using Weblate (Italian)
[cygwin-setup.git] / io_stream_file.h
blob3060e843d03f548fbf6db9ed73306f06079c5b85
1 /*
2 * Copyright (c) 2001, Robert Collins.
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.
9 * A copy of the GNU General Public License can be found at
10 * http://www.gnu.org/
12 * Written by Robert Collins <rbtcollins@hotmail.com>
16 #ifndef SETUP_IO_STREAM_FILE_H
17 #define SETUP_IO_STREAM_FILE_H
19 #include "io_stream.h"
22 /* io_stream on disk files
25 class io_stream_file:public io_stream
27 public:
28 static int exists (const std::string& );
29 static int remove (const std::string& );
30 static int mklink (const std::string& , const std::string& , io_stream_link_t);
31 io_stream_file (const std::string&, const std::string&, mode_t);
32 virtual ~ io_stream_file ();
33 /* read data (duh!) */
34 virtual ssize_t read (void *buffer, size_t len);
35 /* provide data to (double duh!) */
36 virtual ssize_t write (const void *buffer, size_t len);
37 /* read data without removing it from the class's internal buffer */
38 virtual ssize_t peek (void *buffer, size_t len);
39 virtual off_t tell ();
40 virtual off_t seek (off_t where, io_stream_seek_t whence);
41 /* can't guess, oh well */
42 virtual int error ();
43 virtual int set_mtime (time_t);
44 /* not relevant yet */
45 virtual time_t get_mtime () { return 0; };
46 virtual mode_t get_mode () { return 0; };
47 virtual size_t get_size ();
48 static int move (const std::string& ,const std::string& );
49 private:
50 /* always require parameters */
51 io_stream_file ()
54 FILE *fp;
55 int lasterr;
56 std::string fname;
57 wchar_t *wname;
58 wchar_t *w_str ();
61 #endif /* SETUP_IO_STREAM_FILE_H */