12 :
FileContents(static_cast<const uint8_t*>(buffer.data()), buffer.size(), hints),
13 bytes(
std::move(buffer)),
18 ptr =
static_cast<const uint8_t*
>(bytes.
data());
22 bytes.
write(data, size);
23 ptr =
static_cast<const uint8_t*
>(bytes.
data());
#define COGSFOUNDATION_API
Definition: FoundationBase.h:31
Definition: MemoryBuffer.h:23
bool write(const void *buffer, size_t noofbytes)
Definition: MemoryBuffer.cpp:210
void * data()
Definition: MemoryBuffer.h:115
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Main Cogs namespace.
Definition: MortonCode.h:5
FileContentsHints
Definition: FileContents.h:11
Abstract base class storing data read from a file.
Definition: FileContents.h:20
Definition: MemoryBufferBackedFileContents.h:6
MemoryBufferBackedFileContents(Memory::MemoryBuffer &&buffer, const std::string &path, FileContentsHints hints)
Create a file contents object that takes ownership of an existing memorybuffer.
Definition: MemoryBufferBackedFileContents.h:11
std::string path
Definition: MemoryBufferBackedFileContents.h:8
StringView origin() override
Definition: MemoryBufferBackedFileContents.h:27
MemoryBufferBackedFileContents(size_t size, const std::string &path, FileContentsHints hints)
Definition: MemoryBufferBackedFileContents.h:17
MemoryBufferBackedFileContents(void *data, size_t size, FileContentsHints hints)
Definition: MemoryBufferBackedFileContents.h:21
Memory::MemoryBuffer bytes
Definition: MemoryBufferBackedFileContents.h:7
Memory::MemoryBuffer take() override
Take ownership of underlying memorybuffer if exists.
Definition: MemoryBufferBackedFileContents.h:26