names library

Classes

FieldNames
The Dart member names in a GeneratedMessage subclass for one protobuf field.
MemberNames
OneofNames
The Dart names associated with a oneof declaration.

Properties

forbiddenExtensionNames List<String>
final
forbiddenTopLevelNames List<String>
Names that would collide as top-level identifiers.
final
reservedEnumNames Set<String>
Returns the set of names reserved by the ProtobufEnum class and its generated subclasses.
no setter
reservedMemberNames List<String>
final

Functions

avoidInitialUnderscore(String input) String
Move any initial underscores in input to the end.
countRealOneofs(DescriptorProto descriptor) int
defaultSuffixes() Iterable<String>
disambiguateName(String name, Set<String> usedNames, Iterable<String> suffixes, {List<String> generateVariants(String candidate)?}) String
Returns a name that is not contained in usedNames by suffixing it with the first possible suffix from suffixes.
enumSuffixes() Iterable<String>
extensionClassName(FileDescriptorProto descriptor, Set<String> usedNames) String
Chooses the name of the Dart class holding top-level extensions.
extensionName(FieldDescriptorProto descriptor, Set<String> usedNames) String
Chooses the Dart name of an extension.
extensionSuffixes() Iterable<String>
legalDartIdentifier(String input) String
Replaces all characters in input that are not valid in a dart identifier with _.
lowerCaseFirstLetter(String input) String
messageMemberNames(DescriptorProto descriptor, String parentClassName, Set<String> usedTopLevelNames, {Iterable<String> reserved = const []}) MemberNames
Chooses the GeneratedMessage member names for each field and names associated with each oneof declaration.
messageOrEnumClassName(String descriptorName, Set<String> usedNames, {String parent = ''}) String
Chooses the name of the Dart class to generate for a proto message or enum.
oneofEnumClassName(String descriptorName, Set<String> usedNames, String parentName) String
oneofEnumMemberName(String fieldName) String
singleQuote(String input) String
Returns input surrounded by single quotes and with all '$'s escaped.
underscoresToCamelCase(String s) String

Exceptions / Errors

DartNameOptionException