DirectZ
Loading...
Searching...
No Matches
dz::FileHandle Struct Reference

Represents a generalized file handle that can reference disk files, embedded assets, or memory streams. More...

#include <FileHandle.hpp>

Public Types

enum  LOCATION { PATH , ASSET , MEMORY }
 Specifies the origin of the file handle. More...

Public Member Functions

std::shared_ptr< std::iostream > open (std::ios_base::openmode ios)
 Opens the file stream using the specified I/O mode.

Public Attributes

LOCATION location
std::string path
std::shared_ptr< std::iostream > cached_mem_stream

Detailed Description

Represents a generalized file handle that can reference disk files, embedded assets, or memory streams.

Member Enumeration Documentation

◆ LOCATION

Specifies the origin of the file handle.

Enumerator
PATH 

Represents a file path on disk.

ASSET 

Represents an embedded asset in a package.

MEMORY 

Represents a stream from memory.

Member Function Documentation

◆ open()

std::shared_ptr< std::iostream > dz::FileHandle::open ( std::ios_base::openmode ios)

Opens the file stream using the specified I/O mode.

Parameters
iosI/O mode flags (e.g., std::ios::in | std::ios::binary).
Returns
A shared pointer to a valid std::iostream instance.

Member Data Documentation

◆ cached_mem_stream

std::shared_ptr<std::iostream> dz::FileHandle::cached_mem_stream

Cached stream for MEMORY mode.

◆ location

LOCATION dz::FileHandle::location

The source type of the file.

◆ path

std::string dz::FileHandle::path

File path or logical name.


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