generate method
Write the generated code described in root
to sink
using the options
.
Implementation
@override
void generate(
StringSink sink, PigeonOptions options, Root root, FileType fileType) {
final CppOptions cppOptions = options.cppOptions ?? const CppOptions();
final CppOptions cppOptionsWithHeader = cppOptions.merge(CppOptions(
copyrightHeader: options.copyrightHeader != null
? _lineReader(
path.posix.join(options.basePath ?? '', options.copyrightHeader))
: null,
));
final OutputFileOptions<CppOptions> outputFileOptions =
OutputFileOptions<CppOptions>(
fileType: fileType, languageOptions: cppOptionsWithHeader);
const CppGenerator generator = CppGenerator();
generator.generate(
outputFileOptions,
root,
sink,
dartPackageName: options.getPackageName(),
);
}