[ox/fs] Cleanup
This commit is contained in:
		
							
								
								
									
										5
									
								
								deps/ox/src/ox/fs/filesystem/filesystem.cpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5
									
								
								deps/ox/src/ox/fs/filesystem/filesystem.cpp
									
									
									
									
										vendored
									
									
								
							| @@ -6,6 +6,7 @@ | ||||
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||||
|  */ | ||||
|  | ||||
| #include <ox/std/error.hpp> | ||||
| #include <ox/std/utility.hpp> | ||||
|  | ||||
| #include "filesystem.hpp" | ||||
| @@ -36,9 +37,9 @@ Error FileSystem::read(const FileAddress &addr, void *buffer, std::size_t size) | ||||
| 	} | ||||
| } | ||||
|  | ||||
| Result<Vector<char>> FileSystem::read(const FileAddress &addr) noexcept { | ||||
| Result<Buffer> FileSystem::read(const FileAddress &addr) noexcept { | ||||
| 	oxRequire(s, stat(addr)); | ||||
| 	ox::Vector<char> buff(s.size); | ||||
| 	Buffer buff(s.size); | ||||
| 	oxReturnError(read(addr, buff.data(), buff.size())); | ||||
| 	return ox::move(buff); | ||||
| } | ||||
|   | ||||
							
								
								
									
										4
									
								
								deps/ox/src/ox/fs/filesystem/filesystem.hpp
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								deps/ox/src/ox/fs/filesystem/filesystem.hpp
									
									
									
									
										vendored
									
									
								
							| @@ -8,6 +8,8 @@ | ||||
|  | ||||
| #pragma once | ||||
|  | ||||
| #include <ox/std/buffer.hpp> | ||||
|  | ||||
| #include <ox/fs/filestore/filestoretemplate.hpp> | ||||
| #include <ox/fs/filesystem/filelocation.hpp> | ||||
| #include <ox/fs/filesystem/types.hpp> | ||||
| @@ -42,7 +44,7 @@ class FileSystem { | ||||
|  | ||||
| 		Error read(const FileAddress &addr, void *buffer, std::size_t size) noexcept; | ||||
|  | ||||
| 		Result<Vector<char>> read(const FileAddress &addr) noexcept; | ||||
| 		Result<Buffer> read(const FileAddress &addr) noexcept; | ||||
|  | ||||
| 		Error read(const FileAddress &addr, std::size_t readStart, std::size_t readSize, void *buffer, std::size_t *size) noexcept; | ||||
|  | ||||
|   | ||||
| @@ -6,6 +6,8 @@ | ||||
|  * file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||||
|  */ | ||||
|  | ||||
| #include <ox/std/error.hpp> | ||||
|  | ||||
| #include "passthroughfs.hpp" | ||||
|  | ||||
| #if defined(OX_HAS_PASSTHROUGHFS) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user