IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
native_file.hxx File Reference
#include <ice/os.hxx>
#include <ice/path_utils.hxx>
#include <ice/native_aio.hxx>
#include <ice/expected.hxx>

Go to the source code of this file.

Namespaces

namespace  ice
 SPDX-License-Identifier: MIT.
namespace  ice::native_file

Typedefs

using ice::native_file::TraversePathCallback

Enumerations

enum class  ice::native_file::PathFlags : ice::u8 { ice::native_file::None = 0x00 , ice::native_file::Normalized = 0x01 }
enum class  ice::native_file::FileOpenFlags : ice::u8 {
  ice::native_file::None = 0b0000'0000 , ice::native_file::Read = 0b0000'0000 , ice::native_file::Write = 0b0000'0001 , ice::native_file::Exclusive = 0b0001'0000 ,
  ice::native_file::Asynchronous = 0b0010'0000
}
enum class  ice::native_file::FileRequestStatus : ice::u8 { ice::native_file::Error , ice::native_file::Pending , ice::native_file::Completed }
enum class  ice::native_file::TraverseAction : ice::u8 { ice::native_file::Continue , ice::native_file::Break , ice::native_file::SkipSubDir }
enum class  ice::native_file::EntityType : ice::u8 { ice::native_file::File , ice::native_file::Directory }

Functions

bool ice::native_file::exists_file (ice::native_file::FilePath path) noexcept
auto ice::native_file::open_file (ice::native_file::FilePath path, ice::native_file::FileOpenFlags flags=FileOpenFlags::Read) noexcept -> ice::native_file::File
auto ice::native_file::open_file (ice::native_aio::AIOPort port, ice::native_file::FilePath path, ice::native_file::FileOpenFlags flags=FileOpenFlags::Read) noexcept -> ice::Expected< ice::native_file::File >
auto ice::native_file::sizeof_file (ice::native_file::File const &native_file) noexcept -> ice::usize
auto ice::native_file::sizeof_file (ice::native_file::FilePath path) noexcept -> ice::usize
auto ice::native_file::read_file (ice::native_file::File const &native_file, ice::usize requested_read_size, ice::Memory memory) noexcept -> ice::usize
auto ice::native_file::read_file (ice::native_file::File const &native_file, ice::usize requested_read_offset, ice::usize requested_read_size, ice::Memory memory) noexcept -> ice::usize
auto ice::native_file::read_file_request (ice::native_aio::AIORequest &request, ice::native_file::File const &native_file, ice::usize requested_read_offset, ice::usize requested_read_size, ice::Memory memory) noexcept -> ice::native_file::FileRequestStatus
auto ice::native_file::write_file (ice::native_file::File const &native_file, ice::usize write_offset, ice::Data data) noexcept -> ice::usize
auto ice::native_file::write_file_request (ice::native_aio::AIORequest &request, ice::native_file::File const &native_file, ice::usize write_offset, ice::Data data) noexcept -> ice::native_file::FileRequestStatus
auto ice::native_file::append_file (ice::native_file::File const &native_file, ice::Data data) noexcept -> ice::usize
bool ice::native_file::traverse_directories (ice::native_file::FilePath starting_dir, ice::native_file::TraversePathCallback callback, void *userdata) noexcept
bool ice::native_file::create_directory (ice::native_file::FilePath path) noexcept
bool ice::native_file::is_directory (ice::native_file::FilePath path) noexcept
void ice::native_file::path_from_string (ice::native_file::HeapFilePath &out_filepath, ice::String path_string) noexcept
void ice::native_file::path_to_string (ice::native_file::FilePath path, ice::HeapString<> &out_string) noexcept
void ice::native_file::path_join_string (ice::native_file::HeapFilePath &path, ice::String string) noexcept
template<PathFlags Flags = PathFlags::None, typename... Strings>
requires (std::convertible_to<Strings, ice::String> && ...)
auto ice::native_file::path_from_strings (ice::Allocator &alloc, Strings &&... strings) noexcept -> ice::native_file::HeapFilePath

Variables

static constexpr ErrorCode ice::native_file::E_FileHandleInvalid { "E.8800:FileSystem:File handle is invalid." }
static constexpr ErrorCode ice::native_file::E_FilePathProvidedIsInvalid { "E.8801:FileSystem:File path provided is invalid." }
static constexpr ErrorCode ice::native_file::E_FileFailedToBindToAIOPort { "E.8802:FileSystem:File handle failed to bind to provided AIO port." }
static constexpr ErrorCode ice::native_file::E_FileFailedToReadRequestedSize { "E.8803:FileSystem:Failed to read requested number of bytes from file." }