Class AssetImporter

Class Documentation

class legion::core::filesystem::AssetImporter

Static class that allows you to load any object type from a file as long as a converter exists for that combination.

Public Static Functions

template<typename T>
static inline void reportConverter(cstring extension)

Reports a converter type to the importer and allows converting from the given extension to the given object type.

  • extension: File extension to which the converter belongs.

Template Parameters
  • T: Type of the converter.

template<typename T, typename ...Settings>
static inline common::result_decay_more<T, fs_error> tryLoad(const view &view, Settings&&... settings)

Attempt to load an object from a file using the pre-reported converters.


common::result_decay_more<T, fs_error> Result containing either an error or the successfully loaded object.

  • view: filesystem::view to the file to load.

  • settings...: Settings to pass to the load function of the converter.

Template Parameters
  • T: Type of the object to try to load.