Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
5ca0b7a2
Commit
5ca0b7a2
authored
Aug 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/io/FileReader: add "noexcept"
parent
21d621e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
FileReader.cxx
src/fs/io/FileReader.cxx
+2
-2
FileReader.hxx
src/fs/io/FileReader.hxx
+6
-6
No files found.
src/fs/io/FileReader.cxx
View file @
5ca0b7a2
...
...
@@ -78,7 +78,7 @@ FileReader::Skip(off_t offset)
}
void
FileReader
::
Close
()
FileReader
::
Close
()
noexcept
{
assert
(
IsDefined
());
...
...
@@ -144,7 +144,7 @@ FileReader::Skip(off_t offset)
}
void
FileReader
::
Close
()
FileReader
::
Close
()
noexcept
{
assert
(
IsDefined
());
...
...
src/fs/io/FileReader.hxx
View file @
5ca0b7a2
...
...
@@ -47,27 +47,27 @@ public:
explicit
FileReader
(
Path
_path
);
#ifdef _WIN32
FileReader
(
FileReader
&&
other
)
FileReader
(
FileReader
&&
other
)
noexcept
:
path
(
std
::
move
(
other
.
path
)),
handle
(
other
.
handle
)
{
other
.
handle
=
INVALID_HANDLE_VALUE
;
}
#else
FileReader
(
FileReader
&&
other
)
FileReader
(
FileReader
&&
other
)
noexcept
:
path
(
std
::
move
(
other
.
path
)),
fd
(
other
.
fd
)
{
other
.
fd
.
SetUndefined
();
}
#endif
~
FileReader
()
{
~
FileReader
()
noexcept
{
if
(
IsDefined
())
Close
();
}
protected
:
bool
IsDefined
()
const
{
bool
IsDefined
()
const
noexcept
{
#ifdef _WIN32
return
handle
!=
INVALID_HANDLE_VALUE
;
#else
...
...
@@ -77,12 +77,12 @@ protected:
public
:
#ifndef _WIN32
FileDescriptor
GetFD
()
const
{
FileDescriptor
GetFD
()
const
noexcept
{
return
fd
;
}
#endif
void
Close
();
void
Close
()
noexcept
;
FileInfo
GetFileInfo
()
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment