]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/winapi/include/boost/detail/winapi/directory_management.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / winapi / include / boost / detail / winapi / directory_management.hpp
CommitLineData
7c673cae
FG
1// directory_management.hpp --------------------------------------------------------------//
2
3// Copyright 2010 Vicente J. Botet Escriba
4// Copyright 2015 Andrey Semashev
5
6// Distributed under the Boost Software License, Version 1.0.
7// See http://www.boost.org/LICENSE_1_0.txt
8
9
10#ifndef BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
11#define BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP
12
13#include <boost/detail/winapi/basic_types.hpp>
14#include <boost/detail/winapi/get_system_directory.hpp>
15
16#ifdef BOOST_HAS_PRAGMA_ONCE
17#pragma once
18#endif
19
20#if !defined( BOOST_USE_WINDOWS_H )
21extern "C" {
22#if !defined( BOOST_NO_ANSI_APIS )
23BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
24 CreateDirectoryA(boost::detail::winapi::LPCSTR_, ::_SECURITY_ATTRIBUTES*);
25BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
26 GetTempPathA(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPSTR_ buffer);
27BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
28 RemoveDirectoryA(boost::detail::winapi::LPCSTR_);
29#endif
30BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
31 CreateDirectoryW(boost::detail::winapi::LPCWSTR_, ::_SECURITY_ATTRIBUTES*);
32BOOST_SYMBOL_IMPORT boost::detail::winapi::DWORD_ WINAPI
33 GetTempPathW(boost::detail::winapi::DWORD_ length, boost::detail::winapi::LPWSTR_ buffer);
34BOOST_SYMBOL_IMPORT boost::detail::winapi::BOOL_ WINAPI
35 RemoveDirectoryW(boost::detail::winapi::LPCWSTR_);
36}
37#endif
38
39namespace boost {
40namespace detail {
41namespace winapi {
42
43#if !defined( BOOST_NO_ANSI_APIS )
44using ::GetTempPathA;
45using ::RemoveDirectoryA;
46#endif
47using ::GetTempPathW;
48using ::RemoveDirectoryW;
49
50#if !defined( BOOST_NO_ANSI_APIS )
51BOOST_FORCEINLINE BOOL_ CreateDirectoryA(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
52{
53 return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
54}
55#endif
56
57BOOST_FORCEINLINE BOOL_ CreateDirectoryW(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
58{
59 return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
60}
61
62#if !defined( BOOST_NO_ANSI_APIS )
63BOOST_FORCEINLINE BOOL_ create_directory(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
64{
65 return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
66}
67BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPSTR_ buffer)
68{
69 return ::GetTempPathA(length, buffer);
70}
71BOOST_FORCEINLINE BOOL_ remove_directory(LPCSTR_ pPathName)
72{
73 return ::RemoveDirectoryA(pPathName);
74}
75#endif
76
77BOOST_FORCEINLINE BOOL_ create_directory(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes)
78{
79 return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes));
80}
81BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPWSTR_ buffer)
82{
83 return ::GetTempPathW(length, buffer);
84}
85BOOST_FORCEINLINE BOOL_ remove_directory(LPCWSTR_ pPathName)
86{
87 return ::RemoveDirectoryW(pPathName);
88}
89
90} // namespace winapi
91} // namespace detail
92} // namespace boost
93
94#endif // BOOST_DETAIL_WINAPI_DIRECTORY_MANAGEMENT_HPP