UcdParser.parseFile constructor

UcdParser.parseFile(
  1. String filePath,
  2. DataHandler onData, {
  3. CommentHandler? onComment,
  4. PartHandler? onPart,
})

Creates a new UCD Parser from a file with the provided onData callback. Optionally, you can provide callbacks for Comments and Parts.

Implementation

factory UcdParser.parseFile(
  String filePath,
  DataHandler onData, {
  CommentHandler? onComment,
  PartHandler? onPart,
}) {
  return UcdParser(onData, onComment: onComment, onPart: onPart)
    .._ucdStream = File(filePath).openRead().transform(utf8.decoder).transform(const LineSplitter());
}