pstore2
file_posix.hpp
Go to the documentation of this file.
1 //===- include/pstore/os/file_posix.hpp -------------------*- mode: C++ -*-===//
2 //* __ _ _ *
3 //* / _(_) | ___ *
4 //* | |_| | |/ _ \ *
5 //* | _| | | __/ *
6 //* |_| |_|_|\___| *
7 //* *
8 //===----------------------------------------------------------------------===//
9 //
10 // Part of the pstore project, under the Apache License v2.0 with LLVM Exceptions.
11 // See https://github.com/SNSystems/pstore/blob/master/LICENSE.txt for license
12 // information.
13 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 //
15 //===----------------------------------------------------------------------===//
18 
19 #ifndef PSTORE_OS_FILE_POSIX_HPP
20 #define PSTORE_OS_FILE_POSIX_HPP
21 
22 #if !defined(_WIN32)
23 
24 # include <unistd.h>
25 
26 namespace pstore {
27  namespace file {
28 
30  namespace posix {
31  class deleter final : public deleter_base {
32  public:
33  explicit deleter (std::string const & path)
34  : deleter_base (path, &platform_unlink) {}
35  // No copying, moving, or assignment
36  deleter (deleter const &) = delete;
37  deleter (deleter &&) noexcept = delete;
38  deleter & operator= (deleter const &) = delete;
39  deleter & operator= (deleter &&) noexcept = delete;
40 
41  ~deleter () noexcept override;
42 
43  private:
47 
48  static void platform_unlink (std::string const & path);
49  };
50  } // namespace posix
51 
55 
56  } // namespace file
57 } // namespace pstore
58 #endif
59 
60 #endif // PSTORE_OS_FILE_POSIX_HPP
posix::deleter deleter
The cross-platform name for the deleter class.
Definition: file_posix.hpp:54
Definition: nonpod2.cpp:40
A class which, on destruction, will delete a file whose name is passed to the constructor.
Definition: file.hpp:719
Definition: file_posix.hpp:31