Ocular Engine
ResourceExplorer.hpp
1 
17 #pragma once
18 #ifndef __H__OCULAR_RESOURCES_RESOURCE_EXPLORER__H__
19 #define __H__OCULAR_RESOURCES_RESOURCE_EXPLORER__H__
20 
21 #include "FileIO/Directory.hpp"
22 #include "Resource.hpp"
23 
24 #include <memory>
25 #include <list>
26 #include <unordered_map>
27 
28 //------------------------------------------------------------------------------------------
29 
34 namespace Ocular
35 {
40  namespace Core
41  {
42  class ResourceLoaderManager;
43 
50  {
51  public:
52 
55 
62  void setBlacklist(std::list<std::string> const& blacklist);
63 
68  void setResourceDirectoryName(std::string const& name);
69 
73  std::string const& getResourceDirectoryName() const;
74 
90  void setIsExtensionSensitive(bool sensitive);
91 
95  void populateFileMap(std::unordered_map<std::string, File>& fileMap, ResourceLoaderManager* loader);
96 
100  std::string getRelativePath(File const& file);
101 
102  protected:
103 
107  bool isBlacklisted(std::string const& extension);
108 
114  void findRootDirectories(std::list<Directory>& rootDirectories);
115 
131  std::string getRelativePathFromResourceRoot(Directory root, File file);
132 
133  private:
134 
135  std::unordered_map<std::string, bool> m_Blacklist;
136  std::string m_DirectoryName;
137 
138  bool m_ExtensionSensitive;
139  };
140  }
144 }
149 //------------------------------------------------------------------------------------------
150 
151 #endif
Definition: ResourceExplorer.hpp:49
bool isBlacklisted(std::string const &extension)
Definition: ResourceExplorer.cpp:135
void populateFileMap(std::unordered_map< std::string, File > &fileMap, ResourceLoaderManager *loader)
Definition: ResourceExplorer.cpp:77
std::string getRelativePath(File const &file)
Definition: ResourceExplorer.cpp:126
Note: Once this library is made dynamic, this will no longer be needed.
Definition: Common.hpp:70
std::string getRelativePathFromResourceRoot(Directory root, File file)
Definition: ResourceExplorer.cpp:163
void findRootDirectories(std::list< Directory > &rootDirectories)
Definition: ResourceExplorer.cpp:147
Definition: ResourceLoaderManager.hpp:44
Definition: Directory.hpp:43
void setIsExtensionSensitive(bool sensitive)
Definition: ResourceExplorer.cpp:72
Definition: File.hpp:41
void setResourceDirectoryName(std::string const &name)
Definition: ResourceExplorer.cpp:62
void setBlacklist(std::list< std::string > const &blacklist)
Definition: ResourceExplorer.cpp:49