/* * Copyright 2010 Vicente J. Botet Escriba * Copyright 2015 Andrey Semashev * * Distributed under the Boost Software License, Version 1.0. * See http://www.boost.org/LICENSE_1_0.txt */ #ifndef ACTIV_BOOST_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_ #define ACTIV_BOOST_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_ #include #include #include #ifdef ACTIV_BOOST_HAS_PRAGMA_ONCE #pragma once #endif #if !defined( ACTIV_BOOST_USE_WINDOWS_H ) extern "C" { #if !defined( ACTIV_BOOST_NO_ANSI_APIS ) ACTIV_BOOST_WINAPI_IMPORT Boost::winapi::BOOL_ ACTIV_BOOST_WINAPI_WINAPI_CC CreateDirectoryA(Boost::winapi::LPCSTR_, ::_SECURITY_ATTRIBUTES*); #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM ACTIV_BOOST_WINAPI_IMPORT Boost::winapi::DWORD_ ACTIV_BOOST_WINAPI_WINAPI_CC GetTempPathA(Boost::winapi::DWORD_ length, Boost::winapi::LPSTR_ buffer); #endif ACTIV_BOOST_WINAPI_IMPORT Boost::winapi::BOOL_ ACTIV_BOOST_WINAPI_WINAPI_CC RemoveDirectoryA(Boost::winapi::LPCSTR_); #endif ACTIV_BOOST_WINAPI_IMPORT_EXCEPT_WM Boost::winapi::BOOL_ ACTIV_BOOST_WINAPI_WINAPI_CC CreateDirectoryW(Boost::winapi::LPCWSTR_, ::_SECURITY_ATTRIBUTES*); #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM ACTIV_BOOST_WINAPI_IMPORT_EXCEPT_WM Boost::winapi::DWORD_ ACTIV_BOOST_WINAPI_WINAPI_CC GetTempPathW(Boost::winapi::DWORD_ length, Boost::winapi::LPWSTR_ buffer); #endif ACTIV_BOOST_WINAPI_IMPORT_EXCEPT_WM Boost::winapi::BOOL_ ACTIV_BOOST_WINAPI_WINAPI_CC RemoveDirectoryW(Boost::winapi::LPCWSTR_); } // extern "C" #endif namespace Boost { namespace winapi { #if !defined( ACTIV_BOOST_NO_ANSI_APIS ) #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM using ::GetTempPathA; #endif using ::RemoveDirectoryA; #endif #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM using ::GetTempPathW; #endif using ::RemoveDirectoryW; #if !defined( ACTIV_BOOST_NO_ANSI_APIS ) ACTIV_BOOST_FORCEINLINE BOOL_ CreateDirectoryA(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes) { return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes)); } #endif ACTIV_BOOST_FORCEINLINE BOOL_ CreateDirectoryW(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes) { return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes)); } #if !defined( ACTIV_BOOST_NO_ANSI_APIS ) ACTIV_BOOST_FORCEINLINE BOOL_ create_directory(LPCSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes) { return ::CreateDirectoryA(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes)); } #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM ACTIV_BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPSTR_ buffer) { return ::GetTempPathA(length, buffer); } #endif ACTIV_BOOST_FORCEINLINE BOOL_ remove_directory(LPCSTR_ pPathName) { return ::RemoveDirectoryA(pPathName); } #endif ACTIV_BOOST_FORCEINLINE BOOL_ create_directory(LPCWSTR_ pPathName, PSECURITY_ATTRIBUTES_ pSecurityAttributes) { return ::CreateDirectoryW(pPathName, reinterpret_cast< ::_SECURITY_ATTRIBUTES* >(pSecurityAttributes)); } #if ACTIV_BOOST_WINAPI_PARTITION_APP_SYSTEM ACTIV_BOOST_FORCEINLINE DWORD_ get_temp_path(DWORD_ length, LPWSTR_ buffer) { return ::GetTempPathW(length, buffer); } #endif ACTIV_BOOST_FORCEINLINE BOOL_ remove_directory(LPCWSTR_ pPathName) { return ::RemoveDirectoryW(pPathName); } } // namespace winapi } // namespace Boost #include #endif // ACTIV_BOOST_WINAPI_DIRECTORY_MANAGEMENT_HPP_INCLUDED_