Skip to content

ludus::foundation::filesystem::VirtualFile

Ludus Wiki · API overview · Browse API

Class

Move-only logical file retaining its provider and complete mount snapshot through reload/unmount. Concurrent const operations require stable owners and disjoint destination buffers.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

#include <ludus/foundation/filesystem/namespace.hpp>
class ludus::foundation::filesystem::VirtualFile final

Methods

VirtualFile

ludus::foundation::filesystem::VirtualFile::VirtualFile() noexcept=default
Creates an empty file.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

~VirtualFile

ludus::foundation::filesystem::VirtualFile::~VirtualFile() noexcept
Releases the revision best-effort without logging.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

VirtualFile

ludus::foundation::filesystem::VirtualFile::VirtualFile(const VirtualFile &)=delete
Use Clone to retain the same immutable opened revision.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

operator=

VirtualFile & ludus::foundation::filesystem::VirtualFile::operator=(const VirtualFile &)=delete
Use Clone to retain the same immutable opened revision.

Related types: VirtualFile

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

VirtualFile

ludus::foundation::filesystem::VirtualFile::VirtualFile(VirtualFile &&other) noexcept
Transfers ownership, leaving other empty.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

operator=

VirtualFile & ludus::foundation::filesystem::VirtualFile::operator=(VirtualFile &&other) noexcept
Releases the previous file and transfers other; self-move is supported.

Related types: VirtualFile

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

IsOpen

bool ludus::foundation::filesystem::VirtualFile::IsOpen() const noexcept
Returns whether a revision is open.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Size

uint64 ludus::foundation::filesystem::VirtualFile::Size() const noexcept
Returns captured bytes, or zero when closed.

Related types: uint64

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

MountId

uint64 ludus::foundation::filesystem::VirtualFile::MountId() const noexcept
Returns the originating mount ID, or zero when closed.

Related types: uint64

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Generation

uint64 ludus::foundation::filesystem::VirtualFile::Generation() const noexcept
Returns the originating snapshot generation, or zero when closed.

Related types: uint64

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Clone

Result ludus::foundation::filesystem::VirtualFile::Clone(VirtualFile &output) const noexcept
Retains the same file without allocation or pathname lookup; failure preserves output. A closed source returns InvalidArgument. Output may alias this owner.

Related types: VirtualFile · Result

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

ReadAt

ReadResult ludus::foundation::filesystem::VirtualFile::ReadAt(uint64 offset, std::span< uint8 > destination) const noexcept
Reads using ProviderFile's offset/EOF/error contract. A closed file returns InvalidArgument.

Related types: uint64 · uint8 · ReadResult

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp

Close

void ludus::foundation::filesystem::VirtualFile::Close() noexcept
Releases ownership; repeated closes are harmless. Provider destruction is best-effort.

Declared in modules/foundation/filesystem/include/ludus/foundation/filesystem/namespace.hpp