Ocular Engine
Ocular::Core::AResourceSaver Class Reference

#include <ResourceSaver.hpp>

Inheritance diagram for Ocular::Core::AResourceSaver:
Ocular::Graphics::MaterialResourceSaver Ocular::Graphics::MeshResourceSaver Ocular::Graphics::TextureResourceSaver Ocular::Graphics::MeshResourceSaver_PLY Ocular::Graphics::TextureResourceSaver_BMP Ocular::Graphics::TextureResourceSaver_PNG

Public Member Functions

 AResourceSaver (std::string const &extension, ResourceType type)
virtual std::string getSupportedFileType () const
virtual bool saveResource (Resource *resource, File const &file)
ResourceType getResourceType () const

Protected Member Functions

virtual bool writeFile (Core::File const &file, std::vector< unsigned char > buffer, Endianness fileEndianness)

Protected Attributes

std::string m_SupportedExtension
ResourceType m_Type

Detailed Description

Base interface for all resource savers.

A resource saver is responsible for saving a specific type of resource to a specified file.

Member Function Documentation

ResourceType Ocular::Core::AResourceSaver::getResourceType ( ) const

Returns the type of resource handled by this saver.

bool Ocular::Core::AResourceSaver::saveResource ( Resource resource,
File const &  file 
bool Ocular::Core::AResourceSaver::writeFile ( Core::File const &  file,
std::vector< unsigned char >  buffer,
Endianness  fileEndianness 

Writes the full contents of the provided buffer to the specified file in the requisite endianness.

It is assumed that the incoming buffer has native endian ordering.

[in]fileFile to write the buffer to
[in]bufferBuffer container containing the entire file to write.
[in]fileEndiannessThe endianness in which to write the data.
TRUE if successful.

The documentation for this class was generated from the following files: