Skip to content

Commit

Permalink
feat!: Align path_view::render_* APIs with P1036R6
Browse files Browse the repository at this point in the history
  • Loading branch information
BurningEnlightenment committed Aug 27, 2024
1 parent e7b0ca8 commit bc090c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
6 changes: 3 additions & 3 deletions example/path_view_openat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace path_view_openat_example
if(base != nullptr || is_ntpath)
{
// The NT kernel always takes the system wide encoding
auto zpath = path.render_unterminated<wchar_t>(path);
auto zpath = path.render_unterminated<wchar_t>();
UNICODE_STRING _path{};
_path.Buffer = const_cast<wchar_t *>(zpath.data());
_path.MaximumLength =
Expand Down Expand Up @@ -109,14 +109,14 @@ namespace path_view_openat_example
if constexpr(is_same_v<type, char>)
{
// Render to the system narrow encoding null terminated
auto zpath = path.render_null_terminated<char>(path);
auto zpath = path.render_null_terminated<char>();
return CreateFileA(zpath.c_str(), access, share, nullptr, creation,
flags, nullptr);
}
else // char8_t, char16_t, wchar_t
{
// Render to the system wide encoding null terminated
auto zpath = path.render_null_terminated<wchar_t>(path);
auto zpath = path.render_null_terminated<wchar_t>();
return CreateFileW(zpath.c_str(), access, share, nullptr, creation,
flags, nullptr);
}
Expand Down
6 changes: 3 additions & 3 deletions include/llfio/revision.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Note the second line of this file must ALWAYS be the git SHA, third line ALWAYS the git SHA update time
#define LLFIO_PREVIOUS_COMMIT_REF dc08ec4b231900c4236a0a6a493b6a30d91ae81a
#define LLFIO_PREVIOUS_COMMIT_DATE "2024-08-22 13:23:33 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE dc08ec4b
#define LLFIO_PREVIOUS_COMMIT_REF e7b0ca825515759b49176417c4ae1aa0d5b8a890
#define LLFIO_PREVIOUS_COMMIT_DATE "2024-08-27 11:12:38 +00:00"
#define LLFIO_PREVIOUS_COMMIT_UNIQUE e7b0ca82
10 changes: 4 additions & 6 deletions include/llfio/v2.0/path_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,21 +1568,19 @@ class LLFIO_DECL path_view_component
LLFIO_TREQUIRES(LLFIO_TPRED(is_source_acceptable<T>),
LLFIO_TEXPR(std::is_constructible<rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>,
path_view_component, Args...>::value))
rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size> render_null_terminated(path_view_component view,
Args &&...args) const
rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size> render_null_terminated(Args &&...args) const
{
return rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>(view, std::forward<Args>(args)...);
return rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>(*this, std::forward<Args>(args)...);
}
//! Convenience function
LLFIO_TEMPLATE(class T = typename filesystem::path::value_type, class AllocatorOrDeleter = default_rendered_path_deleter<T[]>,
size_t _internal_buffer_size = default_internal_buffer_size, class... Args)
LLFIO_TREQUIRES(LLFIO_TPRED(is_source_acceptable<T>),
LLFIO_TEXPR(std::is_constructible<rendered_path<zero_termination::zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>,
path_view_component, Args...>::value))
rendered_path<zero_termination::not_zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size> render_unterminated(path_view_component view,
Args &&...args) const
rendered_path<zero_termination::not_zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size> render_unterminated(Args &&...args) const
{
return rendered_path<zero_termination::not_zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>(view, std::forward<Args>(args)...);
return rendered_path<zero_termination::not_zero_terminated, T, AllocatorOrDeleter, _internal_buffer_size>(*this, std::forward<Args>(args)...);
}

#ifdef __cpp_concepts
Expand Down

0 comments on commit bc090c4

Please sign in to comment.