ReXGlue SDK
Loading...
Searching...
No Matches
rex::filesystem::IContainerImage Class Referenceabstract

#include <rex/filesystem/stfs.h>

Public Member Functions

virtual ContainerType GetType () const =0
virtual const XContentPackageHeader * GetHeader () const =0
virtual const std::filesystem::path & GetPath () const =0
virtual u64 GetTotalSize () const =0
virtual std::span< const ContainerNode > GetNodes () const =0
virtual const ContainerNode & GetRoot () const =0
virtual const ContainerNode * Find (std::string_view path) const =0
virtual std::string GetNodePath (const ContainerNode &node) const =0
virtual Result< size_t > Read (const ContainerNode &node, u64 offset, std::span< u8 > buffer) const =0
virtual std::span< const u8 > View (const ContainerNode &node) const =0
virtual Result< void > Extract (const std::filesystem::path &destination) const =0

Detailed Description

A mapped and parsed container image. Open one with IFileSystemFactory.

Member Function Documentation

◆ Extract()

virtual Result< void > rex::filesystem::IContainerImage::Extract ( const std::filesystem::path & destination) const
nodiscardpure virtual

Writes every node under a host folder, removing the output when a step fails.

Parameters
destinationThe host folder, created when missing.
Returns
kInvalidPath for an unsafe node name, kIO for a host failure.

◆ Find()

virtual const ContainerNode * rex::filesystem::IContainerImage::Find ( std::string_view path) const
nodiscardpure virtual

Returns the node at a path, or null when absent.

Parameters
pathCase insensitive, split on backslash or slash, empty for the root.

◆ GetHeader()

virtual const XContentPackageHeader * rex::filesystem::IContainerImage::GetHeader ( ) const
nodiscardpure virtual
Returns
The header, null for a GDFX image.

◆ GetNodePath()

virtual std::string rex::filesystem::IContainerImage::GetNodePath ( const ContainerNode & node) const
nodiscardpure virtual
Returns
The path with backslashes, empty for the root.

◆ GetNodes()

virtual std::span< const ContainerNode > rex::filesystem::IContainerImage::GetNodes ( ) const
nodiscardpure virtual
Returns
The nodes, with the root first.

◆ GetTotalSize()

virtual u64 rex::filesystem::IContainerImage::GetTotalSize ( ) const
nodiscardpure virtual

Returns the size of all data files together.

◆ Read()

virtual Result< size_t > rex::filesystem::IContainerImage::Read ( const ContainerNode & node,
u64 offset,
std::span< u8 > buffer ) const
nodiscardpure virtual

Copies bytes of a file node.

Parameters
offsetByte offset in the file.
Returns
The bytes copied, or kEndOfFile at or past the end of the file.

◆ View()

virtual std::span< const u8 > rex::filesystem::IContainerImage::View ( const ContainerNode & node) const
nodiscardpure virtual

Returns the bytes of a file node without a copy, empty when the file is not one extent.


The documentation for this class was generated from the following file: