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
modelPath
stringThe file path of the model to validate.
throwException
boolDetermines 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 returnsfalse
instead of throwing an exception.
Returns
- bool
true
if 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
throwException
is set totrue
.