Translated using Weblate (Portuguese (Brazil))
[cygwin-setup.git] / IOStreamProvider.h
blobb30362e515dd427cb2e844af3b81d21e7333867d
1 /*
2 * Copyright (c) 2002, 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_IOSTREAMPROVIDER_H
17 #define SETUP_IOSTREAMPROVIDER_H
19 #include "io_stream.h"
21 /* An IOStreamProvider provides the interface for io_stream::open and
22 * related calls to operate.
25 class IOStreamProvider
27 public:
28 virtual int exists (const std::string& ) const = 0;
29 virtual int remove (const std::string& ) const = 0;
30 virtual int mklink (const std::string&, const std::string&,
31 io_stream_link_t) const = 0;
32 virtual io_stream *open (const std::string&, const std::string&, mode_t) const = 0;
33 virtual ~IOStreamProvider (){}
34 virtual int move (const std::string&, const std::string&) const = 0;
35 virtual int mkdir_p (path_type_t isadir, const std::string& path, mode_t mode) const = 0;
36 std::string key; // Do not set - managed automatically.
37 protected:
38 IOStreamProvider(){} // no base instances
39 IOStreamProvider(IOStreamProvider const &); // no copy cons
40 IOStreamProvider &operator=(IOStreamProvider const &); // no assignment
43 #endif /* SETUP_IOSTREAMPROVIDER_H */