ISimpleResourceLoader.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * ISimpleResourceLoader.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "CInputStream.h"
  12. /**
  13. * A class which knows the files containing in the archive or system and how to load them.
  14. */
  15. class DLL_LINKAGE ISimpleResourceLoader
  16. {
  17. public:
  18. /**
  19. * Dtor.
  20. */
  21. virtual ~ISimpleResourceLoader() { };
  22. /**
  23. * Loads a resource with the given resource name.
  24. *
  25. * @param resourceName The unqiue resource name in space of the archive.
  26. * @return a input stream object
  27. */
  28. virtual std::unique_ptr<CInputStream> load(const std::string & resourceName) const =0;
  29. /**
  30. * Checks if the entry exists.
  31. *
  32. * @return Returns true if the entry exists, false if not.
  33. */
  34. virtual bool existsEntry(const std::string & resourceName) const =0;
  35. /**
  36. * Gets all entries in the archive or (file) system.
  37. *
  38. * @return Returns a list of all entries in the archive or (file) system.
  39. */
  40. virtual std::list<std::string> getEntries() const =0;
  41. };