45#ifndef GHC_FILESYSTEM_H
46#define GHC_FILESYSTEM_H
54#ifndef GHC_OS_DETECTED
55#if defined(__APPLE__) && defined(__MACH__)
57#elif defined(__linux__)
59#if defined(__ANDROID__)
68#elif defined(__CYGWIN__)
70#elif defined(__svr4__)
74#elif defined(__EMSCRIPTEN__)
79#define GHC_NO_DIRENT_D_TYPE
81#error "Operating system currently not supported!"
83#define GHC_OS_DETECTED
84#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
85#if _MSVC_LANG == 201703L
86#define GHC_FILESYSTEM_RUNNING_CPP17
88#define GHC_FILESYSTEM_RUNNING_CPP20
90#elif (defined(__cplusplus) && __cplusplus >= 201703L)
91#if __cplusplus == 201703L
92#define GHC_FILESYSTEM_RUNNING_CPP17
94#define GHC_FILESYSTEM_RUNNING_CPP20
99#if defined(GHC_FILESYSTEM_IMPLEMENTATION)
100#define GHC_EXPAND_IMPL
106#ifndef GHC_FS_API_CLASS
107#define GHC_FS_API_CLASS
111#define GHC_FS_API __attribute__((visibility("default")))
113#ifndef GHC_FS_API_CLASS
114#define GHC_FS_API_CLASS __attribute__((visibility("default")))
117#elif defined(GHC_FILESYSTEM_FWD)
121#define GHC_FS_API extern
123#ifndef GHC_FS_API_CLASS
124#define GHC_FS_API_CLASS
128#define GHC_FS_API extern
130#ifndef GHC_FS_API_CLASS
131#define GHC_FS_API_CLASS
135#define GHC_EXPAND_IMPL
136#define GHC_INLINE inline
140#ifndef GHC_FS_API_CLASS
141#define GHC_FS_API_CLASS
145#ifdef GHC_EXPAND_IMPL
152#include <sys/types.h>
159#include <sys/param.h>
162#include <sys/types.h>
165#include <android/api-level.h>
166#if __ANDROID_API__ < 12
167#include <sys/syscall.h>
170#define statvfs statfs
172#include <sys/statvfs.h>
177#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
182#include <Availability.h>
185#if defined(__cpp_impl_three_way_comparison) && defined(__has_include)
186#if __has_include(<compare>)
187#define GHC_HAS_THREEWAY_COMP
204#include <system_error>
205#include <type_traits>
211#if defined(__cpp_impl_three_way_comparison) && defined(__has_include)
212#if __has_include(<compare>)
213#define GHC_HAS_THREEWAY_COMP
223#include <system_error>
231#if defined(__cpp_lib_string_view)
232#define GHC_HAS_STD_STRING_VIEW
233#elif defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 4000) && (__cplusplus >= 201402)
234#define GHC_HAS_STD_STRING_VIEW
235#elif defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE >= 7) && (__cplusplus >= 201703)
236#define GHC_HAS_STD_STRING_VIEW
237#elif defined(_MSC_VER) && (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
238#define GHC_HAS_STD_STRING_VIEW
242#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 3700 && _LIBCPP_VERSION < 7000) && (__cplusplus >= 201402)
243#define GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW
244#elif defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)) && (__cplusplus >= 201402)
245#define GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW
246#elif defined(__GLIBCXX__) && defined(_GLIBCXX_USE_DUAL_ABI) && (__cplusplus >= 201402)
248#define GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW
251#if defined(GHC_HAS_STD_STRING_VIEW)
252#include <string_view>
253#elif defined(GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW)
254#include <experimental/string_view>
266#define LWG_2682_BEHAVIOUR
279#define LWG_2936_BEHAVIOUR
282#define LWG_2937_BEHAVIOUR
298#ifndef GHC_WIN_DISABLE_AUTO_PREFIXES
299#define GHC_WIN_AUTO_PREFIX_LONG_PATH
304#define GHC_FILESYSTEM_VERSION 10506L
306#if !defined(GHC_WITH_EXCEPTIONS) && (defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND))
307#define GHC_WITH_EXCEPTIONS
309#if !defined(GHC_WITH_EXCEPTIONS) && defined(GHC_RAISE_UNICODE_ERRORS)
310#error "Can't raise unicode errors with exception support disabled"
314namespace filesystem {
316#if defined(GHC_HAS_CUSTOM_STRING_VIEW)
317#define GHC_WITH_STRING_VIEW
318#elif defined(GHC_HAS_STD_STRING_VIEW)
319#define GHC_WITH_STRING_VIEW
320using std::basic_string_view;
321#elif defined(GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW)
322#define GHC_WITH_STRING_VIEW
323using std::experimental::basic_string_view;
331 :
std::logic_error(
"function not implemented yet.")
336template <
typename char_type>
348#if __cplusplus < 201703L
349template <
typename char_type>
356bool has_executable_extension(
const path& p);
362#
if defined(GHC_OS_WINDOWS) && !defined(GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE)
363#define GHC_USE_WCHAR_T
364#define GHC_NATIVEWP(p) p.c_str()
365#define GHC_PLATFORM_LITERAL(str) L##str
371#define GHC_NATIVEWP(p) p.wstring().c_str()
372#define GHC_PLATFORM_LITERAL(str) str
395 template <
class CharT,
class Traits,
class Alloc>
399 template <
class CharT>
400 struct _is_basic_string<
std::basic_string<CharT, std::char_traits<CharT>, std::allocator<CharT>>> : std::true_type
403#ifdef GHC_WITH_STRING_VIEW
404 template <
class CharT,
class Traits>
408 template <
class CharT>
414 template <
typename T1,
typename T2 =
void>
416 template <
typename T>
417#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
424 template <
typename T>
425 using path_type_EcharT =
typename std::enable_if<std::is_same<T, char>::value || std::is_same<T, char8_t>::value || std::is_same<T, char16_t>::value || std::is_same<T, char32_t>::value || std::is_same<T, wchar_t>::value,
path>
::type;
431 template <
typename T>
432 using path_type_EcharT =
typename std::enable_if<std::is_same<T, char>::value || std::is_same<T, char16_t>::value || std::is_same<T, char32_t>::value || std::is_same<T, wchar_t>::value,
path>
::type;
441 template <class InputIterator>
443#ifdef GHC_WITH_EXCEPTIONS
444 template <
class Source,
typename = path_from_
string<Source>>
445 path(
const Source&
source,
const std::locale& loc,
format fmt = auto_format);
446 template <
class InputIterator>
447 path(InputIterator
first, InputIterator
last,
const std::locale& loc,
format fmt = auto_format);
456 template <
class Source>
458 template <
class Source>
460 template <
class InputIterator>
465 template <
class Source>
467 template <
class Source>
469 template <
class InputIterator>
475#ifdef GHC_WITH_STRING_VIEW
480 template <
class Source>
482 template <
class E
charT>
484 template <
class Source>
485 path& concat(
const Source& x);
486 template <
class InputIterator>
490 void clear() noexcept;
491 path& make_preferred();
492 path& remove_filename();
493 path& replace_filename(const
path& replacement);
494 path& replace_extension(const
path& replacement =
path());
501 template <class EcharT, class traits =
std::char_traits<EcharT>, class Allocator =
std::allocator<EcharT>>
502 std::basic_string<EcharT, traits, Allocator>
string(const Allocator& a = Allocator()) const;
503 std::
string string() const;
504 std::wstring wstring() const;
505#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
506 std::u8string u8string()
const;
508 std::string u8string()
const;
510 std::u16string u16string()
const;
511 std::u32string u32string()
const;
514 template <
class E
charT,
class traits = std::
char_traits<E
charT>,
class Allocator = std::allocator<E
charT>>
515 std::basic_string<EcharT, traits, Allocator> generic_string(
const Allocator& a = Allocator())
const;
516 std::string generic_string()
const;
517 std::wstring generic_wstring()
const;
518#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
519 std::u8string generic_u8string()
const;
521 std::string generic_u8string()
const;
523 std::u16string generic_u16string()
const;
524 std::u32string generic_u32string()
const;
527 int compare(
const path& p)
const noexcept;
529#ifdef GHC_WITH_STRING_VIEW
535 path root_name()
const;
536 path root_directory()
const;
537 path root_path()
const;
538 path relative_path()
const;
539 path parent_path()
const;
540 path filename()
const;
542 path extension()
const;
545 bool empty() const noexcept;
546 bool has_root_name() const;
547 bool has_root_directory() const;
548 bool has_root_path() const;
549 bool has_relative_path() const;
550 bool has_parent_path() const;
551 bool has_filename() const;
552 bool has_stem() const;
553 bool has_extension() const;
554 bool is_absolute() const;
555 bool is_relative() const;
558 path lexically_normal() const;
559 path lexically_relative(const
path& base) const;
560 path lexically_proximate(const
path& base) const;
565 iterator
begin() const;
566 iterator
end() const;
574 template <typename InputIterator>
575 class input_iterator_range
578 typedef InputIterator iterator;
582 input_iterator_range(
const InputIterator&
first,
const InputIterator&
last)
588 InputIterator
begin()
const {
return _first; }
589 InputIterator
end()
const {
return _last; }
592 InputIterator _first;
598 string_type::size_type root_name_length() const noexcept;
599 void postprocess_path_with_format(
format fmt);
600 void check_long_path();
601 impl_string_type _path;
603 void handle_prefixes();
604 friend bool detail::has_executable_extension(
const path& p);
605#ifdef GHC_WIN_AUTO_PREFIX_LONG_PATH
606 string_type::size_type _prefixLength{0};
608 static const string_type::size_type _prefixLength{0};
611 static const string_type::size_type _prefixLength{0};
618#ifdef GHC_HAS_THREEWAY_COMP
619GHC_FS_API std::strong_ordering operator<=>(
const path& lhs,
const path& rhs)
noexcept;
630template <
class charT,
class traits>
631std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os,
const path& p);
632template <
class charT,
class traits>
633std::basic_istream<charT, traits>&
operator>>(std::basic_istream<charT, traits>& is, path& p);
636template <
class Source,
typename = path::path_from_
string<Source>>
637#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
638[[deprecated(
"use ghc::filesystem::path::path() with std::u8string instead")]]
641template <
class InputIterator>
642#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
643[[deprecated(
"use ghc::filesystem::path::path() with std::u8string instead")]]
654 const path& path1()
const noexcept;
655 const path& path2()
const noexcept;
656 const char* what()
const noexcept override;
659 std::string _what_arg;
686 impl_string_type::const_iterator increment(
const impl_string_type::const_iterator& pos)
const;
687 impl_string_type::const_iterator decrement(
const impl_string_type::const_iterator& pos)
const;
688 void updateCurrent();
689 impl_string_type::const_iterator _first;
690 impl_string_type::const_iterator _last;
691 impl_string_type::const_iterator _prefix;
692 impl_string_type::const_iterator _root;
693 impl_string_type::const_iterator _iter;
817#ifdef GHC_WITH_EXCEPTIONS
828#ifdef GHC_WITH_EXCEPTIONS
829 void assign(
const path& p);
830 void replace_filename(
const path& p);
833 void assign(
const path& p, std::error_code& ec);
834 void replace_filename(
const path& p, std::error_code& ec);
835 void refresh(std::error_code& ec)
noexcept;
839 operator const filesystem::
path&() const noexcept;
840#ifdef GHC_WITH_EXCEPTIONS
855 bool exists(std::error_code& ec)
const noexcept;
859 bool is_fifo(std::error_code& ec)
const noexcept;
860 bool is_other(std::error_code& ec)
const noexcept;
862 bool is_socket(std::error_code& ec)
const noexcept;
863 bool is_symlink(std::error_code& ec)
const noexcept;
864 uintmax_t
file_size(std::error_code& ec)
const noexcept;
870#ifdef GHC_WITH_EXCEPTIONS
876#ifdef GHC_HAS_THREEWAY_COMP
877 std::strong_ordering operator<=>(
const directory_entry& rhs)
const noexcept;
888#ifdef GHC_WITH_EXCEPTIONS
891 file_type status_file_type(std::error_code& ec)
const noexcept;
895 uintmax_t _file_size =
static_cast<uintmax_t
>(-1);
896#ifndef GHC_OS_WINDOWS
897 uintmax_t _hard_link_count =
static_cast<uintmax_t
>(-1);
899 time_t _last_write_time = 0;
914 : _dir_entry(dir_entry)
929#ifdef GHC_WITH_EXCEPTIONS
942#ifdef GHC_WITH_EXCEPTIONS
948#ifdef GHC_WITH_EXCEPTIONS
956 bool operator==(
const directory_iterator& rhs)
const;
957 bool operator!=(
const directory_iterator& rhs)
const;
962 std::shared_ptr<impl> _impl;
981#ifdef GHC_WITH_EXCEPTIONS
994 bool recursion_pending()
const;
1002#ifdef GHC_WITH_EXCEPTIONS
1007#ifdef GHC_WITH_EXCEPTIONS
1010 void pop(std::error_code& ec);
1011 void disable_recursion_pending();
1014#ifdef GHC_WITH_EXCEPTIONS
1022 bool operator==(
const recursive_directory_iterator& rhs)
const;
1023 bool operator!=(
const recursive_directory_iterator& rhs)
const;
1026 struct recursive_directory_iterator_impl
1029 bool _recursion_pending;
1030 std::stack<directory_iterator> _dir_iter_stack;
1031 recursive_directory_iterator_impl(
directory_options options,
bool recursion_pending)
1033 , _recursion_pending(recursion_pending)
1037 std::shared_ptr<recursive_directory_iterator_impl> _impl;
1041GHC_FS_API recursive_directory_iterator
begin(recursive_directory_iterator iter)
noexcept;
1042GHC_FS_API recursive_directory_iterator
end(
const recursive_directory_iterator&)
noexcept;
1045#ifdef GHC_WITH_EXCEPTIONS
1094GHC_FS_API void copy_symlink(
const path& existing_symlink,
const path& new_symlink, std::error_code& ec)
noexcept;
1144#ifdef GHC_WITH_EXCEPTIONS
1153template <
class charT,
class traits = std::
char_traits<
charT>>
1163#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
1164 return std::basic_filebuf<charT, traits>::open(p.
wstring().c_str(), mode) ? this : 0;
1166 return std::basic_filebuf<charT, traits>::open(p.
string().c_str(), mode) ? this : 0;
1171template <
class charT,
class traits = std::
char_traits<
charT>>
1176#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
1177 explicit basic_ifstream(
const path& p, std::ios_base::openmode mode = std::ios_base::in)
1181 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.wstring().c_str(), mode); }
1187 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.
string().c_str(), mode); }
1194template <
class charT,
class traits = std::
char_traits<
charT>>
1199#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
1200 explicit basic_ofstream(
const path& p, std::ios_base::openmode mode = std::ios_base::out)
1204 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.wstring().c_str(), mode); }
1210 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.
string().c_str(), mode); }
1217template <
class charT,
class traits = std::
char_traits<
charT>>
1222#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
1223 explicit basic_fstream(
const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out)
1227 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.wstring().c_str(), mode); }
1229 explicit basic_fstream(
const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out)
1233 void open(
const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.
string().c_str(), mode); }
1267#ifdef GHC_OS_WINDOWS
1268 std::vector<std::string> _args;
1269 std::vector<char*> _argp;
1294#ifdef GHC_OS_WINDOWS
1303#ifdef GHC_EXPAND_IMPL
1307#ifdef GHC_OS_WINDOWS
1310 return std::error_code();
1322#ifdef ERROR_DIRECTORY_NOT_SUPPORTED
1331 return std::error_code();
1346 return std::error_code();
1349#ifdef GHC_OS_WINDOWS
1352 return std::error_code(err ?
static_cast<int>(err) :
static_cast<int>(::GetLastError()),
std::system_category());
1363template <
typename Enum>
1364using EnableBitmask =
typename std::enable_if<std::is_same<Enum, perms>::value || std::is_same<Enum, perm_options>::value || std::is_same<Enum, copy_options>::value || std::is_same<Enum, directory_options>::value, Enum>
::type;
1367template <
typename Enum>
1374template <
typename Enum>
1381template <
typename Enum>
1388template <
typename Enum>
1392 return static_cast<Enum
>(~static_cast<underlying>(X));
1395template <
typename Enum>
1402template <
typename Enum>
1409template <
typename Enum>
1416#ifdef GHC_EXPAND_IMPL
1422 return (
static_cast<uint32_t>(
c - lo) < (hi - lo + 1));
1432 return (
c & 0xfffffc00) == 0xd800;
1437 return (
c & 0xfffffc00) == 0xdc00;
1442 if (unicode <= 0x7f) {
1443 str.push_back(
static_cast<char>(unicode));
1445 else if (unicode >= 0x80 && unicode <= 0x7ff) {
1446 str.push_back(
static_cast<char>((unicode >> 6) + 192));
1447 str.push_back(
static_cast<char>((unicode & 0x3f) + 128));
1449 else if ((unicode >= 0x800 && unicode <= 0xd7ff) || (unicode >= 0xe000 && unicode <= 0xffff)) {
1450 str.push_back(
static_cast<char>((unicode >> 12) + 224));
1451 str.push_back(
static_cast<char>(((unicode & 0xfff) >> 6) + 128));
1452 str.push_back(
static_cast<char>((unicode & 0x3f) + 128));
1454 else if (unicode >= 0x10000 && unicode <= 0x10ffff) {
1455 str.push_back(
static_cast<char>((unicode >> 18) + 240));
1456 str.push_back(
static_cast<char>(((unicode & 0x3ffff) >> 12) + 128));
1457 str.push_back(
static_cast<char>(((unicode & 0xfff) >> 6) + 128));
1458 str.push_back(
static_cast<char>((unicode & 0x3f) + 128));
1461#ifdef GHC_RAISE_UNICODE_ERRORS
1474 static const uint32_t utf8_state_info[] = {
1476 0x11111111u, 0x11111111u, 0x77777777u, 0x77777777u, 0x88888888u, 0x88888888u, 0x88888888u, 0x88888888u, 0x22222299u, 0x22222222u, 0x22222222u, 0x22222222u, 0x3333333au, 0x33433333u, 0x9995666bu, 0x99999999u,
1477 0x88888880u, 0x22818108u, 0x88888881u, 0x88888882u, 0x88888884u, 0x88888887u, 0x88888886u, 0x82218108u, 0x82281108u, 0x88888888u, 0x88888883u, 0x88888885u, 0u, 0u, 0u, 0u,
1479 uint8_t category = fragment < 128 ? 0 : (utf8_state_info[(fragment >> 3) & 0xf] >> ((fragment & 7) << 2)) & 0xf;
1480 codepoint = (state ? (codepoint << 6) | (fragment & 0x3fu) : (0xffu >> category) & fragment);
1481 return state ==
S_RJCT ?
static_cast<unsigned>(
S_RJCT) :
static_cast<unsigned>((utf8_state_info[category + 16] >> (state << 2)) & 0xf);
1486 std::string::const_iterator iter = utf8String.begin();
1487 unsigned utf8_state =
S_STRT;
1489 while (iter < utf8String.end()) {
1506template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (
sizeof(
typename Utf8String::value_type) == 1) && (
sizeof(
typename StringType::value_type) == 1)>
::type* =
nullptr>
1507inline StringType
fromUtf8(
const Utf8String& utf8String,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1509 return StringType(utf8String.begin(), utf8String.end(), alloc);
1512template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (
sizeof(
typename Utf8String::value_type) == 1) && (
sizeof(
typename StringType::value_type) == 2)>
::type* =
nullptr>
1513inline StringType
fromUtf8(
const Utf8String& utf8String,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1515 StringType
result(alloc);
1516 result.reserve(utf8String.length());
1517 auto iter = utf8String.cbegin();
1518 unsigned utf8_state =
S_STRT;
1520 while (iter < utf8String.cend()) {
1522 if (codepoint <= 0xffff) {
1523 result +=
static_cast<typename StringType::value_type
>(codepoint);
1526 codepoint -= 0x10000;
1527 result +=
static_cast<typename StringType::value_type
>((codepoint >> 10) + 0xd800);
1528 result +=
static_cast<typename StringType::value_type
>((codepoint & 0x3ff) + 0xdc00);
1532 else if (utf8_state ==
S_RJCT) {
1533#ifdef GHC_RAISE_UNICODE_ERRORS
1534 throw filesystem_error(
"Illegal byte sequence for unicode character.", utf8String,
std::make_error_code(std::errc::illegal_byte_sequence));
1536 result +=
static_cast<typename StringType::value_type
>(0xfffd);
1543#ifdef GHC_RAISE_UNICODE_ERRORS
1544 throw filesystem_error(
"Illegal byte sequence for unicode character.", utf8String,
std::make_error_code(std::errc::illegal_byte_sequence));
1546 result +=
static_cast<typename StringType::value_type
>(0xfffd);
1552template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (
sizeof(
typename Utf8String::value_type) == 1) && (
sizeof(
typename StringType::value_type) == 4)>
::type* =
nullptr>
1553inline StringType
fromUtf8(
const Utf8String& utf8String,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1555 StringType
result(alloc);
1556 result.reserve(utf8String.length());
1557 auto iter = utf8String.cbegin();
1558 unsigned utf8_state =
S_STRT;
1560 while (iter < utf8String.cend()) {
1562 result +=
static_cast<typename StringType::value_type
>(codepoint);
1565 else if (utf8_state ==
S_RJCT) {
1566#ifdef GHC_RAISE_UNICODE_ERRORS
1567 throw filesystem_error(
"Illegal byte sequence for unicode character.", utf8String,
std::make_error_code(std::errc::illegal_byte_sequence));
1569 result +=
static_cast<typename StringType::value_type
>(0xfffd);
1576#ifdef GHC_RAISE_UNICODE_ERRORS
1577 throw filesystem_error(
"Illegal byte sequence for unicode character.", utf8String,
std::make_error_code(std::errc::illegal_byte_sequence));
1579 result +=
static_cast<typename StringType::value_type
>(0xfffd);
1585template <
class StringType,
typename charT, std::
size_t N>
1586inline StringType
fromUtf8(
const charT (&utf8String)[N])
1588#ifdef GHC_WITH_STRING_VIEW
1591 return fromUtf8<StringType>(std::basic_string<charT>(utf8String, N - 1));
1595template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 1),
int>
::type size = 1>
1596inline std::string
toUtf8(
const strT& unicodeString)
1598 return std::string(unicodeString.begin(), unicodeString.end());
1601template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 2),
int>
::type size = 2>
1602inline std::string
toUtf8(
const strT& unicodeString)
1605 for (
auto iter = unicodeString.begin(); iter != unicodeString.end(); ++iter) {
1613#ifdef GHC_RAISE_UNICODE_ERRORS
1614 throw filesystem_error(
"Illegal code point for unicode character.",
result,
std::make_error_code(std::errc::illegal_byte_sequence));
1617 if (iter == unicodeString.end()) {
1630template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 4),
int>
::type size = 4>
1631inline std::string
toUtf8(
const strT& unicodeString)
1634 for (
auto c : unicodeString) {
1640template <
typename charT>
1641inline std::string
toUtf8(
const charT* unicodeString)
1643#ifdef GHC_WITH_STRING_VIEW
1646 return toUtf8(std::basic_string<charT, std::char_traits<charT>>(unicodeString));
1650#ifdef GHC_USE_WCHAR_T
1651template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (
sizeof(
typename WString::value_type) == 2) && (
sizeof(
typename StringType::value_type) == 1),
bool>
::type =
false>
1652inline StringType fromWChar(
const WString& wString,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1654 auto temp =
toUtf8(wString);
1655 return StringType(temp.begin(), temp.end(), alloc);
1658template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (
sizeof(
typename WString::value_type) == 2) && (
sizeof(
typename StringType::value_type) == 2),
bool>
::type =
false>
1659inline StringType fromWChar(
const WString& wString,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1661 return StringType(wString.begin(), wString.end(), alloc);
1664template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (
sizeof(
typename WString::value_type) == 2) && (
sizeof(
typename StringType::value_type) == 4),
bool>
::type =
false>
1665inline StringType fromWChar(
const WString& wString,
const typename StringType::allocator_type& alloc =
typename StringType::allocator_type())
1667 auto temp =
toUtf8(wString);
1668 return fromUtf8<StringType>(temp, alloc);
1671template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 1),
bool>
::type =
false>
1672inline std::wstring toWChar(
const strT& unicodeString)
1674 return fromUtf8<std::wstring>(unicodeString);
1677template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 2),
bool>
::type =
false>
1678inline std::wstring toWChar(
const strT& unicodeString)
1680 return std::wstring(unicodeString.begin(), unicodeString.end());
1683template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (
sizeof(
typename strT::value_type) == 4),
bool>
::type =
false>
1684inline std::wstring toWChar(
const strT& unicodeString)
1686 auto temp =
toUtf8(unicodeString);
1687 return fromUtf8<std::wstring>(temp);
1690template <
typename charT>
1691inline std::wstring toWChar(
const charT* unicodeString)
1693#ifdef GHC_WITH_STRING_VIEW
1694 return toWChar(
basic_string_view<charT, std::char_traits<charT>>(unicodeString));
1696 return toWChar(std::basic_string<charT, std::char_traits<charT>>(unicodeString));
1703#ifdef GHC_EXPAND_IMPL
1707template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value,
bool>
::type =
true>
1710 return with.length() <= what.length() && equal(with.begin(), with.end(), what.begin());
1713template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value,
bool>
::type =
true>
1716 return with.length() <= what.length() && what.compare(what.length() - with.length(), with.size(), with) == 0;
1723#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
1732#ifdef GHC_RAISE_UNICODE_ERRORS
1736 throw filesystem_error(
"Illegal byte sequence for unicode character.", t,
std::make_error_code(std::errc::illegal_byte_sequence));
1740#ifdef GHC_OS_WINDOWS
1744 for (
auto&
c : _path) {
1745 if (
c == generic_separator) {
1749#ifdef GHC_WIN_AUTO_PREFIX_LONG_PATH
1765 impl_string_type::iterator new_end = std::unique(_path.begin() +
static_cast<string_type::difference_type
>(_prefixLength) + 2, _path.end(), [](
path::value_type lhs,
path::value_type rhs) { return lhs == rhs && lhs == preferred_separator; });
1766 _path.erase(new_end, _path.end());
1769 impl_string_type::iterator new_end = std::unique(_path.begin() +
static_cast<string_type::difference_type
>(_prefixLength), _path.end(), [](
path::value_type lhs,
path::value_type rhs) { return lhs == rhs && lhs == preferred_separator; });
1770 _path.erase(new_end, _path.end());
1776template <
class Source,
typename>
1778#ifdef GHC_USE_WCHAR_T
1779 : _path(detail::toWChar(
source))
1784 postprocess_path_with_format(fmt);
1787template <
class Source,
typename>
1792template <
class InputIterator>
1798template <
class InputIterator>
1805#ifdef GHC_EXPAND_IMPL
1811#ifdef GHC_OS_WINDOWS
1813 while (::tolower((
unsigned char)*str1) == ::tolower((
unsigned char)*str2++)) {
1819#ifdef GHC_USE_WCHAR_T
1820 return 0 == ::_wcsicmp(str1, str2);
1822 return 0 == ::_stricmp(str1, str2);
1826 return 0 == ::strcasecmp(str1, str2);
1832 while (len1 > 0 && len2 > 0 && ::tolower(
static_cast<unsigned char>(*str1)) == ::tolower(
static_cast<unsigned char>(*str2))) {
1839 return *str1 < *str2 ? -1 : 1;
1841 if (len1 == 0 && len2 == 0) {
1844 return len1 == 0 ? -1 : 1;
1855 return "Error in strerror_r!";
1860template <
typename ErrorNumber>
1863#if defined(GHC_OS_WINDOWS)
1865 DWORD dw =
code ?
static_cast<DWORD
>(
code) : ::GetLastError();
1866 FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&msgBuf, 0, NULL);
1867 std::string msg =
toUtf8(std::wstring((LPWSTR)msgBuf));
1876#ifdef GHC_OS_WINDOWS
1877using CreateSymbolicLinkW_fp = BOOLEAN(WINAPI*)(LPCWSTR, LPCWSTR, DWORD);
1878using CreateHardLinkW_fp = BOOLEAN(WINAPI*)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
1882 std::error_code tec;
1883 auto fs =
status(target_name, tec);
1888#if defined(__GNUC__) && __GNUC__ >= 8
1889#pragma GCC diagnostic push
1890#pragma GCC diagnostic ignored "-Wcast-function-type"
1892 static CreateSymbolicLinkW_fp api_call =
reinterpret_cast<CreateSymbolicLinkW_fp
>(GetProcAddress(GetModuleHandleW(
L"kernel32.dll"),
"CreateSymbolicLinkW"));
1893#if defined(__GNUC__) && __GNUC__ >= 8
1894#pragma GCC diagnostic pop
1897 if (api_call(detail::fromUtf8<std::wstring>(new_symlink.
u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.
u8string()).c_str(), to_directory ? 1 : 0) == 0) {
1898 auto result = ::GetLastError();
1899 if (
result == ERROR_PRIVILEGE_NOT_HELD && api_call(detail::fromUtf8<std::wstring>(new_symlink.
u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.
u8string()).c_str(), to_directory ? 3 : 2) != 0) {
1912#if defined(__GNUC__) && __GNUC__ >= 8
1913#pragma GCC diagnostic push
1914#pragma GCC diagnostic ignored "-Wcast-function-type"
1916 static CreateHardLinkW_fp api_call =
reinterpret_cast<CreateHardLinkW_fp
>(GetProcAddress(GetModuleHandleW(
L"kernel32.dll"),
"CreateHardLinkW"));
1917#if defined(__GNUC__) && __GNUC__ >= 8
1918#pragma GCC diagnostic pop
1930GHC_INLINE path getFullPathName(
const wchar_t* p, std::error_code& ec)
1932 ULONG
size = ::GetFullPathNameW(p, 0, 0, 0);
1934 std::vector<wchar_t> buf(
size, 0);
1935 ULONG s2 = GetFullPathNameW(p,
size, buf.data(),
nullptr);
1936 if (s2 && s2 <
size) {
1937 return path(std::wstring(buf.data(), s2));
1947 if (::symlink(target_name.
c_str(), new_symlink.
c_str()) != 0) {
1962template <
typename T>
1965#ifdef GHC_OS_WINDOWS
1967 if ((mode & _S_IFDIR) == _S_IFDIR) {
1970 else if ((mode & _S_IFREG) == _S_IFREG) {
1973 else if ((mode & _S_IFCHR) == _S_IFCHR) {
1976 perms prms =
static_cast<perms>(mode & 0xfff);
1980 if (S_ISDIR(mode)) {
1983 else if (S_ISREG(mode)) {
1986 else if (S_ISCHR(mode)) {
1989 else if (S_ISBLK(mode)) {
1992 else if (S_ISFIFO(mode)) {
1995 else if (S_ISLNK(mode)) {
1998 else if (S_ISSOCK(mode)) {
2001 perms prms =
static_cast<perms>(mode & 0xfff);
2006#ifdef GHC_OS_WINDOWS
2007#ifndef REPARSE_DATA_BUFFER_HEADER_SIZE
2008typedef struct _REPARSE_DATA_BUFFER
2011 USHORT ReparseDataLength;
2017 USHORT SubstituteNameOffset;
2018 USHORT SubstituteNameLength;
2019 USHORT PrintNameOffset;
2020 USHORT PrintNameLength;
2022 WCHAR PathBuffer[1];
2023 } SymbolicLinkReparseBuffer;
2026 USHORT SubstituteNameOffset;
2027 USHORT SubstituteNameLength;
2028 USHORT PrintNameOffset;
2029 USHORT PrintNameLength;
2030 WCHAR PathBuffer[1];
2031 } MountPointReparseBuffer;
2034 UCHAR DataBuffer[1];
2035 } GenericReparseBuffer;
2037} REPARSE_DATA_BUFFER;
2038#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
2039#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE (16 * 1024)
2043GHC_INLINE std::shared_ptr<REPARSE_DATA_BUFFER> getReparseData(
const path& p, std::error_code& ec)
2045 std::shared_ptr<void>
file(CreateFileW(
GHC_NATIVEWP(p), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
2046 if (
file.get() == INVALID_HANDLE_VALUE) {
2051 std::shared_ptr<REPARSE_DATA_BUFFER> reparseData((REPARSE_DATA_BUFFER*)std::calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE),
std::free);
2053 if (DeviceIoControl(
file.get(), FSCTL_GET_REPARSE_POINT, 0, 0, reparseData.get(), MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bufferUsed, 0)) {
2065#ifdef GHC_OS_WINDOWS
2067 auto reparseData = detail::getReparseData(p, ec);
2069 if (reparseData && IsReparseTagMicrosoft(reparseData->ReparseTag)) {
2070 switch (reparseData->ReparseTag) {
2071 case IO_REPARSE_TAG_SYMLINK: {
2072 auto printName = std::wstring(&reparseData->SymbolicLinkReparseBuffer.PathBuffer[reparseData->SymbolicLinkReparseBuffer.PrintNameOffset /
sizeof(WCHAR)], reparseData->SymbolicLinkReparseBuffer.PrintNameLength /
sizeof(WCHAR));
2073 auto substituteName =
2074 std::wstring(&reparseData->SymbolicLinkReparseBuffer.PathBuffer[reparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset /
sizeof(WCHAR)], reparseData->SymbolicLinkReparseBuffer.SubstituteNameLength /
sizeof(WCHAR));
2081 if (reparseData->SymbolicLinkReparseBuffer.Flags & 0x1 ) {
2086 case IO_REPARSE_TAG_MOUNT_POINT:
2097 size_t bufferSize = 256;
2099 std::vector<char>
buffer(bufferSize,
static_cast<char>(0));
2105 else if (rc <
static_cast<int>(bufferSize)) {
2106 return path(std::string(
buffer.
data(),
static_cast<std::string::size_type
>(rc)));
2114#ifdef GHC_OS_WINDOWS
2115GHC_INLINE time_t timeFromFILETIME(
const FILETIME& ft)
2118 ull.LowPart = ft.dwLowDateTime;
2119 ull.HighPart = ft.dwHighDateTime;
2120 return static_cast<time_t
>(ull.QuadPart / 10000000ULL - 11644473600ULL);
2123GHC_INLINE void timeToFILETIME(time_t t, FILETIME& ft)
2126 ll = Int32x32To64(t, 10000000) + 116444736000000000;
2127 ft.dwLowDateTime =
static_cast<DWORD
>(ll);
2128 ft.dwHighDateTime =
static_cast<DWORD
>(ll >> 32);
2131template <
typename INFO>
2132GHC_INLINE uintmax_t hard_links_from_INFO(
const INFO* info)
2134 return static_cast<uintmax_t
>(-1);
2138GHC_INLINE uintmax_t hard_links_from_INFO<BY_HANDLE_FILE_INFORMATION>(
const BY_HANDLE_FILE_INFORMATION* info)
2140 return info->nNumberOfLinks;
2143template <
typename INFO>
2144GHC_INLINE DWORD reparse_tag_from_INFO(
const INFO*)
2150GHC_INLINE DWORD reparse_tag_from_INFO(
const WIN32_FIND_DATAW* info)
2152 return info->dwReserved0;
2155template <
typename INFO>
2156GHC_INLINE file_status status_from_INFO(
const path& p,
const INFO* info, std::error_code& ec, uintmax_t* sz =
nullptr, time_t* lwt =
nullptr)
2159 if (
sizeof(INFO) ==
sizeof(WIN32_FIND_DATAW)) {
2160 if (detail::reparse_tag_from_INFO(info) == IO_REPARSE_TAG_SYMLINK) {
2165 if ((info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
2166 auto reparseData = detail::getReparseData(p, ec);
2167 if (!ec && reparseData && IsReparseTagMicrosoft(reparseData->ReparseTag) && reparseData->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
2173 if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
2181 if (!(info->dwFileAttributes & FILE_ATTRIBUTE_READONLY)) {
2184 if (has_executable_extension(p)) {
2188 *sz =
static_cast<uintmax_t
>(info->nFileSizeHigh) << (
sizeof(info->nFileSizeHigh) * 8) | info->nFileSizeLow;
2191 *lwt = detail::timeFromFILETIME(info->ftLastWriteTime);
2193 return file_status(ft, prms);
2200#ifdef GHC_OS_WINDOWS
2201 return ec.value() == ERROR_FILE_NOT_FOUND || ec.value() == ERROR_PATH_NOT_FOUND || ec.value() == ERROR_INVALID_NAME;
2203 return ec.value() == ENOENT || ec.value() == ENOTDIR;
2209#ifdef GHC_OS_WINDOWS
2211 WIN32_FILE_ATTRIBUTE_DATA attr;
2212 if (!GetFileAttributesExW(
GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
2217 fs = detail::status_from_INFO(p, &attr, ec, sz, lwt);
2248#ifdef GHC_OS_WINDOWS
2249 if (recurse_count > 16) {
2253 WIN32_FILE_ATTRIBUTE_DATA attr;
2254 if (!::GetFileAttributesExW(
GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
2257 else if (attr.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
2258 auto reparseData = detail::getReparseData(p, ec);
2259 if (!ec && reparseData && IsReparseTagMicrosoft(reparseData->ReparseTag) && reparseData->ReparseTag == IO_REPARSE_TAG_SYMLINK) {
2262 if (!ec && !target.
empty()) {
2264 *sls = status_from_INFO(p, &attr, ec);
2280 return detail::status_from_INFO(p, &attr, ec, sz, lwt);
2282 (void)recurse_count;
2305 *sz =
static_cast<uintmax_t
>(st.st_size);
2334#ifdef GHC_OS_WINDOWS
2336 p = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
2337 _args.reserve(
static_cast<size_t>(argc));
2338 _argp.reserve(
static_cast<size_t>(argc));
2339 for (
size_t i = 0; i < static_cast<size_t>(argc); ++i) {
2341 _argp.push_back((
char*)_args[i].data());
2343 argv = _argp.data();
2347 std::setlocale(LC_ALL,
"");
2348#if defined(__ANDROID__) && __ANDROID_API__ < 26
2366 , _prefixLength(p._prefixLength)
2372 : _path(std::move(p._path))
2373#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2374 , _prefixLength(p._prefixLength)
2382 postprocess_path_with_format(fmt);
2387#ifdef GHC_WITH_EXCEPTIONS
2388template <
class Source,
typename>
2392 std::string locName = loc.name();
2393 if (!(locName.length() >= 5 && (locName.substr(locName.length() - 5) ==
"UTF-8" || locName.substr(locName.length() - 5) ==
"utf-8"))) {
2398template <
class InputIterator>
2400 : path(
std::basic_string<typename
std::iterator_traits<InputIterator>::value_type>(
first,
last), fmt)
2402 std::string locName = loc.name();
2403 if (!(locName.length() >= 5 && (locName.substr(locName.length() - 5) ==
"UTF-8" || locName.substr(locName.length() - 5) ==
"utf-8"))) {
2409#ifdef GHC_EXPAND_IMPL
2419#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2420 _prefixLength = p._prefixLength;
2427 _path = std::move(p._path);
2428#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2429 _prefixLength = p._prefixLength;
2441 _path = std::move(
source);
2448template <
class Source>
2454template <
class Source>
2457#ifdef GHC_USE_WCHAR_T
2470#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2471 _prefixLength =
source._prefixLength;
2476template <
class InputIterator>
2484#ifdef GHC_EXPAND_IMPL
2493 if (!_path.empty() && _path[_path.length() - 1] !=
preferred_separator && _path[_path.length() - 1] !=
':') {
2508 auto iter = p.
begin();
2513 while (iter != p.
end()) {
2518 _path += (*iter++).
native();
2524GHC_INLINE void path::append_name(
const value_type* name)
2526 if (_path.empty()) {
2540template <
class Source>
2546template <
class Source>
2558template <
class InputIterator>
2561 std::basic_string<typename std::iterator_traits<InputIterator>::value_type> part(
first,
last);
2565#ifdef GHC_EXPAND_IMPL
2580#ifdef GHC_WITH_STRING_VIEW
2589#ifdef GHC_WITH_STRING_VIEW
2599#ifdef GHC_OS_WINDOWS
2600 if (x == generic_separator) {
2613template <
class Source>
2619template <
class E
charT>
2622#ifdef GHC_WITH_STRING_VIEW
2625 std::basic_string<EcharT> part(1, x);
2631template <
class Source>
2639template <
class InputIterator>
2647#ifdef GHC_EXPAND_IMPL
2654#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2669 _path.erase(_path.size() -
filename()._path.size());
2677 return append(replacement);
2683 _path.erase(_path.size() -
extension()._path.size());
2685 if (!replacement.
empty() && replacement._path[0] !=
'.') {
2688 return concat(replacement);
2693 _path.swap(rhs._path);
2694#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2695 std::swap(_prefixLength, rhs._prefixLength);
2718template <
class E
charT,
class traits,
class Allocator>
2719inline std::basic_string<EcharT, traits, Allocator>
path::string(
const Allocator& a)
const
2721#ifdef GHC_USE_WCHAR_T
2722 return detail::fromWChar<std::basic_string<EcharT, traits, Allocator>>(_path, a);
2724 return detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
2728#ifdef GHC_EXPAND_IMPL
2732#ifdef GHC_USE_WCHAR_T
2741#ifdef GHC_USE_WCHAR_T
2744 return detail::fromUtf8<std::wstring>(
native());
2748#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
2751#ifdef GHC_USE_WCHAR_T
2754 return std::u8string(
reinterpret_cast<const char8_t*
>(
c_str()));
2760#ifdef GHC_USE_WCHAR_T
2771 return detail::fromUtf8<std::u16string>(
string());
2777 return detail::fromUtf8<std::u32string>(
string());
2784template <
class E
charT,
class traits,
class Allocator>
2787#ifdef GHC_OS_WINDOWS
2788#ifdef GHC_USE_WCHAR_T
2791 auto result = detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
2795 c = generic_separator;
2800 return detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
2804#ifdef GHC_EXPAND_IMPL
2808#ifdef GHC_OS_WINDOWS
2809 return generic_string<std::string::value_type, std::string::traits_type, std::string::allocator_type>();
2817#ifdef GHC_OS_WINDOWS
2818 return generic_string<std::wstring::value_type, std::wstring::traits_type, std::wstring::allocator_type>();
2820 return detail::fromUtf8<std::wstring>(_path);
2824#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
2827#ifdef GHC_OS_WINDOWS
2828 return generic_string<std::u8string::value_type, std::u8string::traits_type, std::u8string::allocator_type>();
2830 return std::u8string(
reinterpret_cast<const char8_t*
>(_path.c_str()));
2836#ifdef GHC_OS_WINDOWS
2837 return generic_string<std::string::value_type, std::string::traits_type, std::string::allocator_type>();
2846#ifdef GHC_OS_WINDOWS
2847 return generic_string<std::u16string::value_type, std::u16string::traits_type, std::u16string::allocator_type>();
2849 return detail::fromUtf8<std::u16string>(_path);
2855#ifdef GHC_OS_WINDOWS
2856 return generic_string<std::u32string::value_type, std::u32string::traits_type, std::u32string::allocator_type>();
2858 return detail::fromUtf8<std::u32string>(_path);
2866#ifdef LWG_2936_BEHAVIOUR
2867 auto rnl1 = root_name_length();
2868 auto rnl2 = p.root_name_length();
2869#ifdef GHC_OS_WINDOWS
2872 auto rnc = _path.compare(0, rnl1, p._path, 0, (
std::min(rnl1, rnl2)));
2877 bool hrd1 = has_root_directory(), hrd2 = p.has_root_directory();
2879 return hrd1 ? 1 : -1;
2885 auto iter1 = _path.begin() +
static_cast<int>(rnl1);
2886 auto iter2 = p._path.begin() +
static_cast<int>(rnl2);
2887 while (iter1 != _path.end() && iter2 != p._path.end() && *iter1 == *iter2) {
2891 if (iter1 == _path.end()) {
2892 return iter2 == p._path.end() ? 0 : -1;
2894 if (iter2 == p._path.end()) {
2897 if (*iter1 == preferred_separator) {
2900 if (*iter2 == preferred_separator) {
2903 return *iter1 < *iter2 ? -1 : 1;
2905#ifdef GHC_OS_WINDOWS
2906 auto rnl1 = root_name_length();
2907 auto rnl2 = p.root_name_length();
2912 return _path.compare(rnl1, std::string::npos, p._path, rnl2, std::string::npos);
2914 return _path.compare(p._path);
2924#ifdef GHC_WITH_STRING_VIEW
2938#ifdef GHC_OS_WINDOWS
2941#if defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
2943 if (_path.length() >= 6 && _path[2] ==
'?' && std::toupper(
static_cast<unsigned char>(_path[4])) >=
'A' && std::toupper(
static_cast<unsigned char>(_path[4])) <=
'Z' && _path[5] ==
':') {
2952GHC_INLINE path::string_type::size_type path::root_name_length() const noexcept
2954#ifdef GHC_OS_WINDOWS
2955 if (_path.length() >= _prefixLength + 2 && std::toupper(
static_cast<unsigned char>(_path[_prefixLength])) >=
'A' && std::toupper(
static_cast<unsigned char>(_path[_prefixLength])) <=
'Z' && _path[_prefixLength + 1] ==
':') {
2961 if (pos == impl_string_type::npos) {
2962 return _path.length();
2992 auto rootPathLen = _prefixLength + root_name_length() + (
has_root_directory() ? 1 : 0);
2998 auto rootPathLen = _prefixLength + root_name_length() + (
has_root_directory() ? 1 : 0);
2999 if (rootPathLen < _path.length()) {
3005 auto iter = piter.decrement(_path.end());
3006 if (iter > _path.begin() +
static_cast<long>(rootPathLen) && *iter !=
preferred_separator) {
3025 if (fn !=
"." && fn !=
"..") {
3026 impl_string_type::size_type pos = fn.rfind(
'.');
3027 if (pos != impl_string_type::npos && pos > 0) {
3038 const auto& fn = *--iter;
3039 impl_string_type::size_type pos = fn._path.rfind(
'.');
3040 if (pos != std::string::npos && pos > 0) {
3047#ifdef GHC_OS_WINDOWS
3052 auto iter = p.
end();
3053 const auto& fn = *--iter;
3054 auto pos = fn._path.find_last_of(
'.');
3055 if (pos == std::string::npos || pos == 0 || fn._path.length() - pos != 3) {
3072 return _path.empty();
3077 return root_name_length() > 0;
3082 auto rootLen = _prefixLength + root_name_length();
3093 auto rootPathLen = _prefixLength + root_name_length() + (
has_root_directory() ? 1 : 0);
3094 return rootPathLen < _path.length();
3119#ifdef GHC_OS_WINDOWS
3136 bool lastDotDot =
false;
3142 else if (s ==
".." && !dest.
empty()) {
3147 else if (*(--dest.
end()) !=
"..") {
3149 dest._path.pop_back();
3155 if (!(s.empty() && lastDotDot)) {
3158 lastDotDot = s ==
"..";
3172 while (a !=
end() &&
b != base.
end() && *a == *
b) {
3176 if (a ==
end() &&
b == base.
end()) {
3180 for (
const auto& element : input_iterator_range<const_iterator>(
b, base.
end())) {
3181 if (element !=
"." && element !=
"" && element !=
"..") {
3184 else if (element ==
"..") {
3192 for (
int i = 0; i <
count; ++i) {
3195 for (
const auto& element : input_iterator_range<const_iterator>(a,
end())) {
3211GHC_INLINE path::iterator::iterator(
const path& p,
const impl_string_type::const_iterator& pos)
3212 : _first(p._path.
begin())
3213 , _last(p._path.
end())
3214 , _prefix(_first + static_cast<
string_type::difference_type>(p._prefixLength))
3215 , _root(p.has_root_directory() ? _first + static_cast<
string_type::difference_type>(p._prefixLength + p.root_name_length()) : _last)
3223GHC_INLINE path::impl_string_type::const_iterator path::iterator::increment(
const path::impl_string_type::const_iterator& pos)
const
3225 path::impl_string_type::const_iterator i = pos;
3226 bool fromStart = i == _first || i == _prefix;
3228 if (fromStart && i == _first && _prefix > _first) {
3231 else if (*i++ == preferred_separator) {
3233 if (i != _last && *i == preferred_separator) {
3234 if (fromStart && !(i + 1 != _last && *(i + 1) == preferred_separator)) {
3237 i =
std::find(++i, _last, preferred_separator);
3241 while (i != _last && *i == preferred_separator) {
3248 if (fromStart && i != _last && *i ==
':') {
3252 i =
std::find(i, _last, preferred_separator);
3259GHC_INLINE path::impl_string_type::const_iterator path::iterator::decrement(
const path::impl_string_type::const_iterator& pos)
const
3261 path::impl_string_type::const_iterator i = pos;
3266 if (i != _root && (pos != _last || *i != preferred_separator)) {
3267#ifdef GHC_OS_WINDOWS
3269 i = std::find_first_of(std::reverse_iterator<path::impl_string_type::const_iterator>(i), std::reverse_iterator<path::impl_string_type::const_iterator>(_first), seps.begin(), seps.end()).base();
3270 if (i > _first && *i ==
':') {
3274 i =
std::find(std::reverse_iterator<path::impl_string_type::const_iterator>(i), std::reverse_iterator<path::impl_string_type::const_iterator>(_first), preferred_separator).base();
3277 if (i - _first == 2 && *_first == preferred_separator && *(_first + 1) == preferred_separator) {
3285GHC_INLINE void path::iterator::updateCurrent()
3287 if ((_iter == _last) || (_iter != _first && _iter != _last && (*_iter == preferred_separator && _iter != _root) && (_iter + 1 == _last))) {
3291 _current.assign(_iter, increment(_iter));
3297 _iter = increment(_iter);
3298 while (_iter != _last &&
3300 *_iter == preferred_separator &&
3301 (_iter + 1) != _last
3318 _iter = decrement(_iter);
3332 return _iter == other._iter;
3337 return _iter != other._iter;
3345GHC_INLINE path::iterator::pointer path::iterator::operator->()
const
3352 return iterator(*
this, _path.begin());
3357 return iterator(*
this, _path.end());
3364 swap(lhs._path, rhs._path);
3369 return std::hash<std::string>()(p.generic_string());
3372#ifdef GHC_HAS_THREEWAY_COMP
3373GHC_INLINE std::strong_ordering operator<=>(
const path& lhs,
const path& rhs)
noexcept
3375 return lhs.compare(rhs) <=> 0;
3381 return lhs.compare(rhs) == 0;
3386 return !(lhs == rhs);
3391 return lhs.compare(rhs) < 0;
3396 return lhs.compare(rhs) <= 0;
3401 return lhs.compare(rhs) > 0;
3406 return lhs.compare(rhs) >= 0;
3420template <
class charT,
class traits>
3421inline std::basic_ostream<charT, traits>&
operator<<(std::basic_ostream<charT, traits>& os,
const path& p)
3424 auto ps = p.string<charT, traits>();
3426 if (
c ==
'"' ||
c ==
'\\') {
3435template <
class charT,
class traits>
3436inline std::basic_istream<charT, traits>&
operator>>(std::basic_istream<charT, traits>& is,
path& p)
3438 std::basic_string<charT, traits> tmp;
3442 auto sf = is.flags();
3443 is >> std::noskipws;
3450 tmp +=
static_cast<charT
>(c2);
3453 else if (c2 ==
'"') {
3457 tmp +=
static_cast<charT
>(c2);
3461 if ((sf & std::ios_base::skipws) == std::ios_base::skipws) {
3468 p =
path(
static_cast<charT
>(
c) + tmp);
3473#ifdef GHC_EXPAND_IMPL
3479 , _what_arg(what_arg)
3486 , _what_arg(what_arg)
3491 _what_arg +=
": '" + _p1.
string() +
"'";
3497 , _what_arg(what_arg)
3503 _what_arg +=
": '" + _p1.
string() +
"'";
3506 _what_arg +=
", '" + _p2.
string() +
"'";
3522 return _what_arg.c_str();
3527#ifdef GHC_WITH_EXCEPTIONS
3542#ifdef GHC_OS_WINDOWS
3548 std::vector<wchar_t> buf(
size, 0);
3550 if (s2 && s2 <
size) {
3588#ifdef GHC_WITH_EXCEPTIONS
3619 auto rootPathLen =
work._prefixLength +
work.root_name_length() + (
work.has_root_directory() ? 1 : 0);
3622 for (
auto pe :
work) {
3623 if (pe.empty() || pe ==
".") {
3626 else if (pe ==
"..") {
3630 else if ((
result / pe).string().length() <= rootPathLen) {
3644 if (target.is_absolute()) {
3663#ifdef GHC_WITH_EXCEPTIONS
3686 std::error_code tec;
3738#ifdef LWG_2682_BEHAVIOUR
3752 copy(iter->path(), to / iter->path().filename(), options |
static_cast<copy_options>(0x8000), ec);
3762#ifdef GHC_WITH_EXCEPTIONS
3786 std::error_code tecf, tect;
3788 auto st =
status(to, tect);
3789 bool overwrite =
false;
3811 if (from_time <= to_time) {
3817#ifdef GHC_OS_WINDOWS
3824 std::vector<char>
buffer(16384,
'\0');
3825 int in = -1, out = -1;
3826 if ((in = ::open(
from.c_str(), O_RDONLY)) < 0) {
3830 int mode = O_CREAT | O_WRONLY | O_TRUNC;
3834 if ((out = ::open(to.c_str(), mode,
static_cast<int>(sf.permissions() &
perms::all))) < 0) {
3861#ifdef GHC_WITH_EXCEPTIONS
3886#ifdef GHC_WITH_EXCEPTIONS
3902 bool didCreate =
false;
3906 std::error_code tec;
3915 std::error_code tmp_ec;
3925#ifndef LWG_2935_BEHAVIOUR
3936#ifdef GHC_WITH_EXCEPTIONS
3953#ifdef GHC_WITH_EXCEPTIONS
3967 std::error_code tec;
3970#ifdef LWG_2935_BEHAVIOUR
3979#ifdef GHC_OS_WINDOWS
3980 if (!attributes.empty()) {
3991 ::mode_t attribs =
static_cast<mode_t
>(
perms::all);
3992 if (!attributes.empty()) {
3993 struct ::stat fileStat;
3994 if (::stat(attributes.c_str(), &fileStat) != 0) {
3998 attribs = fileStat.st_mode;
4000 if (::mkdir(p.c_str(), attribs) != 0) {
4008#ifdef GHC_WITH_EXCEPTIONS
4025#ifdef GHC_WITH_EXCEPTIONS
4042#ifdef GHC_WITH_EXCEPTIONS
4058#ifdef GHC_WITH_EXCEPTIONS
4073#ifdef GHC_OS_WINDOWS
4074 DWORD pathlen = ::GetCurrentDirectoryW(0, 0);
4075 std::unique_ptr<wchar_t[]>
buffer(
new wchar_t[
size_t(pathlen) + 1]);
4076 if (::GetCurrentDirectoryW(pathlen,
buffer.get()) == 0) {
4082 size_t pathlen =
static_cast<size_t>(
std::max(
int(::pathconf(
".", _PC_PATH_MAX)),
int(PATH_MAX)));
4083 std::unique_ptr<char[]>
buffer(
new char[pathlen + 1]);
4084 if (::getcwd(
buffer.get(), pathlen) ==
nullptr) {
4092#ifdef GHC_WITH_EXCEPTIONS
4106#ifdef GHC_OS_WINDOWS
4111 if (::chdir(p.string().c_str()) == -1) {
4122#ifdef GHC_WITH_EXCEPTIONS
4138#ifdef GHC_WITH_EXCEPTIONS
4153#ifdef GHC_OS_WINDOWS
4154 std::shared_ptr<void> file1(::CreateFileW(
GHC_NATIVEWP(p1), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
4155 auto e1 = ::GetLastError();
4156 std::shared_ptr<void> file2(::CreateFileW(
GHC_NATIVEWP(p2), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
4157 if (file1.get() == INVALID_HANDLE_VALUE || file2.get() == INVALID_HANDLE_VALUE) {
4158#ifdef LWG_2937_BEHAVIOUR
4161 if (file1 == file2) {
4167 BY_HANDLE_FILE_INFORMATION inf1, inf2;
4168 if (!::GetFileInformationByHandle(file1.get(), &inf1)) {
4172 if (!::GetFileInformationByHandle(file2.get(), &inf2)) {
4176 return inf1.ftLastWriteTime.dwLowDateTime == inf2.ftLastWriteTime.dwLowDateTime && inf1.ftLastWriteTime.dwHighDateTime == inf2.ftLastWriteTime.dwHighDateTime && inf1.nFileIndexHigh == inf2.nFileIndexHigh && inf1.nFileIndexLow == inf2.nFileIndexLow &&
4177 inf1.nFileSizeHigh == inf2.nFileSizeHigh && inf1.nFileSizeLow == inf2.nFileSizeLow && inf1.dwVolumeSerialNumber == inf2.dwVolumeSerialNumber;
4179 struct ::stat s1, s2;
4180 auto rc1 = ::stat(p1.c_str(), &s1);
4182 auto rc2 = ::stat(p2.c_str(), &s2);
4184#ifdef LWG_2937_BEHAVIOUR
4193 return s1.st_dev == s2.st_dev && s1.st_ino == s2.st_ino && s1.st_size == s2.st_size && s1.st_mtime == s2.st_mtime;
4197#ifdef GHC_WITH_EXCEPTIONS
4212#ifdef GHC_OS_WINDOWS
4213 WIN32_FILE_ATTRIBUTE_DATA attr;
4214 if (!GetFileAttributesExW(
GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
4216 return static_cast<uintmax_t
>(-1);
4218 return static_cast<uintmax_t
>(attr.nFileSizeHigh) << (
sizeof(attr.nFileSizeHigh) * 8) | attr.nFileSizeLow;
4220 struct ::stat fileStat;
4221 if (::stat(p.c_str(), &fileStat) == -1) {
4223 return static_cast<uintmax_t
>(-1);
4225 return static_cast<uintmax_t
>(fileStat.st_size);
4230#ifdef GHC_WITH_EXCEPTIONS
4245#ifdef GHC_OS_WINDOWS
4246 uintmax_t
result =
static_cast<uintmax_t
>(-1);
4247 std::shared_ptr<void>
file(::CreateFileW(
GHC_NATIVEWP(p), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
4248 BY_HANDLE_FILE_INFORMATION inf;
4249 if (
file.get() == INVALID_HANDLE_VALUE) {
4253 if (!::GetFileInformationByHandle(
file.get(), &inf)) {
4257 result = inf.nNumberOfLinks;
4267 return ec ?
static_cast<uintmax_t
>(-1) :
result;
4277#ifdef GHC_WITH_EXCEPTIONS
4294#ifdef GHC_WITH_EXCEPTIONS
4311#ifdef GHC_WITH_EXCEPTIONS
4323#ifdef GHC_WITH_EXCEPTIONS
4327 return directory_iterator(p) == directory_iterator();
4362#ifdef GHC_WITH_EXCEPTIONS
4379#ifdef GHC_WITH_EXCEPTIONS
4396#ifdef GHC_WITH_EXCEPTIONS
4413#ifdef GHC_WITH_EXCEPTIONS
4430#ifdef GHC_WITH_EXCEPTIONS
4442#ifdef GHC_WITH_EXCEPTIONS
4462#ifdef GHC_WITH_EXCEPTIONS
4476 auto d = new_time.time_since_epoch();
4477#ifdef GHC_OS_WINDOWS
4478 std::shared_ptr<void>
file(::CreateFileW(
GHC_NATIVEWP(p), FILE_WRITE_ATTRIBUTES, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL), ::CloseHandle);
4480 auto tt = std::chrono::duration_cast<std::chrono::microseconds>(d).count() * 10 + 116444736000000000;
4481 ft.dwLowDateTime =
static_cast<DWORD
>(tt);
4482 ft.dwHighDateTime =
static_cast<DWORD
>(tt >> 32);
4483 if (!::SetFileTime(
file.get(), 0, 0, &ft)) {
4486#elif defined(GHC_OS_MACOS)
4487#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
4488#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
4490 if (::stat(p.c_str(), &
fs) == 0) {
4491 struct ::timeval tv[2];
4492 tv[0].tv_sec =
fs.st_atimespec.tv_sec;
4493 tv[0].tv_usec =
static_cast<int>(
fs.st_atimespec.tv_nsec / 1000);
4494 tv[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
4495 tv[1].tv_usec =
static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(d).count() % 1000000);
4496 if (::utimes(p.c_str(), tv) == 0) {
4503 struct ::timespec times[2];
4504 times[0].tv_sec = 0;
4506 times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
4507 times[1].tv_nsec = 0;
4508 if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
4516#define UTIME_OMIT ((1l << 30) - 2l)
4518 struct ::timespec times[2];
4519 times[0].tv_sec = 0;
4521 times[1].tv_sec =
static_cast<decltype(times[1].tv_sec)
>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
4522 times[1].tv_nsec =
static_cast<decltype(times[1].tv_nsec)
>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
4523#if defined(__ANDROID_API__) && __ANDROID_API__ < 12
4524 if (syscall(__NR_utimensat, AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
4526 if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
4534#ifdef GHC_WITH_EXCEPTIONS
4559 prms =
fs.permissions() | prms;
4562 prms =
fs.permissions() & ~prms;
4565#ifdef GHC_OS_WINDOWS
4568 if (oldAttr != INVALID_FILE_ATTRIBUTES) {
4570 if (oldAttr == newAttr || SetFileAttributesW(
GHC_NATIVEWP(p), newAttr)) {
4583 if (::_wchmod(p.
wstring().c_str(), mode) != 0) {
4589 if (::chmod(p.
c_str(),
static_cast<mode_t
>(prms)) != 0) {
4596#ifdef GHC_WITH_EXCEPTIONS
4607#ifdef GHC_WITH_EXCEPTIONS
4619#ifdef GHC_WITH_EXCEPTIONS
4647#ifdef GHC_WITH_EXCEPTIONS
4659#ifdef GHC_WITH_EXCEPTIONS
4674#ifdef GHC_OS_WINDOWS
4675#ifdef GHC_USE_WCHAR_T
4676 auto cstr = p.c_str();
4678 std::wstring np = detail::fromUtf8<std::wstring>(p.u8string());
4679 auto cstr = np.c_str();
4681 DWORD attr = GetFileAttributesW(cstr);
4682 if (attr == INVALID_FILE_ATTRIBUTES) {
4683 auto error = ::GetLastError();
4684 if (
error == ERROR_FILE_NOT_FOUND ||
error == ERROR_PATH_NOT_FOUND) {
4689 else if(attr & FILE_ATTRIBUTE_READONLY) {
4690 auto new_attr = attr & ~static_cast<DWORD>(FILE_ATTRIBUTE_READONLY);
4691 if(!SetFileAttributesW(cstr, new_attr)) {
4692 auto error = ::GetLastError();
4697 if (attr & FILE_ATTRIBUTE_DIRECTORY) {
4698 if (!RemoveDirectoryW(cstr)) {
4703 if (!DeleteFileW(cstr)) {
4711 if (
error == ENOENT) {
4717 return ec ? false :
true;
4720#ifdef GHC_WITH_EXCEPTIONS
4735 uintmax_t
count = 0;
4738 return static_cast<uintmax_t
>(-1);
4740 std::error_code tec;
4747 bool is_symlink_result = iter->is_symlink(ec);
4749 return static_cast<uintmax_t
>(-1);
4750 if (!is_symlink_result && iter->is_directory(ec)) {
4753 return static_cast<uintmax_t
>(-1);
4758 remove(iter->path(), ec);
4761 return static_cast<uintmax_t
>(-1);
4773 return static_cast<uintmax_t
>(-1);
4778#ifdef GHC_WITH_EXCEPTIONS
4792#ifdef GHC_OS_WINDOWS
4807#ifdef GHC_WITH_EXCEPTIONS
4821#ifdef GHC_OS_WINDOWS
4822 LARGE_INTEGER lisize;
4823 lisize.QuadPart =
static_cast<LONGLONG
>(
size);
4824 if (lisize.QuadPart < 0) {
4825#ifdef ERROR_FILE_TOO_LARGE
4832 std::shared_ptr<void>
file(CreateFileW(
GHC_NATIVEWP(p), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL), CloseHandle);
4833 if (
file.get() == INVALID_HANDLE_VALUE) {
4836 else if (SetFilePointerEx(
file.get(), lisize, NULL, FILE_BEGIN) == 0 || SetEndOfFile(
file.get()) == 0) {
4840 if (::truncate(p.c_str(),
static_cast<off_t
>(
size)) != 0) {
4846#ifdef GHC_WITH_EXCEPTIONS
4861#ifdef GHC_OS_WINDOWS
4862 ULARGE_INTEGER freeBytesAvailableToCaller = {{ 0, 0 }};
4863 ULARGE_INTEGER totalNumberOfBytes = {{ 0, 0 }};
4864 ULARGE_INTEGER totalNumberOfFreeBytes = {{ 0, 0 }};
4865 if (!GetDiskFreeSpaceExW(
GHC_NATIVEWP(p), &freeBytesAvailableToCaller, &totalNumberOfBytes, &totalNumberOfFreeBytes)) {
4867 return {
static_cast<uintmax_t
>(-1),
static_cast<uintmax_t
>(-1),
static_cast<uintmax_t
>(-1)};
4869 return {
static_cast<uintmax_t
>(totalNumberOfBytes.QuadPart),
static_cast<uintmax_t
>(totalNumberOfFreeBytes.QuadPart),
static_cast<uintmax_t
>(freeBytesAvailableToCaller.QuadPart)};
4871 struct ::statvfs sfs;
4872 if (::statvfs(p.c_str(), &sfs) != 0) {
4874 return {
static_cast<uintmax_t
>(-1),
static_cast<uintmax_t
>(-1),
static_cast<uintmax_t
>(-1)};
4876 return {
static_cast<uintmax_t
>(sfs.f_blocks * sfs.f_frsize),
static_cast<uintmax_t
>(sfs.f_bfree * sfs.f_frsize),
static_cast<uintmax_t
>(sfs.f_bavail * sfs.f_frsize)};
4880#ifdef GHC_WITH_EXCEPTIONS
4902#ifdef GHC_WITH_EXCEPTIONS
4919#ifdef GHC_WITH_EXCEPTIONS
4934#ifdef GHC_OS_WINDOWS
4936 auto rc = GetTempPathW(511,
buffer);
4937 if (!rc || rc > 511) {
4943 static const char* temp_vars[] = {
"TMPDIR",
"TMP",
"TEMP",
"TEMPDIR",
nullptr};
4944 const char* temp_path =
nullptr;
4945 for (
auto temp_name = temp_vars; *temp_name !=
nullptr; ++temp_name) {
4946 temp_path = std::getenv(*temp_name);
4948 return path(temp_path);
4951 return path(
"/tmp");
4955#ifdef GHC_WITH_EXCEPTIONS
4974 std::error_code tec;
5003 return ec ?
path() :
result.lexically_normal();
5021 : _type(other._type)
5022 , _perms(other._perms)
5027 : _type(other._type)
5028 , _perms(other._perms)
5038 _perms = rhs._perms;
5045 _perms = rhs._perms;
5077#ifdef GHC_WITH_EXCEPTIONS
5080 , _file_size(static_cast<uintmax_t>(-1))
5081#ifndef GHC_OS_WINDOWS
5082 , _hard_link_count(static_cast<uintmax_t>(-1))
5084 , _last_write_time(0)
5092 , _file_size(static_cast<uintmax_t>(-1))
5093#ifndef GHC_OS_WINDOWS
5094 , _hard_link_count(static_cast<uintmax_t>(-1))
5096 , _last_write_time(0)
5108#ifdef GHC_WITH_EXCEPTIONS
5122#ifdef GHC_WITH_EXCEPTIONS
5125 _path.replace_filename(p);
5132 _path.replace_filename(p);
5136#ifdef GHC_WITH_EXCEPTIONS
5149#ifdef GHC_OS_WINDOWS
5150 _status =
detail::status_ex(_path, ec, &_symlink_status, &_file_size,
nullptr, &_last_write_time);
5152 _status =
detail::status_ex(_path, ec, &_symlink_status, &_file_size, &_hard_link_count, &_last_write_time);
5167#ifdef GHC_WITH_EXCEPTIONS
5178 return _status.type();
5183#ifdef GHC_WITH_EXCEPTIONS
5195#ifdef GHC_WITH_EXCEPTIONS
5206#ifdef GHC_WITH_EXCEPTIONS
5218#ifdef GHC_WITH_EXCEPTIONS
5230#ifdef GHC_WITH_EXCEPTIONS
5242#ifdef GHC_WITH_EXCEPTIONS
5245 auto ft = status_file_type();
5252 auto ft = status_file_type(ec);
5254 return !ec && other;
5257#ifdef GHC_WITH_EXCEPTIONS
5269#ifdef GHC_WITH_EXCEPTIONS
5281#ifdef GHC_WITH_EXCEPTIONS
5297#ifdef GHC_WITH_EXCEPTIONS
5300 if (_file_size !=
static_cast<uintmax_t
>(-1)) {
5309 if (_file_size !=
static_cast<uintmax_t
>(-1)) {
5317#ifdef GHC_WITH_EXCEPTIONS
5320#ifndef GHC_OS_WINDOWS
5321 if (_hard_link_count !=
static_cast<uintmax_t
>(-1)) {
5322 return _hard_link_count;
5331#ifndef GHC_OS_WINDOWS
5332 if (_hard_link_count !=
static_cast<uintmax_t
>(-1)) {
5334 return _hard_link_count;
5341#ifdef GHC_WITH_EXCEPTIONS
5344 if (_last_write_time != 0) {
5345 return std::chrono::system_clock::from_time_t(_last_write_time);
5353 if (_last_write_time != 0) {
5355 return std::chrono::system_clock::from_time_t(_last_write_time);
5360#ifdef GHC_WITH_EXCEPTIONS
5379#ifdef GHC_WITH_EXCEPTIONS
5383 return _symlink_status;
5393 return _symlink_status;
5398#ifdef GHC_HAS_THREEWAY_COMP
5401 return _path <=> rhs._path;
5407 return _path < rhs._path;
5412 return _path == rhs._path;
5417 return _path != rhs._path;
5422 return _path <= rhs._path;
5427 return _path > rhs._path;
5432 return _path >= rhs._path;
5438#ifdef GHC_OS_WINDOWS
5445 , _dirHandle(INVALID_HANDLE_VALUE)
5448 ZeroMemory(&_findData,
sizeof(WIN32_FIND_DATAW));
5449 if ((_dirHandle = FindFirstFileW(
GHC_NATIVEWP((
_base /
"*")), &_findData)) != INVALID_HANDLE_VALUE) {
5450 if (std::wstring(_findData.cFileName) ==
L"." || std::wstring(_findData.cFileName) ==
L"..") {
5459 auto error = ::GetLastError();
5460 _base = filesystem::path();
5470 if (_dirHandle != INVALID_HANDLE_VALUE) {
5471 FindClose(_dirHandle);
5472 _dirHandle = INVALID_HANDLE_VALUE;
5477 if (_dirHandle != INVALID_HANDLE_VALUE) {
5479 if (FindNextFileW(_dirHandle, &_findData)) {
5481#ifdef GHC_USE_WCHAR_T
5482 _dir_entry._path.append_name(_findData.cFileName);
5484#ifdef GHC_RAISE_UNICODE_ERRORS
5488 catch (filesystem_error& fe) {
5499 auto err = ::GetLastError();
5500 if (err != ERROR_NO_MORE_FILES) {
5503 FindClose(_dirHandle);
5504 _dirHandle = INVALID_HANDLE_VALUE;
5508 }
while (std::wstring(_findData.cFileName) ==
L"." || std::wstring(_findData.cFileName) ==
L"..");
5516 if (_findData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
5528 _dir_entry._file_size =
static_cast<uintmax_t
>(-1);
5535 WIN32_FIND_DATAW _findData;
5538 std::error_code
_ec;
5598 }
while (skip || std::strcmp(
_entry->d_name,
".") == 0 || std::strcmp(
_entry->d_name,
"..") == 0);
5604#ifdef GHC_NO_DIRENT_D_TYPE
5620 if (
_entry->d_type != DT_LNK) {
5628 _dir_entry._file_size =
static_cast<uintmax_t
>(-1);
5629 _dir_entry._hard_link_count =
static_cast<uintmax_t
>(-1);
5647#ifdef GHC_WITH_EXCEPTIONS
5658 : _impl(new impl(p, options))
5675 : _impl(
new impl(p, options))
5688 : _impl(std::move(rhs._impl))
5702 _impl = std::move(rhs._impl);
5708 return _impl->_dir_entry;
5713 return &_impl->_dir_entry;
5716#ifdef GHC_WITH_EXCEPTIONS
5720 _impl->increment(ec);
5730 _impl->increment(ec);
5736 return _impl->_dir_entry._path == rhs._impl->_dir_entry._path;
5741 return _impl->_dir_entry._path != rhs._impl->_dir_entry._path;
5765#ifdef GHC_WITH_EXCEPTIONS
5773 : _impl(new recursive_directory_iterator_impl(options, true))
5775 _impl->_dir_iter_stack.push(directory_iterator(p,
options));
5780 : _impl(
new recursive_directory_iterator_impl(options,
true))
5797 : _impl(std::move(rhs._impl))
5806 return _impl->_options;
5811 return static_cast<int>(_impl->_dir_iter_stack.size() - 1);
5816 return _impl->_recursion_pending;
5821 return *(_impl->_dir_iter_stack.top());
5826 return &(*(_impl->_dir_iter_stack.top()));
5838 _impl = std::move(rhs._impl);
5842#ifdef GHC_WITH_EXCEPTIONS
5857 bool isDir = !ec && (*this)->is_directory(ec);
5863 _impl->_dir_iter_stack.push(
directory_iterator((*this)->path(), _impl->_options, ec));
5866 _impl->_dir_iter_stack.top().increment(ec);
5870 _impl->_dir_iter_stack.pop();
5871 _impl->_dir_iter_stack.top().increment(ec);
5874 else if (!_impl->_dir_iter_stack.empty()) {
5875 _impl->_dir_iter_stack.pop();
5877 _impl->_recursion_pending =
true;
5882#ifdef GHC_WITH_EXCEPTIONS
5900 _impl->_dir_iter_stack.pop();
5901 _impl->_dir_iter_stack.top().increment(ec);
5908 _impl->_recursion_pending =
false;
5914 return _impl->_dir_iter_stack.top() == rhs._impl->_dir_iter_stack.top();
5919 return _impl->_dir_iter_stack.top() != rhs._impl->_dir_iter_stack.top();
5940#undef GHC_EXPAND_IMPL
EIGEN_DOC_BLOCK_ADDONS_NOT_INNER_PANEL EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedBlockXpr< internal::get_fixed_value< NRowsType >::value, internal::get_fixed_value< NColsType >::value >::Type block(Index startRow, Index startCol, NRowsType blockRows, NColsType blockCols)
Definition: BlockMethods.h:96
you may not use this file except in compliance with the License You may obtain a copy of the License at software distributed under the License is distributed on an AS IS WITHOUT WARRANTIES OR CONDITIONS OF ANY either express or implied See the License for the specific language governing permissions and limitations under the License LLVM Exceptions to the Apache License As an if
Definition: ThirdPartyNotices.txt:292
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely the Work and Derivative Works thereof Contribution shall mean any work of including the original version of the Work and any modifications or additions to that Work or Derivative Works that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner For the purposes of this submitted means any form of or written communication sent to the Licensor or its including but not limited to communication on electronic mailing source code control and issue tracking systems that are managed or on behalf the Licensor for the purpose of discussing and improving the but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as Not a Contribution Contributor shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work Grant of Copyright License Subject to the terms and conditions of this each Contributor hereby grants to You a non no royalty free
Definition: ThirdPartyNotices.txt:154
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable or merely link(or bind by name) to the interfaces of
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the work(an example is provided in the Appendix below). "Derivative Works" shall mean any work
then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file
Definition: ThirdPartyNotices.txt:195
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition: ThirdPartyNotices.txt:114
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source code
Definition: ThirdPartyNotices.txt:113
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation and configuration files Object form shall mean any form resulting from mechanical transformation or translation of a Source including but not limited to compiled object generated and conversions to other media types Work shall mean the work of whether in Source or Object made available under the as indicated by a copyright notice that is included in or attached to the whether in Source or Object that is based or other modifications as a an original work of authorship For the purposes of this Derivative Works shall not include works that remain separable from
Definition: ThirdPartyNotices.txt:131
An implementation of std::basic_string_view for pre-C++17.
Definition: core.h:430
\rst A contiguous memory buffer with an optional growing ability.
Definition: core.h:862
FMT_CONSTEXPR auto data() noexcept -> T *
Returns a pointer to the buffer data.
Definition: core.h:908
constexpr auto size() const noexcept -> size_t
Returns the size of this buffer.
Definition: core.h:902
Definition: filesystem.hpp:1155
const basic_filebuf & operator=(const basic_filebuf &)=delete
~basic_filebuf() override
Definition: filesystem.hpp:1158
basic_filebuf< charT, traits > * open(const path &p, std::ios_base::openmode mode)
Definition: filesystem.hpp:1161
basic_filebuf()
Definition: filesystem.hpp:1157
basic_filebuf(const basic_filebuf &)=delete
Definition: filesystem.hpp:1219
const basic_fstream & operator=(const basic_fstream &)=delete
basic_fstream(const basic_fstream &)=delete
~basic_fstream() override
Definition: filesystem.hpp:1237
basic_fstream(const path &p, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
Definition: filesystem.hpp:1229
basic_fstream()
Definition: filesystem.hpp:1221
void open(const path &p, std::ios_base::openmode mode=std::ios_base::in|std::ios_base::out)
Definition: filesystem.hpp:1233
Definition: filesystem.hpp:1173
basic_ifstream(const path &p, std::ios_base::openmode mode=std::ios_base::in)
Definition: filesystem.hpp:1183
basic_ifstream(const basic_ifstream &)=delete
~basic_ifstream() override
Definition: filesystem.hpp:1191
void open(const path &p, std::ios_base::openmode mode=std::ios_base::in)
Definition: filesystem.hpp:1187
basic_ifstream()
Definition: filesystem.hpp:1175
const basic_ifstream & operator=(const basic_ifstream &)=delete
Definition: filesystem.hpp:1196
const basic_ofstream & operator=(const basic_ofstream &)=delete
basic_ofstream(const basic_ofstream &)=delete
basic_ofstream()
Definition: filesystem.hpp:1198
~basic_ofstream() override
Definition: filesystem.hpp:1214
basic_ofstream(const path &p, std::ios_base::openmode mode=std::ios_base::out)
Definition: filesystem.hpp:1206
void open(const path &p, std::ios_base::openmode mode=std::ios_base::out)
Definition: filesystem.hpp:1210
Definition: filesystem.hpp:811
uintmax_t file_size(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5307
bool operator<(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5405
file_status symlink_status(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5389
bool is_regular_file(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5264
bool is_block_file(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5201
uintmax_t hard_link_count(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5329
bool is_fifo(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5237
void assign(const path &p, std::error_code &ec)
Definition: filesystem.hpp:5116
bool operator>(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5425
directory_entry() noexcept=default
bool exists(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5190
bool is_character_file(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5213
bool is_directory(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5225
bool is_other(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5250
void refresh(std::error_code &ec) noexcept
Definition: filesystem.hpp:5147
bool operator>=(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5430
directory_entry & operator=(directory_entry &&) noexcept=default
bool operator<=(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5420
file_time_type last_write_time(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5351
~directory_entry()
Definition: filesystem.hpp:5101
void replace_filename(const path &p, std::error_code &ec)
Definition: filesystem.hpp:5130
bool is_symlink(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5288
bool operator!=(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5415
directory_entry & operator=(const directory_entry &)=default
file_status status(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5370
bool operator==(const directory_entry &rhs) const noexcept
Definition: filesystem.hpp:5410
const filesystem::path & path() const noexcept
Definition: filesystem.hpp:5157
bool is_socket(std::error_code &ec) const noexcept
Definition: filesystem.hpp:5276
Definition: filesystem.hpp:5543
~impl()
Definition: filesystem.hpp:5566
impl(const path &path, directory_options options)
Definition: filesystem.hpp:5545
std::error_code _ec
Definition: filesystem.hpp:5637
void copyToDirEntry()
Definition: filesystem.hpp:5602
impl(const impl &other)=delete
struct::dirent * _entry
Definition: filesystem.hpp:5635
directory_options _options
Definition: filesystem.hpp:5633
directory_entry _dir_entry
Definition: filesystem.hpp:5636
DIR * _dir
Definition: filesystem.hpp:5634
void increment(std::error_code &ec)
Definition: filesystem.hpp:5572
path _base
Definition: filesystem.hpp:5632
Definition: filesystem.hpp:907
const directory_entry & operator*() const &noexcept
Definition: filesystem.hpp:909
directory_entry operator*() &&noexcept
Definition: filesystem.hpp:910
Definition: filesystem.hpp:904
directory_iterator & operator=(const directory_iterator &rhs)
Definition: filesystem.hpp:5694
directory_iterator() noexcept
Definition: filesystem.hpp:5642
bool operator!=(const directory_iterator &rhs) const
Definition: filesystem.hpp:5739
std::ptrdiff_t difference_type
Definition: filesystem.hpp:923
const directory_entry * operator->() const
Definition: filesystem.hpp:5711
~directory_iterator()
Definition: filesystem.hpp:5692
std::input_iterator_tag iterator_category
Definition: filesystem.hpp:921
bool operator==(const directory_iterator &rhs) const
Definition: filesystem.hpp:5734
directory_iterator & increment(std::error_code &ec) noexcept
Definition: filesystem.hpp:5728
const directory_entry & operator*() const
Definition: filesystem.hpp:5706
Definition: filesystem.hpp:784
friend bool operator==(const file_status &lhs, const file_status &rhs) noexcept
Definition: filesystem.hpp:801
~file_status()
Definition: filesystem.hpp:5032
file_status() noexcept
Definition: filesystem.hpp:5009
perms permissions() const noexcept
Definition: filesystem.hpp:5066
void type(file_type ft) noexcept
Definition: filesystem.hpp:5050
void permissions(perms prms) noexcept
Definition: filesystem.hpp:5055
file_status & operator=(const file_status &) noexcept
Definition: filesystem.hpp:5035
file_type type() const noexcept
Definition: filesystem.hpp:5061
Definition: filesystem.hpp:649
const path & path2() const noexcept
Definition: filesystem.hpp:3515
filesystem_error(const std::string &what_arg, std::error_code ec)
Definition: filesystem.hpp:3477
const char * what() const noexcept override
Definition: filesystem.hpp:3520
const path & path1() const noexcept
Definition: filesystem.hpp:3510
Definition: filesystem.hpp:328
not_implemented_exception()
Definition: filesystem.hpp:330
Definition: filesystem.hpp:338
static constexpr value_type preferred_separator
Definition: filesystem.hpp:344
char_type value_type
Definition: filesystem.hpp:340
Definition: filesystem.hpp:374
path & replace_filename(const path &replacement)
Definition: filesystem.hpp:2674
std::string u8string() const
Definition: filesystem.hpp:2758
bool has_root_directory() const
Definition: filesystem.hpp:3080
iterator const_iterator
Definition: filesystem.hpp:564
std::basic_string< value_type > string_type
Definition: filesystem.hpp:378
void clear() noexcept
Definition: filesystem.hpp:2651
path stem() const
Definition: filesystem.hpp:3022
path & remove_filename()
Definition: filesystem.hpp:2666
std::u32string u32string() const
Definition: filesystem.hpp:2774
path & make_preferred()
Definition: filesystem.hpp:2659
int compare(const path &p) const noexcept
Definition: filesystem.hpp:2864
typename std::enable_if<!std::is_same< path, T1 >::value, path >::type path_type
Definition: filesystem.hpp:415
path filename() const
Definition: filesystem.hpp:3017
bool operator==(const iterator &other) const
std::ptrdiff_t difference_type
Definition: filesystem.hpp:668
path root_name() const
Definition: filesystem.hpp:2971
bool is_relative() const
Definition: filesystem.hpp:3126
std::string generic_string() const
Definition: filesystem.hpp:2806
const path value_type
Definition: filesystem.hpp:667
typename std::enable_if< _is_basic_string< T >::value||std::is_same< char const *, typename std::decay< T >::type >::value||std::is_same< char *, typename std::decay< T >::type >::value||std::is_same< char16_t const *, typename std::decay< T >::type >::value||std::is_same< char16_t *, typename std::decay< T >::type >::value||std::is_same< char32_t const *, typename std::decay< T >::type >::value||std::is_same< char32_t *, typename std::decay< T >::type >::value||std::is_same< wchar_t const *, typename std::decay< T >::type >::value||std::is_same< wchar_t *, typename std::decay< T >::type >::value, path >::type path_from_string
Definition: filesystem.hpp:430
iterator end() const
Definition: filesystem.hpp:3355
path & append(const Source &source)
Definition: filesystem.hpp:2547
format
The path format in which the constructor argument is given.
Definition: filesystem.hpp:383
@ native_format
The format native to the current platform this code is build for.
Definition: filesystem.hpp:386
@ auto_format
Try to auto-detect the format, fallback to native.
Definition: filesystem.hpp:388
@ generic_format
The generic format, internally used by ghc::filesystem::path with slashes.
Definition: filesystem.hpp:384
std::bidirectional_iterator_tag iterator_category
Definition: filesystem.hpp:671
std::u16string generic_u16string() const
Definition: filesystem.hpp:2844
path extension() const
Definition: filesystem.hpp:3034
bool has_extension() const
Definition: filesystem.hpp:3112
bool has_stem() const
Definition: filesystem.hpp:3107
path lexically_proximate(const path &base) const
Definition: filesystem.hpp:3201
bool operator!=(const iterator &other) const
std::string generic_u8string() const
Definition: filesystem.hpp:2834
bool has_root_name() const
Definition: filesystem.hpp:3075
bool has_filename() const
Definition: filesystem.hpp:3102
std::wstring wstring() const
Definition: filesystem.hpp:2739
path & concat(const Source &x)
Definition: filesystem.hpp:2632
path relative_path() const
Definition: filesystem.hpp:2990
iterator begin() const
Definition: filesystem.hpp:3350
iterator(const path &p, const impl_string_type::const_iterator &pos)
std::string string() const
Definition: filesystem.hpp:2730
path lexically_normal() const
Definition: filesystem.hpp:3133
path parent_path() const
Definition: filesystem.hpp:2996
bool is_absolute() const
Definition: filesystem.hpp:3117
path & replace_extension(const path &replacement=path())
Definition: filesystem.hpp:2680
~path()
Definition: filesystem.hpp:2411
void swap(path &rhs) noexcept
Definition: filesystem.hpp:2691
pointer operator->() const
bool has_parent_path() const
Definition: filesystem.hpp:3097
reference operator*() const
std::u32string generic_u32string() const
Definition: filesystem.hpp:2853
path root_directory() const
Definition: filesystem.hpp:2976
path root_path() const
Definition: filesystem.hpp:2985
path & operator=(const path &p)
Definition: filesystem.hpp:2416
std::basic_string< EcharT, traits, Allocator > string(const Allocator &a=Allocator()) const
Definition: filesystem.hpp:2719
typename std::enable_if< std::is_same< T, char >::value||std::is_same< T, char16_t >::value||std::is_same< T, char32_t >::value||std::is_same< T, wchar_t >::value, path >::type path_type_EcharT
Definition: filesystem.hpp:432
path & operator/=(const path &p)
Definition: filesystem.hpp:2489
std::u16string u16string() const
Definition: filesystem.hpp:2768
std::wstring generic_wstring() const
Definition: filesystem.hpp:2815
path lexically_relative(const path &base) const
Definition: filesystem.hpp:3166
path & operator+=(const path &x)
Definition: filesystem.hpp:2570
const string_type & native() const noexcept
Definition: filesystem.hpp:2701
friend class path
Definition: filesystem.hpp:685
const value_type * c_str() const noexcept
Definition: filesystem.hpp:2706
path & assign(string_type &&source)
Definition: filesystem.hpp:2439
bool has_root_path() const
Definition: filesystem.hpp:3086
bool has_relative_path() const
Definition: filesystem.hpp:3091
bool empty() const noexcept
Definition: filesystem.hpp:3070
Definition: filesystem.hpp:971
recursive_directory_iterator() noexcept
Definition: filesystem.hpp:5759
void disable_recursion_pending()
Definition: filesystem.hpp:5906
std::ptrdiff_t difference_type
Definition: filesystem.hpp:975
recursive_directory_iterator & operator=(const recursive_directory_iterator &rhs)
Definition: filesystem.hpp:5830
const directory_entry * operator->() const
Definition: filesystem.hpp:5824
directory_options options() const
Definition: filesystem.hpp:5804
recursive_directory_iterator & increment(std::error_code &ec) noexcept
Definition: filesystem.hpp:5854
bool operator==(const recursive_directory_iterator &rhs) const
Definition: filesystem.hpp:5912
~recursive_directory_iterator()
Definition: filesystem.hpp:5801
int depth() const
Definition: filesystem.hpp:5809
void pop(std::error_code &ec)
Definition: filesystem.hpp:5893
bool operator!=(const recursive_directory_iterator &rhs) const
Definition: filesystem.hpp:5917
const directory_entry & operator*() const
Definition: filesystem.hpp:5819
bool recursion_pending() const
Definition: filesystem.hpp:5814
std::input_iterator_tag iterator_category
Definition: filesystem.hpp:973
Definition: filesystem.hpp:1250
~u8arguments()
Definition: filesystem.hpp:1253
bool valid() const
Definition: filesystem.hpp:1259
u8arguments(int &argc, char **&argv)
Definition: filesystem.hpp:2327
FMT_CONSTEXPR auto find(Ptr first, Ptr last, T value, Ptr &out) -> bool
Definition: core.h:2318
constexpr auto count() -> size_t
Definition: core.h:1204
type
Definition: core.h:575
#define GHC_INLINE
Definition: filesystem.hpp:136
#define GHC_WIN_AUTO_PREFIX_LONG_PATH
Definition: filesystem.hpp:299
#define GHC_PLATFORM_LITERAL(str)
#define GHC_FS_API_CLASS
Definition: filesystem.hpp:141
#define GHC_FS_API
Definition: filesystem.hpp:138
static const symbolic::SymbolExpr< internal::symbolic_last_tag > last
Can be used as a parameter to Eigen::seq and Eigen::seqN functions to symbolically reference the last...
Definition: IndexedViewHelper.h:38
constexpr common_t< T1, T2 > max(const T1 x, const T2 y) noexcept
Compile-time pairwise maximum function.
Definition: max.hpp:35
constexpr common_t< T1, T2 > min(const T1 x, const T2 y) noexcept
Compile-time pairwise minimum function.
Definition: min.hpp:35
EIGEN_CONSTEXPR Index size(const T &x)
Definition: Meta.h:479
EIGEN_CONSTEXPR Index first(const T &x) EIGEN_NOEXCEPT
Definition: IndexedViewHelper.h:81
::uint16_t uint16_t
Definition: Meta.h:54
::uint32_t uint32_t
Definition: Meta.h:56
::uint8_t uint8_t
Definition: Meta.h:52
auto write(OutputIt out, const std::tm &time, const std::locale &loc, char format, char modifier=0) -> OutputIt
Definition: chrono.h:426
result
Definition: format.h:2556
@ error
Definition: format.h:2559
GHC_FS_API bool is_high_surrogate(uint32_t c)
Definition: filesystem.hpp:1430
StringType fromUtf8(const Utf8String &utf8String, const typename StringType::allocator_type &alloc=typename StringType::allocator_type())
Definition: filesystem.hpp:1507
GHC_INLINE void create_hardlink(const path &target_name, const path &new_hardlink, std::error_code &ec)
Definition: filesystem.hpp:1953
GHC_INLINE file_status file_status_from_st_mode(T mode)
Definition: filesystem.hpp:1963
GHC_INLINE const char * strerror_adapter(char *gnu, char *)
Definition: filesystem.hpp:1847
GHC_INLINE int compare_simple_insensitive(const path::value_type *str1, size_t len1, const path::value_type *str2, size_t len2)
Definition: filesystem.hpp:1830
GHC_INLINE file_status symlink_status_ex(const path &p, std::error_code &ec, uintmax_t *sz=nullptr, uintmax_t *nhl=nullptr, time_t *lwt=nullptr) noexcept
Definition: filesystem.hpp:2207
GHC_INLINE bool equals_simple_insensitive(const path::value_type *str1, const path::value_type *str2)
Definition: filesystem.hpp:1809
GHC_FS_API unsigned consumeUtf8Fragment(const unsigned state, const uint8_t fragment, uint32_t &codepoint)
Definition: filesystem.hpp:1472
portable_error
Definition: filesystem.hpp:1284
GHC_INLINE bool is_not_found_error(std::error_code &ec)
Definition: filesystem.hpp:2198
GHC_INLINE std::string systemErrorText(ErrorNumber code=0)
Definition: filesystem.hpp:1861
GHC_FS_API std::error_code make_error_code(portable_error err)
Definition: filesystem.hpp:1305
GHC_INLINE file_status status_ex(const path &p, std::error_code &ec, file_status *sls=nullptr, uintmax_t *sz=nullptr, uintmax_t *nhl=nullptr, time_t *lwt=nullptr, int recurse_count=0) noexcept
Definition: filesystem.hpp:2245
GHC_FS_API void appendUTF8(std::string &str, uint32_t unicode)
Definition: filesystem.hpp:1440
typename std::enable_if< std::is_same< Enum, perms >::value||std::is_same< Enum, perm_options >::value||std::is_same< Enum, copy_options >::value||std::is_same< Enum, directory_options >::value, Enum >::type EnableBitmask
Definition: filesystem.hpp:1364
GHC_INLINE bool endsWith(const strT &what, const strT &with)
Definition: filesystem.hpp:1714
GHC_FS_API bool is_low_surrogate(uint32_t c)
Definition: filesystem.hpp:1435
GHC_INLINE path resolveSymlink(const path &p, std::error_code &ec)
Definition: filesystem.hpp:2063
std::string toUtf8(const strT &unicodeString)
Definition: filesystem.hpp:1596
GHC_FS_API bool is_surrogate(uint32_t c)
Definition: filesystem.hpp:1425
GHC_INLINE bool validUtf8(const std::string &utf8String)
Definition: filesystem.hpp:1484
GHC_INLINE bool in_range(uint32_t c, uint32_t lo, uint32_t hi)
Definition: filesystem.hpp:1420
utf8_states_t
Definition: filesystem.hpp:1278
@ S_STRT
Definition: filesystem.hpp:1278
@ S_RJCT
Definition: filesystem.hpp:1278
GHC_FS_API std::error_code make_system_error(int err=0)
Definition: filesystem.hpp:1355
GHC_INLINE bool startsWith(const strT &what, const strT &with)
Definition: filesystem.hpp:1708
GHC_INLINE void create_symlink(const path &target_name, const path &new_symlink, bool, std::error_code &ec)
Definition: filesystem.hpp:1945
GHC_FS_API file_status status(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4892
GHC_FS_API bool equivalent(const path &p1, const path &p2, std::error_code &ec) noexcept
Definition: filesystem.hpp:4150
constexpr detail::EnableBitmask< Enum > operator&(Enum X, Enum Y)
Definition: filesystem.hpp:1368
GHC_FS_API path proximate(const path &p, std::error_code &ec)
GHC_FS_API file_time_type last_write_time(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4454
GHC_FS_API size_t hash_value(const path &p) noexcept
Definition: filesystem.hpp:3367
GHC_FS_API path current_path(std::error_code &ec)
Definition: filesystem.hpp:4070
perms
Definition: filesystem.hpp:720
GHC_FS_API bool exists(file_status s) noexcept
Definition: filesystem.hpp:4117
GHC_FS_API path read_symlink(const path &p, std::error_code &ec)
Definition: filesystem.hpp:4631
GHC_FS_API path canonical(const path &p, std::error_code &ec)
Definition: filesystem.hpp:3600
GHC_FS_API bool is_socket(file_status s) noexcept
Definition: filesystem.hpp:4408
GHC_FS_API path absolute(const path &p, std::error_code &ec)
Definition: filesystem.hpp:3539
std::basic_ostream< charT, traits > & operator<<(std::basic_ostream< charT, traits > &os, const path &p)
Definition: filesystem.hpp:3421
path u8path(const Source &source)
Definition: filesystem.hpp:1788
constexpr detail::EnableBitmask< Enum > operator^(Enum X, Enum Y)
Definition: filesystem.hpp:1382
GHC_FS_API bool is_symlink(file_status s) noexcept
Definition: filesystem.hpp:4425
directory_options
Definition: filesystem.hpp:776
@ follow_directory_symlink
GHC_FS_API uintmax_t remove_all(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4732
file_type
Definition: filesystem.hpp:706
GHC_FS_API bool is_block_file(file_status s) noexcept
Definition: filesystem.hpp:4272
GHC_FS_API directory_iterator begin(directory_iterator iter) noexcept
Definition: filesystem.hpp:5746
GHC_FS_API bool is_regular_file(file_status s) noexcept
Definition: filesystem.hpp:4391
GHC_FS_API space_info space(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4858
GHC_FS_API directory_iterator end(const directory_iterator &) noexcept
Definition: filesystem.hpp:5751
GHC_FS_API void permissions(const path &p, perms prms, std::error_code &ec) noexcept
Definition: filesystem.hpp:4545
detail::EnableBitmask< Enum > & operator&=(Enum &X, Enum Y)
Definition: filesystem.hpp:1396
std::chrono::time_point< std::chrono::system_clock > file_time_type
Definition: filesystem.hpp:807
GHC_FS_API file_status symlink_status(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4914
constexpr detail::EnableBitmask< Enum > operator~(Enum X)
Definition: filesystem.hpp:1389
basic_fstream< wchar_t > wfstream
Definition: filesystem.hpp:1247
constexpr detail::EnableBitmask< Enum > operator|(Enum X, Enum Y)
Definition: filesystem.hpp:1375
GHC_FS_API path weakly_canonical(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4967
GHC_FS_API bool is_fifo(file_status s) noexcept
Definition: filesystem.hpp:4357
GHC_FS_API bool is_empty(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4335
GHC_FS_API bool operator<=(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3394
GHC_FS_API bool create_directory(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:3948
GHC_FS_API bool operator==(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3379
basic_filebuf< char > filebuf
Definition: filesystem.hpp:1240
GHC_FS_API uintmax_t hard_link_count(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4242
GHC_FS_API void resize_file(const path &p, uintmax_t size, std::error_code &ec) noexcept
Definition: filesystem.hpp:4818
GHC_FS_API void create_hard_link(const path &to, const path &new_hard_link, std::error_code &ec) noexcept
Definition: filesystem.hpp:4036
copy_options
Definition: filesystem.hpp:756
std::basic_istream< charT, traits > & operator>>(std::basic_istream< charT, traits > &is, path &p)
Definition: filesystem.hpp:3436
basic_filebuf< wchar_t > wfilebuf
Definition: filesystem.hpp:1241
GHC_FS_API void copy_symlink(const path &existing_symlink, const path &new_symlink, std::error_code &ec) noexcept
Definition: filesystem.hpp:3872
basic_ifstream< wchar_t > wifstream
Definition: filesystem.hpp:1243
detail::EnableBitmask< Enum > & operator|=(Enum &X, Enum Y)
Definition: filesystem.hpp:1403
GHC_FS_API bool operator>(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3399
GHC_FS_API bool create_directories(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:3898
basic_ofstream< char > ofstream
Definition: filesystem.hpp:1244
GHC_FS_API path operator/(const path &lhs, const path &rhs)
Definition: filesystem.hpp:3409
basic_fstream< char > fstream
Definition: filesystem.hpp:1246
GHC_FS_API bool operator<(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3389
GHC_FS_API path relative(const path &p, std::error_code &ec)
Definition: filesystem.hpp:4642
GHC_FS_API uintmax_t file_size(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4209
GHC_FS_API void swap(path &lhs, path &rhs) noexcept
Definition: filesystem.hpp:3362
GHC_FS_API void copy(const path &from, const path &to, std::error_code &ec) noexcept
Definition: filesystem.hpp:3679
GHC_FS_API bool is_directory(file_status s) noexcept
Definition: filesystem.hpp:4306
perm_options
Definition: filesystem.hpp:748
GHC_FS_API bool is_other(file_status s) noexcept
Definition: filesystem.hpp:4374
GHC_FS_API bool is_character_file(file_status s) noexcept
Definition: filesystem.hpp:4289
basic_ofstream< wchar_t > wofstream
Definition: filesystem.hpp:1245
GHC_FS_API bool operator!=(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3384
GHC_FS_API bool copy_file(const path &from, const path &to, std::error_code &ec) noexcept
Definition: filesystem.hpp:3779
GHC_FS_API path temp_directory_path(std::error_code &ec) noexcept
Definition: filesystem.hpp:4931
basic_ifstream< char > ifstream
Definition: filesystem.hpp:1242
GHC_FS_API bool operator>=(const path &lhs, const path &rhs) noexcept
Definition: filesystem.hpp:3404
detail::EnableBitmask< Enum > & operator^=(Enum &X, Enum Y)
Definition: filesystem.hpp:1410
GHC_FS_API void create_symlink(const path &to, const path &new_symlink, std::error_code &ec) noexcept
Definition: filesystem.hpp:4053
GHC_FS_API bool remove(const path &p, std::error_code &ec) noexcept
Definition: filesystem.hpp:4671
GHC_FS_API void create_directory_symlink(const path &to, const path &new_symlink, std::error_code &ec) noexcept
Definition: filesystem.hpp:4019
GHC_FS_API void rename(const path &from, const path &to, std::error_code &ec) noexcept
Definition: filesystem.hpp:4789
GHC_FS_API bool status_known(file_status s) noexcept
Definition: filesystem.hpp:4897
Definition: filesystem.hpp:313
Definition: StdDeque.h:50
void swap(wpi::SmallVectorImpl< T > &LHS, wpi::SmallVectorImpl< T > &RHS)
Implement std::swap in terms of SmallVector swap.
Definition: SmallVector.h:1299
static constexpr const velocity::meters_per_second_t c(299792458.0)
Speed of light in vacuum.
cubed< length::millimeter > L
Definition: volume.h:49
unit_t< Units, T, NonLinearScale > & operator/=(unit_t< Units, T, NonLinearScale > &lhs, const RhsType &rhs) noexcept
Definition: base.h:2313
unit_t< Units, T, NonLinearScale > & operator+=(unit_t< Units, T, NonLinearScale > &lhs, const RhsType &rhs) noexcept
Definition: base.h:2281
unit_t< Units, T, NonLinearScale > & operator++(unit_t< Units, T, NonLinearScale > &u) noexcept
Definition: base.h:2335
unit_t< Units, T, NonLinearScale > & operator--(unit_t< Units, T, NonLinearScale > &u) noexcept
Definition: base.h:2359
value_type read(const void *memory, endianness endian)
Read a value of a particular endianness from memory.
Definition: Endian.h:65
@ native
Definition: Endian.h:27
const std::error_category & system_category() noexcept
Definition: os.h:210
Definition: filesystem.hpp:393
Definition: filesystem.hpp:698
uintmax_t free
Definition: filesystem.hpp:700
uintmax_t available
Definition: filesystem.hpp:701
uintmax_t capacity
Definition: filesystem.hpp:699
intptr_t ssize_t
Definition: win.h:27
auto format(wformat_string< T... > fmt, T &&... args) -> std::wstring
Definition: xchar.h:87