1 | /* Copyright (c) 2003, 2007 MySQL AB, 2009 Sun Microsystems, Inc. |
2 | Use is subject to license terms. |
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; version 2 of the License. |
7 | |
8 | This program is distributed in the hope that it will be useful, |
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 | GNU General Public License for more details. |
12 | |
13 | You should have received a copy of the GNU General Public License |
14 | along with this program; if not, write to the Free Software |
15 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ |
16 | |
17 | #include <sys/types.h> |
18 | #include <sys/stat.h> |
19 | #include <my_dir.h> |
20 | |
21 | |
22 | class Transparent_file |
23 | { |
24 | File filedes; |
25 | uchar *buff; /* in-memory window to the file or mmaped area */ |
26 | /* current window sizes */ |
27 | my_off_t lower_bound; |
28 | my_off_t upper_bound; |
29 | uint buff_size; |
30 | |
31 | public: |
32 | |
33 | Transparent_file(); |
34 | ~Transparent_file(); |
35 | |
36 | void init_buff(File filedes_arg); |
37 | uchar *ptr(); |
38 | my_off_t start(); |
39 | my_off_t end(); |
40 | char get_value (my_off_t offset); |
41 | my_off_t read_next(); |
42 | }; |
43 | |