fs/io/FileReader: add "noexcept"
This commit is contained in:
parent
21d621e7ad
commit
5ca0b7a28f
@ -78,7 +78,7 @@ FileReader::Skip(off_t offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FileReader::Close()
|
FileReader::Close() noexcept
|
||||||
{
|
{
|
||||||
assert(IsDefined());
|
assert(IsDefined());
|
||||||
|
|
||||||
@ -144,7 +144,7 @@ FileReader::Skip(off_t offset)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FileReader::Close()
|
FileReader::Close() noexcept
|
||||||
{
|
{
|
||||||
assert(IsDefined());
|
assert(IsDefined());
|
||||||
|
|
||||||
|
@ -47,27 +47,27 @@ public:
|
|||||||
explicit FileReader(Path _path);
|
explicit FileReader(Path _path);
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
FileReader(FileReader &&other)
|
FileReader(FileReader &&other) noexcept
|
||||||
:path(std::move(other.path)),
|
:path(std::move(other.path)),
|
||||||
handle(other.handle) {
|
handle(other.handle) {
|
||||||
other.handle = INVALID_HANDLE_VALUE;
|
other.handle = INVALID_HANDLE_VALUE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
FileReader(FileReader &&other)
|
FileReader(FileReader &&other) noexcept
|
||||||
:path(std::move(other.path)),
|
:path(std::move(other.path)),
|
||||||
fd(other.fd) {
|
fd(other.fd) {
|
||||||
other.fd.SetUndefined();
|
other.fd.SetUndefined();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
~FileReader() {
|
~FileReader() noexcept {
|
||||||
if (IsDefined())
|
if (IsDefined())
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool IsDefined() const {
|
bool IsDefined() const noexcept {
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
return handle != INVALID_HANDLE_VALUE;
|
return handle != INVALID_HANDLE_VALUE;
|
||||||
#else
|
#else
|
||||||
@ -77,12 +77,12 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
FileDescriptor GetFD() const {
|
FileDescriptor GetFD() const noexcept {
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void Close();
|
void Close() noexcept;
|
||||||
|
|
||||||
FileInfo GetFileInfo() const;
|
FileInfo GetFileInfo() const;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user