CmSpecificImporter.h 950 B

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "CmPrerequisites.h"
  3. namespace CamelotEngine
  4. {
  5. /**
  6. * @brief Abstract class that is to be specialized in converting
  7. * a certain asset type into an engine usable resource.
  8. * (e.g. a .png file into an engine usable texture).
  9. *
  10. * On initialization this class must register itself with the Importer module,
  11. * which delegates asset import calls to a specific importer.
  12. */
  13. class SpecificImporter
  14. {
  15. public:
  16. SpecificImporter() {}
  17. virtual ~SpecificImporter() {}
  18. virtual bool isExtensionSupported(const String& ext) const = 0;
  19. virtual bool isMagicNumberSupported(const UINT8* magicNumPtr, UINT32 numBytes) const = 0;
  20. /**
  21. * @brief Imports the given file.
  22. *
  23. * @param filePath Pathname of the file, with file extension.
  24. *
  25. * @return null if it fails, otherwise the loaded object.
  26. */
  27. virtual ResourcePtr import(DataStreamPtr fileData) = 0;
  28. };
  29. }