paul@93 | 1 | /* |
paul@93 | 2 | * An opener for a file employing a rewritable memory area. |
paul@93 | 3 | * |
paul@240 | 4 | * Copyright (C) 2021, 2022 Paul Boddie <paul@boddie.org.uk> |
paul@93 | 5 | * |
paul@93 | 6 | * This program is free software; you can redistribute it and/or |
paul@93 | 7 | * modify it under the terms of the GNU General Public License as |
paul@93 | 8 | * published by the Free Software Foundation; either version 2 of |
paul@93 | 9 | * the License, or (at your option) any later version. |
paul@93 | 10 | * |
paul@93 | 11 | * This program is distributed in the hope that it will be useful, |
paul@93 | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
paul@93 | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
paul@93 | 14 | * GNU General Public License for more details. |
paul@93 | 15 | * |
paul@93 | 16 | * You should have received a copy of the GNU General Public License |
paul@93 | 17 | * along with this program; if not, write to the Free Software |
paul@93 | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, |
paul@93 | 19 | * Boston, MA 02110-1301, USA |
paul@93 | 20 | */ |
paul@93 | 21 | |
paul@50 | 22 | #pragma once |
paul@50 | 23 | |
paul@94 | 24 | #include <fsserver/host_file_opener.h> |
paul@50 | 25 | |
paul@50 | 26 | |
paul@50 | 27 | |
paul@50 | 28 | /* Support for providing access to files. */ |
paul@50 | 29 | |
paul@50 | 30 | class BlockFileOpener : public HostFileOpener |
paul@50 | 31 | { |
paul@144 | 32 | public: |
paul@224 | 33 | explicit BlockFileOpener(ResourceRegistry *registry) |
paul@209 | 34 | : HostFileOpener(registry) |
paul@144 | 35 | { |
paul@144 | 36 | } |
paul@144 | 37 | |
paul@156 | 38 | virtual ~BlockFileOpener(); |
paul@156 | 39 | |
paul@50 | 40 | /* Configurable methods. */ |
paul@50 | 41 | |
paul@146 | 42 | virtual long get_fileid(const char *path, flags_t flags, fileid_t *fileid); |
paul@143 | 43 | |
paul@240 | 44 | virtual long make_accessor(flags_t flags, fileid_t fileid, Accessor **accessor); |
paul@50 | 45 | }; |
paul@50 | 46 | |
paul@50 | 47 | // vim: tabstop=4 expandtab shiftwidth=4 |