Config constructor
Config({
- Uri? filename,
- PackageConfig? packageConfig,
- Uri? libclangDylib,
- required Uri output,
- Uri? outputObjC,
- SymbolFile? symbolFile,
- Language language = Language.c,
- required List<
Uri> entryPoints, - bool shouldIncludeHeaderFunc(
- Uri header
- List<
String> ? compilerOpts, - Map<
String, List< varArgFunctions = const <String, List<VarArgFunction>>{},VarArgFunction> > - DeclarationFilters? functionDecl,
- DeclarationFilters? structDecl,
- DeclarationFilters? unionDecl,
- DeclarationFilters? enumClassDecl,
- DeclarationFilters? unnamedEnumConstants,
- DeclarationFilters? globals,
- DeclarationFilters? macroDecl,
- DeclarationFilters? typedefs,
- DeclarationFilters? objcInterfaces,
- DeclarationFilters? objcProtocols,
- DeclarationFilters? objcCategories,
- bool includeUnusedTypedefs = false,
- bool includeTransitiveObjCInterfaces = false,
- bool includeTransitiveObjCProtocols = false,
- bool includeTransitiveObjCCategories = true,
- bool generateForPackageObjectiveC = false,
- bool sort = false,
- bool useSupportedTypedefs = true,
- List<
LibraryImport> libraryImports = const <LibraryImport>[], - Map<
String, ImportedType> usrTypeMappings = const <String, ImportedType>{}, - List<
ImportedType> typedefTypeMappings = const <ImportedType>[], - List<
ImportedType> structTypeMappings = const <ImportedType>[], - List<
ImportedType> unionTypeMappings = const <ImportedType>[], - List<
ImportedType> nativeTypeMappings = const <ImportedType>[], - CommentType? commentType,
- CompoundDependencies structDependencies = CompoundDependencies.full,
- CompoundDependencies unionDependencies = CompoundDependencies.full,
- PackingValue? structPackingOverrideFunc(
- Declaration declaration
- String? interfaceModuleFunc(
- Declaration declaration
- String? protocolModuleFunc(
- Declaration declaration
- String wrapperName = 'NativeLibrary',
- String? wrapperDocComment,
- String? preamble,
- bool useDartHandle = true,
- bool silenceEnumWarning = false,
- bool shouldExposeFunctionTypedefFunc(
- Declaration declaration
- bool isLeafFunctionFunc(
- Declaration declaration
- bool enumShouldBeIntFunc(
- Declaration declaration
- bool unnamedEnumsShouldBeIntFunc(
- Declaration declaration
- FfiNativeConfig ffiNativeConfig = const FfiNativeConfig(enabled: false),
- bool ignoreSourceErrors = false,
- bool formatOutput = true,
- ExternalVersions externalVersions = const ExternalVersions(),
Implementation
factory Config({
Uri? filename,
PackageConfig? packageConfig,
Uri? libclangDylib,
required Uri output,
Uri? outputObjC,
SymbolFile? symbolFile,
Language language = Language.c,
required List<Uri> entryPoints,
bool Function(Uri header)? shouldIncludeHeaderFunc,
List<String>? compilerOpts,
Map<String, List<VarArgFunction>> varArgFunctions =
const <String, List<VarArgFunction>>{},
DeclarationFilters? functionDecl,
DeclarationFilters? structDecl,
DeclarationFilters? unionDecl,
DeclarationFilters? enumClassDecl,
DeclarationFilters? unnamedEnumConstants,
DeclarationFilters? globals,
DeclarationFilters? macroDecl,
DeclarationFilters? typedefs,
DeclarationFilters? objcInterfaces,
DeclarationFilters? objcProtocols,
DeclarationFilters? objcCategories,
bool includeUnusedTypedefs = false,
bool includeTransitiveObjCInterfaces = false,
bool includeTransitiveObjCProtocols = false,
bool includeTransitiveObjCCategories = true,
bool generateForPackageObjectiveC = false,
bool sort = false,
bool useSupportedTypedefs = true,
List<LibraryImport> libraryImports = const <LibraryImport>[],
Map<String, ImportedType> usrTypeMappings = const <String, ImportedType>{},
List<ImportedType> typedefTypeMappings = const <ImportedType>[],
List<ImportedType> structTypeMappings = const <ImportedType>[],
List<ImportedType> unionTypeMappings = const <ImportedType>[],
List<ImportedType> nativeTypeMappings = const <ImportedType>[],
CommentType? commentType,
CompoundDependencies structDependencies = CompoundDependencies.full,
CompoundDependencies unionDependencies = CompoundDependencies.full,
PackingValue? Function(Declaration declaration)? structPackingOverrideFunc,
String? Function(Declaration declaration)? interfaceModuleFunc,
String? Function(Declaration declaration)? protocolModuleFunc,
String wrapperName = 'NativeLibrary',
String? wrapperDocComment,
String? preamble,
bool useDartHandle = true,
bool silenceEnumWarning = false,
bool Function(Declaration declaration)? shouldExposeFunctionTypedefFunc,
bool Function(Declaration declaration)? isLeafFunctionFunc,
bool Function(Declaration declaration)? enumShouldBeIntFunc,
bool Function(Declaration declaration)? unnamedEnumsShouldBeIntFunc,
FfiNativeConfig ffiNativeConfig = const FfiNativeConfig(enabled: false),
bool ignoreSourceErrors = false,
bool formatOutput = true,
ExternalVersions externalVersions = const ExternalVersions(),
}) =>
ConfigImpl(
filename: filename == null ? null : Uri.file(filename.toFilePath()),
packageConfig: packageConfig,
libclangDylib: Uri.file(
libclangDylib?.toFilePath() ?? findDylibAtDefaultLocations()),
output: Uri.file(output.toFilePath()),
outputObjC:
Uri.file(outputObjC?.toFilePath() ?? '${output.toFilePath()}.m'),
symbolFile: symbolFile,
language: language,
entryPoints: entryPoints,
shouldIncludeHeaderFunc: shouldIncludeHeaderFunc ?? (_) => true,
compilerOpts: compilerOpts ?? defaultCompilerOpts(),
varArgFunctions: varArgFunctions,
functionDecl: functionDecl ?? DeclarationFilters.excludeAll,
structDecl: structDecl ?? DeclarationFilters.excludeAll,
unionDecl: unionDecl ?? DeclarationFilters.excludeAll,
enumClassDecl: enumClassDecl ?? DeclarationFilters.excludeAll,
unnamedEnumConstants:
unnamedEnumConstants ?? DeclarationFilters.excludeAll,
globals: globals ?? DeclarationFilters.excludeAll,
macroDecl: macroDecl ?? DeclarationFilters.excludeAll,
typedefs: typedefs ?? DeclarationFilters.excludeAll,
objcInterfaces: objcInterfaces ?? DeclarationFilters.excludeAll,
objcProtocols: objcProtocols ?? DeclarationFilters.excludeAll,
objcCategories: objcCategories ?? DeclarationFilters.excludeAll,
includeUnusedTypedefs: includeUnusedTypedefs,
includeTransitiveObjCInterfaces: includeTransitiveObjCInterfaces,
includeTransitiveObjCProtocols: includeTransitiveObjCProtocols,
includeTransitiveObjCCategories: includeTransitiveObjCCategories,
generateForPackageObjectiveC: generateForPackageObjectiveC,
sort: sort,
useSupportedTypedefs: useSupportedTypedefs,
libraryImports: Map<String, LibraryImport>.fromEntries(
libraryImports.map((import) =>
MapEntry<String, LibraryImport>(import.name, import))),
usrTypeMappings: usrTypeMappings,
typedefTypeMappings: Map<String, ImportedType>.fromEntries(
typedefTypeMappings.map((import) =>
MapEntry<String, ImportedType>(import.nativeType, import))),
structTypeMappings: Map<String, ImportedType>.fromEntries(
structTypeMappings.map((import) =>
MapEntry<String, ImportedType>(import.nativeType, import))),
unionTypeMappings: Map<String, ImportedType>.fromEntries(
unionTypeMappings.map((import) =>
MapEntry<String, ImportedType>(import.nativeType, import))),
nativeTypeMappings: Map<String, ImportedType>.fromEntries(
nativeTypeMappings.map((import) =>
MapEntry<String, ImportedType>(import.nativeType, import))),
commentType: commentType ?? CommentType.def(),
structDependencies: structDependencies,
unionDependencies: unionDependencies,
structPackingOverrideFunc: structPackingOverrideFunc ?? (_) => null,
interfaceModuleFunc: interfaceModuleFunc ?? (_) => null,
protocolModuleFunc: protocolModuleFunc ?? (_) => null,
wrapperName: wrapperName,
wrapperDocComment: wrapperDocComment,
preamble: preamble,
useDartHandle: useDartHandle,
silenceEnumWarning: silenceEnumWarning,
shouldExposeFunctionTypedefFunc:
shouldExposeFunctionTypedefFunc ?? (_) => false,
isLeafFunctionFunc: isLeafFunctionFunc ?? (_) => false,
enumShouldBeIntFunc: enumShouldBeIntFunc ?? (_) => false,
unnamedEnumsShouldBeIntFunc:
unnamedEnumsShouldBeIntFunc ?? (_) => false,
ffiNativeConfig: ffiNativeConfig,
ignoreSourceErrors: ignoreSourceErrors,
formatOutput: formatOutput,
externalVersions: externalVersions,
);