#include <__config>
#include <filesystem>
#include <vector>
#include "error.h"
#include "path_parser.h"
_LIBCPP_BEGIN_NAMESPACE_FILESYSTEM
ErrorHandler;
createView;
PathParser;
string_view_t;
constexpr path::value_type path::preferred_separator;
path& path::replace_extension(path const& replacement) { … }
string_view_t path::__root_name() const { … }
string_view_t path::__root_directory() const { … }
string_view_t path::__root_path_raw() const { … }
static bool ConsumeRootName(PathParser* PP) { … }
static bool ConsumeRootDir(PathParser* PP) { … }
string_view_t path::__relative_path() const { … }
string_view_t path::__parent_path() const { … }
string_view_t path::__filename() const { … }
string_view_t path::__stem() const { … }
string_view_t path::__extension() const { … }
enum PathPartKind : unsigned char { … };
static PathPartKind ClassifyPathPart(string_view_t Part) { … }
path path::lexically_normal() const { … }
static int DetermineLexicalElementCount(PathParser PP) { … }
path path::lexically_relative(const path& base) const { … }
static int CompareRootName(PathParser* LHS, PathParser* RHS) { … }
static int CompareRootDir(PathParser* LHS, PathParser* RHS) { … }
static int CompareRelative(PathParser* LHSPtr, PathParser* RHSPtr) { … }
static int CompareEndState(PathParser* LHS, PathParser* RHS) { … }
int path::__compare(string_view_t __s) const { … }
size_t hash_value(const path& __p) noexcept { … }
path::iterator path::begin() const { … }
path::iterator path::end() const { … }
path::iterator& path::iterator::__increment() { … }
path::iterator& path::iterator::__decrement() { … }
#if defined(_LIBCPP_WIN32API)
size_t __wide_to_char(const wstring& str, char* out, size_t outlen) {
if (str.empty())
return 0;
ErrorHandler<size_t> err("__wide_to_char", nullptr);
UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
BOOL used_default = FALSE;
int ret = WideCharToMultiByte(codepage, 0, str.data(), str.size(), out, outlen, nullptr, &used_default);
if (ret <= 0 || used_default)
return err.report(errc::illegal_byte_sequence);
return ret;
}
size_t __char_to_wide(const string& str, wchar_t* out, size_t outlen) {
if (str.empty())
return 0;
ErrorHandler<size_t> err("__char_to_wide", nullptr);
UINT codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
int ret = MultiByteToWideChar(codepage, MB_ERR_INVALID_CHARS, str.data(), str.size(), out, outlen);
if (ret <= 0)
return err.report(errc::illegal_byte_sequence);
return ret;
}
#endif
_LIBCPP_END_NAMESPACE_FILESYSTEM