HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields
tt::FileMapping Struct Reference

#include <TTauri/Foundation/FileMapping.hpp>

Public Member Functions

 FileMapping (std::shared_ptr< File > const &file, size_t size)
 
 FileMapping (URL const &path, AccessMode accessMode, size_t size)
 
 FileMapping (FileMapping const &other)=delete
 
 FileMapping (FileMapping &&other)=delete
 
FileMappingoperator= (FileMapping const &other)=delete
 
FileMappingoperator= (FileMapping &&other)=delete
 
AccessMode accessMode () const noexcept
 
URL const & location () const noexcept
 

Data Fields

std::shared_ptr< Filefile
 
size_t size
 
FileHandle mapHandle
 

Detailed Description

A file mapping. A file mapping maps a region of bytes to a handle. This is mostly for Window which has an extra layer of indirection before mapping the file to actual memory.

See also
FileView on how to map the file into actual memory.

Constructor & Destructor Documentation

◆ FileMapping() [1/2]

tt::FileMapping::FileMapping ( std::shared_ptr< File > const & file,
size_t size )

Map a file. Map a file up to size bytes.

Parameters
filea pointer to an open file.
sizeNumber of bytes from the start to map.

◆ FileMapping() [2/2]

tt::FileMapping::FileMapping ( URL const & path,
AccessMode accessMode,
size_t size )

Map a file. Map a file up to size bytes. This function will automatically open a file and potentially share it with other FileMapping objects.

Parameters
patha URL to a file.
accessModemode of how to access the file.
sizeNumber of bytes from the start to map.

Member Function Documentation

◆ accessMode()

AccessMode tt::FileMapping::accessMode ( ) const
inlinenoexcept

Get access mode of the file object.

◆ location()

URL const & tt::FileMapping::location ( ) const
inlinenoexcept

Get URL of the file object.

Field Documentation

◆ file

std::shared_ptr<File> tt::FileMapping::file

A pointer to an open file.

◆ mapHandle

FileHandle tt::FileMapping::mapHandle

Operating system handle to a file mapping.

◆ size

size_t tt::FileMapping::size

Size of the mapping.


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