Cogs.Foundation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Cogs::MMapBackedFileContents Struct Reference

#include <MMapBackedFileContents.h>

Inheritance diagram for Cogs::MMapBackedFileContents:
Cogs::FileContents

Public Member Functions

 MMapBackedFileContents (const uint8_t *ptr, size_t size, const FileHandle::Ptr &file, const std::string &path, FileContentsHints hints)
 
 ~MMapBackedFileContents () override=default
 
Memory::MemoryBuffer take () override
 Take ownership of underlying memorybuffer if exists.
 
StringView origin () override
 
- Public Member Functions inherited from Cogs::FileContents
 FileContents ()=delete
 
 FileContents (const uint8_t *ptr, size_t size, FileContentsHints hints)
 
 FileContents (const FileContents &)=delete
 
virtual ~FileContents ()=default
 
FileContentsoperator= (const FileContents &)=delete
 
Memory::MemoryBuffer takeCopy ()
 
constexpr const void * data () const
 Access to buffer data. Cast to actual type using static_cast<const MyType*>(..)
 
virtual Memory::MemoryBuffer take ()=0
 Take ownership of underlying memorybuffer if exists.
 
virtual StringView origin ()=0
 

Public Attributes

FileHandle::Ptr file
 
std::string path
 
- Public Attributes inherited from Cogs::FileContents
const uint8_t * ptr
 Start of buffer storing file data. Use.
 
size_t size
 Number of data bytes.
 
size_t mimeTypeHash = 0
 
FileContentsHints hints = FileContentsHints::None
 

Additional Inherited Members

- Public Types inherited from Cogs::FileContents
using Ptr = std::unique_ptr< FileContents >
 
using Callback = std::function< void(Ptr &&)>
 

Constructor & Destructor Documentation

◆ MMapBackedFileContents()

Cogs::MMapBackedFileContents::MMapBackedFileContents ( const uint8_t *  ptr,
size_t  size,
const FileHandle::Ptr file,
const std::string &  path,
FileContentsHints  hints 
)
inline

◆ ~MMapBackedFileContents()

Cogs::MMapBackedFileContents::~MMapBackedFileContents ( )
overridedefault

Member Function Documentation

◆ origin()

StringView Cogs::MMapBackedFileContents::origin ( )
inlineoverridevirtual

Implements Cogs::FileContents.

References path.

◆ take()

Memory::MemoryBuffer Cogs::MMapBackedFileContents::take ( )
inlineoverridevirtual

Take ownership of underlying memorybuffer if exists.

Implements Cogs::FileContents.

References Cogs::FileContents::takeCopy().

Member Data Documentation

◆ file

FileHandle::Ptr Cogs::MMapBackedFileContents::file

◆ path

std::string Cogs::MMapBackedFileContents::path

Referenced by origin().


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