Cogs.Foundation
|
#include <MemoryBufferBackedFileContents.h>
Public Member Functions | |
MemoryBufferBackedFileContents (Memory::MemoryBuffer &&buffer, const std::string &path, FileContentsHints hints) | |
Create a file contents object that takes ownership of an existing memorybuffer. | |
MemoryBufferBackedFileContents (size_t size, const std::string &path, FileContentsHints hints) | |
MemoryBufferBackedFileContents (void *data, size_t size, FileContentsHints hints) | |
Memory::MemoryBuffer | take () override |
Take ownership of underlying memorybuffer if exists. | |
StringView | origin () override |
![]() | |
FileContents ()=delete | |
FileContents (const uint8_t *ptr, size_t size, FileContentsHints hints) | |
FileContents (const FileContents &)=delete | |
virtual | ~FileContents ()=default |
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 | |
Memory::MemoryBuffer | bytes |
std::string | path |
![]() | |
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 | |
![]() | |
using | Ptr = std::unique_ptr< FileContents > |
using | Callback = std::function< void(Ptr &&)> |
|
inline |
Create a file contents object that takes ownership of an existing memorybuffer.
|
inline |
References Cogs::Memory::MemoryBuffer::data().
|
inline |
References Cogs::Memory::MemoryBuffer::data(), and Cogs::Memory::MemoryBuffer::write().
|
inlineoverridevirtual |
Implements Cogs::FileContents.
|
inlineoverridevirtual |
Take ownership of underlying memorybuffer if exists.
Implements Cogs::FileContents.
References Cogs::Memory::MemoryBuffer::data().
Memory::MemoryBuffer Cogs::MemoryBufferBackedFileContents::bytes |
std::string Cogs::MemoryBufferBackedFileContents::path |