generate method

  1. @override
void generate(
  1. OutputFileOptions<GObjectOptions> generatorOptions,
  2. Root root,
  3. StringSink sink, {
  4. required String dartPackageName,
})
override

Generates GObject file of type specified in generatorOptions

Implementation

@override
void generate(
  OutputFileOptions<GObjectOptions> generatorOptions,
  Root root,
  StringSink sink, {
  required String dartPackageName,
}) {
  assert(generatorOptions.fileType == FileType.header ||
      generatorOptions.fileType == FileType.source);
  if (generatorOptions.fileType == FileType.header) {
    const GObjectHeaderGenerator().generate(
      generatorOptions.languageOptions,
      root,
      sink,
      dartPackageName: dartPackageName,
    );
  } else if (generatorOptions.fileType == FileType.source) {
    const GObjectSourceGenerator().generate(
      generatorOptions.languageOptions,
      root,
      sink,
      dartPackageName: dartPackageName,
    );
  }
}