Ocular Engine
ResourceSaverManager.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RESOURCES_RESOURCE_SAVER_MANAGER__H__
19 #define __H__OCULAR_RESOURCES_RESOURCE_SAVER_MANAGER__H__
20 
21 #include "ResourceSaver.hpp"
22 
23 #include <memory>
24 #include <string>
25 #include <unordered_map>
26 
27 //------------------------------------------------------------------------------------------
28 
33 namespace Ocular
34 {
39  namespace Core
40  {
45  {
46  public:
47 
50 
60  void registerResourceSaver(std::shared_ptr<AResourceSaver> saver);
61 
68  bool saveResource(Resource* resource, File const& file);
69 
73  unsigned getNumberOfResourceSavers() const;
74 
78  bool isExtensionSupported(std::string const& extension) const;
79 
80  protected:
81 
82  private:
83 
84  std::unordered_map<std::string, std::shared_ptr<AResourceSaver>> m_ResourceSaverMap;
85  };
86  }
90 }
95 //------------------------------------------------------------------------------------------
96 
97 #endif
void registerResourceSaver(std::shared_ptr< AResourceSaver > saver)
Definition: ResourceSaverManager.cpp:44
Definition: ResourceSaverManager.hpp:44
bool saveResource(Resource *resource, File const &file)
Definition: ResourceSaverManager.cpp:58
unsigned getNumberOfResourceSavers() const
Definition: ResourceSaverManager.cpp:87
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
bool isExtensionSupported(std::string const &extension) const
Definition: ResourceSaverManager.cpp:92
Definition: File.hpp:41
Definition: Resource.hpp:46