pstore2
file_win32.hpp
Go to the documentation of this file.
1 //===- include/pstore/os/file_win32.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_WIN32_HPP
20 #define PSTORE_OS_FILE_WIN32_HPP
21 
22 #ifdef _WIN32
23 
24 # include <algorithm>
25 # include <cassert>
26 # include <cstdlib>
27 # include <limits>
28 
29 # define NOMINMAX
30 # define WIN32_LEAN_AND_MEAN
31 # include <Windows.h>
32 
33 # include "pstore/support/utf.hpp"
34 
35 namespace pstore {
36  namespace file {
37 
39  namespace win32 {
40  class deleter final : public deleter_base {
41  public:
42  explicit deleter (std::string const & path)
43  : deleter_base (path, &platform_unlink) {}
44  ~deleter () noexcept override;
45 
46  private:
50  static void platform_unlink (std::string const & path);
51  };
52  } // namespace win32
53 
56  using deleter = win32::deleter;
57  } // namespace file
58 } // namespace pstore
59 
60 #endif //_WIN32
61 #endif // PSTORE_OS_FILE_WIN32_HPP
Definition: chunked_sequence.hpp:607
posix::deleter deleter
The cross-platform name for the deleter class.
Definition: file_posix.hpp:54
Definition: nonpod2.cpp:40
Functionality for processing UTF-8 strings.