How do I handle when FactoryCreateFile has multiple types but only one Extension

Example: I have two json files ,but their types are different。I have two factory class. but i class return nullptr, the other class will not run.

Factory had a function named FactoryCanImport. condition logic can write in this.In my example i can write Deserialize function and check if it is my type.

1 Like