IceShard 1
A personal game engine project, with development focused on 2D/2.5D games.
Loading...
Searching...
No Matches
ice::native_file Namespace Reference

Typedefs

using TraversePathCallback

Enumerations

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

Functions

bool exists_file (ice::native_file::FilePath path) noexcept
auto open_file (ice::native_file::FilePath path, ice::native_file::FileOpenFlags flags=FileOpenFlags::Read) noexcept -> ice::native_file::File
auto 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 sizeof_file (ice::native_file::File const &native_file) noexcept -> ice::usize
auto sizeof_file (ice::native_file::FilePath path) noexcept -> ice::usize
auto read_file (ice::native_file::File const &native_file, ice::usize requested_read_size, ice::Memory memory) noexcept -> ice::usize
auto 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 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 write_file (ice::native_file::File const &native_file, ice::usize write_offset, ice::Data data) noexcept -> ice::usize
auto 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 append_file (ice::native_file::File const &native_file, ice::Data data) noexcept -> ice::usize
bool traverse_directories (ice::native_file::FilePath starting_dir, ice::native_file::TraversePathCallback callback, void *userdata) noexcept
bool create_directory (ice::native_file::FilePath path) noexcept
bool is_directory (ice::native_file::FilePath path) noexcept
void path_from_string (ice::native_file::HeapFilePath &out_filepath, ice::String path_string) noexcept
void path_to_string (ice::native_file::FilePath path, ice::HeapString<> &out_string) noexcept
void 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 path_from_strings (ice::Allocator &alloc, Strings &&... strings) noexcept -> ice::native_file::HeapFilePath

Variables

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

Detailed Description

Copyright 2023 - 2026, Dandielo dandi.nosp@m.elo@.nosp@m.icesh.nosp@m.ard..nosp@m.net SPDX-License-Identifier: MIT

Typedef Documentation

◆ TraversePathCallback

Initial value:
auto(*)(
ice::native_file::FilePath,
ice::native_file::FilePath,
void* userdata
EntityType
Definition native_file.hxx:119
TraverseAction
Definition native_file.hxx:118

Enumeration Type Documentation

◆ EntityType

Enumerator
File 
Directory 

◆ FileOpenFlags

Enumerator
None 

Same as 'ReadOnly'.

Read 

Opens the file for read operations.

Write 

Opens the file for write operations.

Exclusive 

Opens the file in exclusive mode.

Asynchronous 

Opens the file for asynchronous read-only operations.

◆ FileRequestStatus

Enumerator
Error 
Pending 
Completed 

◆ PathFlags

enum class ice::native_file::PathFlags : ice::u8
strong
Enumerator
None 
Normalized 

◆ TraverseAction

Enumerator
Continue 
Break 
SkipSubDir 

Function Documentation

◆ append_file()

auto ice::native_file::append_file ( ice::native_file::File const & native_file,
ice::Data data ) -> ice::usize
noexcept

◆ create_directory()

bool ice::native_file::create_directory ( ice::native_file::FilePath path)
noexcept

◆ exists_file()

bool ice::native_file::exists_file ( ice::native_file::FilePath path)
noexcept

◆ is_directory()

bool ice::native_file::is_directory ( ice::native_file::FilePath path)
noexcept

◆ open_file() [1/2]

auto ice::native_file::open_file ( ice::native_aio::AIOPort port,
ice::native_file::FilePath path,
ice::native_file::FileOpenFlags flags = FileOpenFlags::Read ) -> ice::Expected< ice::native_file::File >
noexcept

◆ open_file() [2/2]

auto ice::native_file::open_file ( ice::native_file::FilePath path,
ice::native_file::FileOpenFlags flags = FileOpenFlags::Read ) -> ice::native_file::File
noexcept

◆ path_from_string()

void ice::native_file::path_from_string ( ice::native_file::HeapFilePath & out_filepath,
ice::String path_string )
noexcept

◆ path_from_strings()

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 ) -> ice::native_file::HeapFilePath
inlinenoexcept

◆ path_join_string()

void ice::native_file::path_join_string ( ice::native_file::HeapFilePath & path,
ice::String string )
noexcept

◆ path_to_string()

void ice::native_file::path_to_string ( ice::native_file::FilePath path,
ice::HeapString<> & out_string )
noexcept

◆ read_file() [1/2]

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 ) -> ice::usize
noexcept

◆ read_file() [2/2]

auto ice::native_file::read_file ( ice::native_file::File const & native_file,
ice::usize requested_read_size,
ice::Memory memory ) -> ice::usize
noexcept

◆ read_file_request()

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 ) -> ice::native_file::FileRequestStatus
noexcept

◆ sizeof_file() [1/2]

auto ice::native_file::sizeof_file ( ice::native_file::File const & native_file) -> ice::usize
noexcept

◆ sizeof_file() [2/2]

auto ice::native_file::sizeof_file ( ice::native_file::FilePath path) -> ice::usize
noexcept

◆ traverse_directories()

bool ice::native_file::traverse_directories ( ice::native_file::FilePath starting_dir,
ice::native_file::TraversePathCallback callback,
void * userdata )
noexcept

◆ write_file()

auto ice::native_file::write_file ( ice::native_file::File const & native_file,
ice::usize write_offset,
ice::Data data ) -> ice::usize
noexcept

◆ write_file_request()

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 ) -> ice::native_file::FileRequestStatus
noexcept

Variable Documentation

◆ E_FileFailedToBindToAIOPort

ErrorCode ice::native_file::E_FileFailedToBindToAIOPort { "E.8802:FileSystem:File handle failed to bind to provided AIO port." }
staticconstexpr

◆ E_FileFailedToReadRequestedSize

ErrorCode ice::native_file::E_FileFailedToReadRequestedSize { "E.8803:FileSystem:Failed to read requested number of bytes from file." }
staticconstexpr

◆ E_FileHandleInvalid

ErrorCode ice::native_file::E_FileHandleInvalid { "E.8800:FileSystem:File handle is invalid." }
staticconstexpr

◆ E_FilePathProvidedIsInvalid

ErrorCode ice::native_file::E_FilePathProvidedIsInvalid { "E.8801:FileSystem:File path provided is invalid." }
staticconstexpr