generator_tools
library
Classes
-
Describes how to format a document comment.
-
EnumeratedClass
-
A class name that is enumerated.
-
HostDatatype
-
Represents the mapping of a Dart datatype to a Host datatype.
-
Indent
-
A helper class for managing indentation, wrapping a StringSink.
-
Keys
-
Collection of keys used in dictionaries across generators.
-
OutputFileOptions<T>
-
Options for Generators that have multiple output file types.
Enums
-
ApiType
-
Enum to specify api type when generating code.
-
FileType
-
Enum to specify which file will be generated for multi-file generators
Functions
-
Formats documentation comments and adds them to current Indent.
-
addLines(Indent indent, Iterable<String> lines, {String? linePrefix})
→ void
-
Adds the
lines
to indent
.
-
Formats documentation comments and adds them to current Indent.
-
deducePackageName(String mainDartFile)
→ String?
-
Given the path of a Dart file,
mainDartFile
, the name of the package will
be deduced by locating and parsing its associated pubspec.yaml.
-
getCodecClasses(Api api, Root root)
→ Iterable<EnumeratedClass>
-
Given an Api, return the enumerated classes that must exist in the codec
where the enumeration should be the key used in the buffer.
-
getFieldHostDatatype(NamedType field, String? builtinResolver(TypeDeclaration), {String customResolver(String)?})
→ HostDatatype
-
Calculates the HostDatatype for the provided NamedType.
-
getFieldsInSerializationOrder(Class classDefinition)
→ Iterable<NamedType>
-
Returns an ordered list of fields to provide consistent serialization order.
-
getGeneratedCodeWarning()
→ String
-
Warning printed at the top of all generated code.
-
getHostDatatype(TypeDeclaration type, String? builtinResolver(TypeDeclaration), {String customResolver(String)?})
→ HostDatatype
-
Calculates the HostDatatype for the provided TypeDeclaration.
-
getReferencedTypes(List<Api> apis, List<Class> classes)
→ Map<TypeDeclaration, List<int>>
-
Recurses into a list of Apis and produces a list of all referenced types
and an associated List of the offsets where they are found.
-
isVoid(TypeMirror type)
→ bool
-
Returns true if
type
represents 'void'.
-
makeChannelName(Api api, Method method, String dartPackageName)
→ String
-
Create the generated channel name for a
method
on an api
.
-
makeChannelNameWithStrings({required String apiName, required String methodName, required String dartPackageName})
→ String
-
Create the generated channel name for a method on an api.
-
mergeMaps(Map<String, Object> base, Map<String, Object> modification)
→ Map<String, Object>
-
Recursively merges
modification
into base
.
-
readStdin()
→ String
-
Read all the content from stdin to a String.