|
Cogs.Core
|
Abstract base class storing data read from a file. More...
#include <FileContents.h>
Public Types | |
| using | Ptr = std::unique_ptr< FileContents > |
| using | Callback = std::function< void(Ptr &&)> |
Public Member Functions | |
| FileContents (const uint8_t *ptr, size_t size, FileContentsHints hints) | |
| FileContents (const FileContents &)=delete | |
| FileContents & | operator= (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 | |
| 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 |
Abstract base class storing data read from a file.
Definition at line 20 of file FileContents.h.
| using Cogs::FileContents::Callback = std::function<void(Ptr&&)> |
Definition at line 24 of file FileContents.h.
| using Cogs::FileContents::Ptr = std::unique_ptr<FileContents> |
Definition at line 23 of file FileContents.h.
|
inline |
Definition at line 35 of file FileContents.h.
|
inlineconstexpr |
Access to buffer data. Cast to actual type using static_cast<const MyType*>(..)
Definition at line 45 of file FileContents.h.
|
pure virtual |
Take ownership of underlying memorybuffer if exists.
Implemented in Cogs::Platform::ResourceBufferBackedFileContents, Cogs::MemoryBufferBackedFileContents, and Cogs::MMapBackedFileContents.
| Cogs::Memory::MemoryBuffer Cogs::FileContents::takeCopy | ( | ) |
Definition at line 3 of file FileContents.cpp.
| FileContentsHints Cogs::FileContents::hints = FileContentsHints::None |
Definition at line 31 of file FileContents.h.
| size_t Cogs::FileContents::mimeTypeHash = 0 |
Definition at line 30 of file FileContents.h.
| const uint8_t* Cogs::FileContents::ptr |
Start of buffer storing file data. Use.
Definition at line 27 of file FileContents.h.
| size_t Cogs::FileContents::size |
Number of data bytes.
Definition at line 29 of file FileContents.h.