Sourcemeta Core
0.0.0
Loading...
Searching...
No Matches
io_temporary.h
1
#ifndef SOURCEMETA_CORE_IO_TEMPORARY_H_
2
#define SOURCEMETA_CORE_IO_TEMPORARY_H_
3
4
#ifndef SOURCEMETA_CORE_IO_EXPORT
5
#include <sourcemeta/core/io_export.h>
6
#endif
7
8
#include <filesystem>
// std::filesystem::path
9
#include <string_view>
// std::string_view
10
11
namespace
sourcemeta::core {
12
24
class
SOURCEMETA_CORE_IO_EXPORT
TemporaryDirectory
{
25
public
:
28
TemporaryDirectory
(
const
std::filesystem::path &parent,
29
const
std::string_view prefix);
30
~TemporaryDirectory
();
31
32
TemporaryDirectory
(
const
TemporaryDirectory
&) =
delete
;
33
auto
operator=(
const
TemporaryDirectory
&) ->
TemporaryDirectory
& =
delete
;
34
TemporaryDirectory
(
TemporaryDirectory
&&) =
delete
;
35
auto
operator=(
TemporaryDirectory
&&) ->
TemporaryDirectory
& =
delete
;
36
38
[[nodiscard]]
auto
path
() const noexcept -> const std::filesystem::
path
&;
39
40
private:
41
// Exporting symbols that depends on the standard C++ library is considered
42
// safe.
43
// https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-2-c4275?view=msvc-170&redirectedfrom=MSDN
44
#if defined(_MSC_VER)
45
#pragma warning(disable : 4251)
46
#endif
47
std::filesystem::path path_;
48
#if defined(_MSC_VER)
49
#pragma warning(default : 4251)
50
#endif
51
};
52
53
}
// namespace sourcemeta::core
54
55
#endif
sourcemeta::core::TemporaryDirectory::path
auto path() const noexcept -> const std::filesystem::path &
The path to the temporary directory.
sourcemeta::core::TemporaryDirectory::TemporaryDirectory
TemporaryDirectory(const std::filesystem::path &parent, const std::string_view prefix)
src
lang
io
include
sourcemeta
core
io_temporary.h
Generated by
1.16.1