fs/FileSystem: add noexcept

This commit is contained in:
Max Kellermann 2022-08-18 16:51:20 +02:00
parent 938054bdb8
commit 71acad6c21
2 changed files with 7 additions and 7 deletions

View File

@ -40,7 +40,7 @@ RenameFile(Path oldpath, Path newpath)
} }
AllocatedPath AllocatedPath
ReadLink(Path path) ReadLink(Path path) noexcept
{ {
#ifdef _WIN32 #ifdef _WIN32
(void)path; (void)path;

View File

@ -85,12 +85,12 @@ RemoveFile(Path path);
* Wrapper for readlink() that uses #Path names. * Wrapper for readlink() that uses #Path names.
*/ */
AllocatedPath AllocatedPath
ReadLink(Path path); ReadLink(Path path) noexcept;
#ifndef _WIN32 #ifndef _WIN32
static inline bool static inline bool
MakeFifo(Path path, mode_t mode) MakeFifo(Path path, mode_t mode) noexcept
{ {
return mkfifo(path.c_str(), mode) == 0; return mkfifo(path.c_str(), mode) == 0;
} }
@ -99,7 +99,7 @@ MakeFifo(Path path, mode_t mode)
* Wrapper for access() that uses #Path names. * Wrapper for access() that uses #Path names.
*/ */
static inline bool static inline bool
CheckAccess(Path path, int mode) CheckAccess(Path path, int mode) noexcept
{ {
return access(path.c_str(), mode) == 0; return access(path.c_str(), mode) == 0;
} }
@ -110,7 +110,7 @@ CheckAccess(Path path, int mode)
* Checks if #Path exists and is a regular file. * Checks if #Path exists and is a regular file.
*/ */
static inline bool static inline bool
FileExists(Path path, bool follow_symlinks = true) FileExists(Path path, bool follow_symlinks = true) noexcept
{ {
#ifdef _WIN32 #ifdef _WIN32
(void)follow_symlinks; (void)follow_symlinks;
@ -128,7 +128,7 @@ FileExists(Path path, bool follow_symlinks = true)
* Checks if #Path exists and is a directory. * Checks if #Path exists and is a directory.
*/ */
static inline bool static inline bool
DirectoryExists(Path path, bool follow_symlinks = true) DirectoryExists(Path path, bool follow_symlinks = true) noexcept
{ {
#ifdef _WIN32 #ifdef _WIN32
(void)follow_symlinks; (void)follow_symlinks;
@ -145,7 +145,7 @@ DirectoryExists(Path path, bool follow_symlinks = true)
* Checks if #Path exists. * Checks if #Path exists.
*/ */
static inline bool static inline bool
PathExists(Path path) PathExists(Path path) noexcept
{ {
#ifdef _WIN32 #ifdef _WIN32
return GetFileAttributes(path.c_str()) != INVALID_FILE_ATTRIBUTES; return GetFileAttributes(path.c_str()) != INVALID_FILE_ATTRIBUTES;