[ox/fs] Make some PassThroughFS functions noexcept
This commit is contained in:
		
							
								
								
									
										10
									
								
								deps/ox/src/ox/fs/filesystem/passthroughfs.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								deps/ox/src/ox/fs/filesystem/passthroughfs.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -20,10 +20,10 @@ PassThroughFS::PassThroughFS(const char *dirPath) { | ||||
| 	m_path = dirPath; | ||||
| } | ||||
|  | ||||
| PassThroughFS::~PassThroughFS() { | ||||
| PassThroughFS::~PassThroughFS() noexcept { | ||||
| } | ||||
|  | ||||
| String PassThroughFS::basePath() { | ||||
| String PassThroughFS::basePath() const noexcept { | ||||
| 	return m_path.string().c_str(); | ||||
| } | ||||
|  | ||||
| @@ -41,11 +41,17 @@ Error PassThroughFS::mkdir(const char *path, bool recursive) noexcept { | ||||
| 			success = std::filesystem::create_directories(p, ec); | ||||
| 			oxReturnError(OxError(ec.value(), "PassThroughFS: mkdir failed")); | ||||
| 		} | ||||
| 	} else { | ||||
| 		std::error_code ec; | ||||
| 		const auto isDir = std::filesystem::is_directory(p, ec); | ||||
| 		if (isDir) { | ||||
| 			success = true; | ||||
| 		} else { | ||||
| 			std::error_code ec; | ||||
| 			success = std::filesystem::create_directory(p, ec); | ||||
| 			oxReturnError(OxError(ec.value(), "PassThroughFS: mkdir failed")); | ||||
| 		} | ||||
| 	} | ||||
| 	return OxError(success ? 0 : 1); | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -32,10 +32,10 @@ class PassThroughFS: public FileSystem { | ||||
| 	public: | ||||
| 		explicit PassThroughFS(const char *dirPath); | ||||
|  | ||||
| 		~PassThroughFS() override; | ||||
| 		~PassThroughFS() noexcept override; | ||||
|  | ||||
| 		[[nodiscard]] | ||||
| 		String basePath(); | ||||
| 		String basePath() const noexcept; | ||||
|  | ||||
| 		Error mkdir(const char *path, bool recursive = false) noexcept override; | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user