Ocular Engine
ResourceLoaderManager.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RESOURCES_RESOURCE_LOADER_MANAGER__H__
19 #define __H__OCULAR_RESOURCES_RESOURCE_LOADER_MANAGER__H__
20 
21 #include "ResourceLoader.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 registerResourceLoader(std::shared_ptr<AResourceLoader> loader);
61 
73  bool loadResource(Resource* &resource, File const& file, std::string const& mappingName);
74 
82  bool loadSubResource(Resource* &resource, File const& file, std::string const& mappingName);
83 
91  bool exploreResource(File const& file);
92 
96  unsigned getNumberOfResourceLoaders() const;
97 
101  bool isExtensionSupported(std::string const& extension) const;
102 
106  ResourceType getResourceType(std::string const& extension) const;
107 
108  protected:
109 
110  private:
111 
112  std::unordered_map<std::string, std::shared_ptr<AResourceLoader>> m_ResourceLoaderMap;
113  };
114  }
118 }
123 //------------------------------------------------------------------------------------------
124 
125 #endif
bool exploreResource(File const &file)
Definition: ResourceLoaderManager.cpp:153
void registerResourceLoader(std::shared_ptr< AResourceLoader > loader)
Definition: ResourceLoaderManager.cpp:44
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
unsigned getNumberOfResourceLoaders() const
Definition: ResourceLoaderManager.cpp:177
bool isExtensionSupported(std::string const &extension) const
Definition: ResourceLoaderManager.cpp:182
Definition: ResourceLoaderManager.hpp:44
bool loadResource(Resource *&resource, File const &file, std::string const &mappingName)
Definition: ResourceLoaderManager.cpp:58
Definition: File.hpp:41
ResourceType getResourceType(std::string const &extension) const
Definition: ResourceLoaderManager.cpp:195
bool loadSubResource(Resource *&resource, File const &file, std::string const &mappingName)
Definition: ResourceLoaderManager.cpp:102
Definition: Resource.hpp:46