Method ValidateFormat
ValidateFormat(string, bool)
Validates the specified model file to ensure it adheres to a supported format, including verifying its header and overall structure.
public static bool ValidateFormat(string modelPath, bool throwException = false)
Parameters
modelPathstringThe file path of the model to validate.
throwExceptionboolDetermines whether to throw an exception if the validation fails.
- If set to
true, an InvalidDataException is thrown when the file does not conform to any supported model format. - If set tofalse, the method returnsfalseinstead of throwing an exception.
Returns
- bool
trueif the file is valid and conforms to a supported format; otherwise,false.
Exceptions
- InvalidDataException
Thrown when the file does not conform to the expected format and
throwExceptionis set totrue.