Ocular Engine
ResourceSaver.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RESOURCES_RESOURCE_SAVER__H__
19 #define __H__OCULAR_RESOURCES_RESOURCE_SAVER__H__
20 
21 #include "Resource.hpp"
22 #include "Common.hpp"
23 
24 #include <string>
25 #include <vector>
26 
27 //------------------------------------------------------------------------------------------
28 
33 namespace Ocular
34 {
39  namespace Core
40  {
50  {
51  public:
52 
53  AResourceSaver(std::string const& extension, ResourceType type);
54  virtual ~AResourceSaver();
55 
56  virtual std::string getSupportedFileType() const;
57 
62  virtual bool saveResource(Resource* resource, File const& file);
63 
67  ResourceType getResourceType() const;
68 
69  protected:
70 
82  virtual bool writeFile(Core::File const& file, std::vector<unsigned char> buffer, Endianness fileEndianness);
83 
84  //------------------------------------------------------------
85 
86  std::string m_SupportedExtension;
87 
88  ResourceType m_Type;
89 
90  private:
91  };
92  }
96 }
101 //------------------------------------------------------------------------------------------
102 
103 #endif
Endianness
Definition: Common.hpp:89
virtual bool saveResource(Resource *resource, File const &file)
Definition: ResourceSaver.cpp:52
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
Definition: File.hpp:41
virtual bool writeFile(Core::File const &file, std::vector< unsigned char > buffer, Endianness fileEndianness)
Definition: ResourceSaver.cpp:66
ResourceType getResourceType() const
Definition: ResourceSaver.cpp:57
Definition: ResourceSaver.hpp:49
Definition: Resource.hpp:46