Skip to content

Commit

Permalink
Rename open_filebuf to open_filebuf_from_unicode_path
Browse files Browse the repository at this point in the history
  • Loading branch information
rikyoz committed Sep 17, 2023
1 parent 30fe676 commit c0dcd0b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ inline int permission_flags(std::ios::openmode mode) {
}

template< class charT, class traits = std::char_traits< charT>>
__gnu_cxx::stdio_filebuf<charT, traits> open_filebuf(const path& file_path, std::ios::openmode mode) {
__gnu_cxx::stdio_filebuf<charT, traits> open_filebuf_from_unicode_path(const path& file_path, std::ios::openmode mode) {
// Opening a file handle/descriptor from the native (wide) string path.
int file_handle = 0;
_wsopen_s(&file_handle, GHC_NATIVEWP(file_path), open_flags(mode), _SH_DENYNO, permission_flags(mode));
Expand Down Expand Up @@ -1236,7 +1236,7 @@ class basic_filebuf : public std::basic_filebuf<charT, traits>
if (this->is_open()) {
return nullptr;
}
auto filebuf = detail::open_filebuf<charT, traits>(p, mode);
auto filebuf = detail::open_filebuf_from_unicode_path<charT, traits>(p, mode);
if (!filebuf.is_open()) {
return nullptr;
}
Expand Down Expand Up @@ -1266,7 +1266,7 @@ class basic_ifstream : public std::basic_ifstream<charT, traits>
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in)
{
*this->rdbuf() = detail::open_filebuf<charT, traits>(p, mode | std::ios_base::in);
*this->rdbuf() = detail::open_filebuf_from_unicode_path<charT, traits>(p, mode | std::ios_base::in);
if (!this->is_open()) {
this->setstate(std::ios_base::failbit);
} else {
Expand Down Expand Up @@ -1303,7 +1303,7 @@ class basic_ofstream : public std::basic_ofstream<charT, traits>
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::out)
{
*this->rdbuf() = detail::open_filebuf<charT, traits>(p, mode | std::ios_base::out);
*this->rdbuf() = detail::open_filebuf_from_unicode_path<charT, traits>(p, mode | std::ios_base::out);
if (!this->is_open()) {
this->setstate(std::ios_base::failbit);
} else {
Expand Down Expand Up @@ -1340,7 +1340,7 @@ class basic_fstream : public std::basic_fstream<charT, traits>
}
void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out)
{
*this->rdbuf() = detail::open_filebuf<charT, traits>(p, mode | std::ios_base::in | std::ios_base::out);
*this->rdbuf() = detail::open_filebuf_from_unicode_path<charT, traits>(p, mode | std::ios_base::in | std::ios_base::out);
if (!this->is_open()) {
this->setstate(std::ios_base::failbit);
} else {
Expand Down

0 comments on commit c0dcd0b

Please sign in to comment.