Fixed fs::file::open

This commit is contained in:
Nekotekina 2017-01-28 13:11:06 +03:00
parent 44b2df27ea
commit 307da1fe39
2 changed files with 15 additions and 15 deletions

View file

@ -156,17 +156,19 @@ namespace fs
file() = default;
// Open file with specified mode
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read)
{
open(path, mode);
}
// Open file with specified mode
bool open(const std::string& path, bs_t<open_mode> mode = ::fs::read);
explicit file(const std::string& path, bs_t<open_mode> mode = ::fs::read);
// Open memory for read
explicit file(const void* ptr, std::size_t size);
// Open file with specified args (forward to constructor)
template <typename... Args>
bool open(Args&&... args)
{
*this = fs::file(std::forward<Args>(args)...);
return m_file.operator bool();
}
// Check whether the handle is valid (opened file)
explicit operator bool() const
{