Commit d11e1d58 authored by Max Kellermann's avatar Max Kellermann

fs/io/FileOutputStream: add "noexcept"

parent b1434777
...@@ -123,7 +123,7 @@ FileOutputStream::Commit() ...@@ -123,7 +123,7 @@ FileOutputStream::Commit()
} }
void void
FileOutputStream::Cancel() FileOutputStream::Cancel() noexcept
{ {
assert(IsDefined()); assert(IsDefined());
...@@ -243,7 +243,7 @@ FileOutputStream::Commit() ...@@ -243,7 +243,7 @@ FileOutputStream::Commit()
} }
void void
FileOutputStream::Cancel() FileOutputStream::Cancel() noexcept
{ {
assert(IsDefined()); assert(IsDefined());
......
...@@ -100,13 +100,13 @@ private: ...@@ -100,13 +100,13 @@ private:
public: public:
explicit FileOutputStream(Path _path, Mode _mode=Mode::CREATE); explicit FileOutputStream(Path _path, Mode _mode=Mode::CREATE);
~FileOutputStream() { ~FileOutputStream() noexcept {
if (IsDefined()) if (IsDefined())
Cancel(); Cancel();
} }
public: public:
Path GetPath() const { Path GetPath() const noexcept {
return path; return path;
} }
...@@ -117,13 +117,13 @@ public: ...@@ -117,13 +117,13 @@ public:
void Write(const void *data, size_t size) override; void Write(const void *data, size_t size) override;
void Commit(); void Commit();
void Cancel(); void Cancel() noexcept;
private: private:
void OpenCreate(bool visible); void OpenCreate(bool visible);
void OpenAppend(bool create); void OpenAppend(bool create);
bool Close() { bool Close() noexcept {
assert(IsDefined()); assert(IsDefined());
#ifdef _WIN32 #ifdef _WIN32
...@@ -136,13 +136,13 @@ private: ...@@ -136,13 +136,13 @@ private:
} }
#ifdef _WIN32 #ifdef _WIN32
bool SeekEOF() { bool SeekEOF() noexcept {
return SetFilePointer(handle, 0, nullptr, return SetFilePointer(handle, 0, nullptr,
FILE_END) != 0xffffffff; FILE_END) != 0xffffffff;
} }
#endif #endif
bool IsDefined() const { bool IsDefined() const noexcept {
#ifdef _WIN32 #ifdef _WIN32
return handle != INVALID_HANDLE_VALUE; return handle != INVALID_HANDLE_VALUE;
#else #else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment