[pigeon] Minor C++ output adjustments (#3083)
* [pigeon] Minor C++ output fixes
Removes a stray ; from an inline constructor.
Fixes indentation for an inline vector construction.
* Version bump
* Change list serialization construction and remove a bunch of flutter::s
* Move some implementation-file-only helpers into the class
* Remove more namespaces
* Update test expectations
* Improve test
* declaration-style comment
* Fix generator version
diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md
index f0e4b57..a1f08b1 100644
--- a/packages/pigeon/CHANGELOG.md
+++ b/packages/pigeon/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 7.0.4
+
+* [c++] Fixes minor output formatting issues.
+
## 7.0.3
* Updates scoped methods to prevent symbol-less use.
diff --git a/packages/pigeon/lib/cpp_generator.dart b/packages/pigeon/lib/cpp_generator.dart
index dbaac5f..fc6be2f 100644
--- a/packages/pigeon/lib/cpp_generator.dart
+++ b/packages/pigeon/lib/cpp_generator.dart
@@ -312,7 +312,7 @@
indent.addScoped(' public:', '', () {
indent.writeln('${api.name}(const ${api.name}&) = delete;');
indent.writeln('${api.name}& operator=(const ${api.name}&) = delete;');
- indent.writeln('virtual ~${api.name}() { };');
+ indent.writeln('virtual ~${api.name}() {}');
for (final Method method in api.methods) {
final HostDatatype returnType = getHostDatatype(method.returnType,
root.classes, root.enums, _baseCppTypeForBuiltinDartType);
@@ -501,6 +501,22 @@
}
@override
+ void writeGeneralUtilities(
+ CppOptions generatorOptions, Root root, Indent indent) {
+ final List<String> usingDirectives = <String>[
+ 'flutter::BasicMessageChannel',
+ 'flutter::CustomEncodableValue',
+ 'flutter::EncodableList',
+ 'flutter::EncodableMap',
+ 'flutter::EncodableValue',
+ ];
+ usingDirectives.sort();
+ for (final String using in usingDirectives) {
+ indent.writeln('using $using;');
+ }
+ }
+
+ @override
void writeDataClass(
CppOptions generatorOptions, Root root, Indent indent, Class klass) {
final Set<String> customClassNames =
@@ -539,18 +555,18 @@
Set<String> customClassNames,
Set<String> customEnumNames,
) {
- indent.write(
- 'flutter::EncodableList ${klass.name}::ToEncodableList() const ');
+ indent.write('EncodableList ${klass.name}::ToEncodableList() const ');
indent.addScoped('{', '}', () {
- indent.addScoped('return flutter::EncodableList{', '};', () {
- for (final NamedType field in getFieldsInSerializationOrder(klass)) {
- final HostDatatype hostDatatype = getFieldHostDatatype(
- field, root.classes, root.enums, _baseCppTypeForBuiltinDartType);
- final String encodableValue = _wrappedHostApiArgumentExpression(
- root, _makeInstanceVariableName(field), field.type, hostDatatype);
- indent.writeln('$encodableValue,');
- }
- });
+ indent.writeln('EncodableList list;');
+ indent.writeln('list.reserve(${klass.fields.length});');
+ for (final NamedType field in getFieldsInSerializationOrder(klass)) {
+ final HostDatatype hostDatatype = getFieldHostDatatype(field,
+ root.classes, root.enums, _shortBaseCppTypeForBuiltinDartType);
+ final String encodableValue = _wrappedHostApiArgumentExpression(
+ root, _makeInstanceVariableName(field), field.type, hostDatatype);
+ indent.writeln('list.push_back($encodableValue);');
+ }
+ indent.writeln('return list;');
});
indent.newln();
}
@@ -564,8 +580,7 @@
Set<String> customClassNames,
Set<String> customEnumNames,
) {
- indent.write(
- '${klass.name}::${klass.name}(const flutter::EncodableList& list) ');
+ indent.write('${klass.name}::${klass.name}(const EncodableList& list) ');
indent.addScoped('{', '}', () {
enumerate(getFieldsInSerializationOrder(klass),
(int index, final NamedType field) {
@@ -579,8 +594,8 @@
indent.writeln(
'if (const int32_t* $pointerFieldName = std::get_if<int32_t>(&$encodableFieldName))\t$instanceVariableName = (${field.type.baseName})*$pointerFieldName;');
} else {
- final HostDatatype hostDatatype = getFieldHostDatatype(
- field, root.classes, root.enums, _baseCppTypeForBuiltinDartType);
+ final HostDatatype hostDatatype = getFieldHostDatatype(field,
+ root.classes, root.enums, _shortBaseCppTypeForBuiltinDartType);
if (field.type.baseName == 'int') {
indent.format('''
if (const int32_t* $pointerFieldName = std::get_if<int32_t>(&$encodableFieldName))
@@ -592,7 +607,7 @@
.map((Class x) => x.name)
.contains(field.type.baseName)) {
indent.write(
- 'if (const flutter::EncodableList* $pointerFieldName = std::get_if<flutter::EncodableList>(&$encodableFieldName)) ');
+ 'if (const EncodableList* $pointerFieldName = std::get_if<EncodableList>(&$encodableFieldName)) ');
indent.addScoped('{', '}', () {
indent.writeln(
'$instanceVariableName = ${hostDatatype.datatype}(*$pointerFieldName);');
@@ -639,14 +654,14 @@
for (final Method func in api.methods) {
final String channelName = makeChannelName(api, func);
final HostDatatype returnType = getHostDatatype(func.returnType,
- root.classes, root.enums, _baseCppTypeForBuiltinDartType);
+ root.classes, root.enums, _shortBaseCppTypeForBuiltinDartType);
// Determine the input paramater list, saved in a structured form for later
// use as platform channel call arguments.
final Iterable<_HostNamedType> hostParameters =
indexMap(func.arguments, (int i, NamedType arg) {
final HostDatatype hostType = getFieldHostDatatype(
- arg, root.classes, root.enums, _baseCppTypeForBuiltinDartType);
+ arg, root.classes, root.enums, _shortBaseCppTypeForBuiltinDartType);
return _HostNamedType(_getSafeArgumentName(i, arg), hostType, arg.type);
});
final List<String> parameters = <String>[
@@ -659,17 +674,16 @@
indent.writeScoped('{', '}', () {
const String channel = 'channel';
indent.writeln(
- 'auto channel = std::make_unique<flutter::BasicMessageChannel<>>(binary_messenger_, '
+ 'auto channel = std::make_unique<BasicMessageChannel<>>(binary_messenger_, '
'"$channelName", &GetCodec());');
// Convert arguments to EncodableValue versions.
const String argumentListVariableName = 'encoded_api_arguments';
- indent.write('flutter::EncodableValue $argumentListVariableName = ');
+ indent.write('EncodableValue $argumentListVariableName = ');
if (func.arguments.isEmpty) {
- indent.addln('flutter::EncodableValue();');
+ indent.addln('EncodableValue();');
} else {
- indent.addScoped(
- 'flutter::EncodableValue(flutter::EncodableList{', '});', () {
+ indent.addScoped('EncodableValue(EncodableList{', '});', () {
for (final _HostNamedType param in hostParameters) {
final String encodedArgument = _wrappedHostApiArgumentExpression(
root, param.name, param.originalType, param.hostType);
@@ -691,7 +705,7 @@
final String encodedReplyName =
'encodable_$successCallbackArgument';
indent.writeln(
- 'std::unique_ptr<flutter::EncodableValue> response = GetCodec().DecodeMessage(reply, reply_size);');
+ 'std::unique_ptr<EncodableValue> response = GetCodec().DecodeMessage(reply, reply_size);');
indent.writeln('const auto& $encodedReplyName = *response;');
_writeEncodableValueArgumentUnwrapping(indent, returnType,
argName: successCallbackArgument,
@@ -730,19 +744,19 @@
indent.write('');
indent.addScoped('{', '}', () {
indent.writeln(
- 'auto channel = std::make_unique<flutter::BasicMessageChannel<>>(binary_messenger, '
+ 'auto channel = std::make_unique<BasicMessageChannel<>>(binary_messenger, '
'"$channelName", &GetCodec());');
indent.write('if (api != nullptr) ');
indent.addScoped('{', '} else {', () {
indent.write(
- 'channel->SetMessageHandler([api](const flutter::EncodableValue& message, const flutter::MessageReply<flutter::EncodableValue>& reply) ');
+ 'channel->SetMessageHandler([api](const EncodableValue& message, const flutter::MessageReply<EncodableValue>& reply) ');
indent.addScoped('{', '});', () {
indent.write('try ');
indent.addScoped('{', '}', () {
final List<String> methodArgument = <String>[];
if (method.arguments.isNotEmpty) {
indent.writeln(
- 'const auto& args = std::get<flutter::EncodableList>(message);');
+ 'const auto& args = std::get<EncodableList>(message);');
enumerate(method.arguments, (int index, NamedType arg) {
final HostDatatype hostType = getHostDatatype(
@@ -750,7 +764,7 @@
root.classes,
root.enums,
(TypeDeclaration x) =>
- _baseCppTypeForBuiltinDartType(x));
+ _shortBaseCppTypeForBuiltinDartType(x));
final String argName = _getSafeArgumentName(index, arg);
final String encodableArgName =
@@ -775,7 +789,7 @@
method.returnType,
root.classes,
root.enums,
- _baseCppTypeForBuiltinDartType);
+ _shortBaseCppTypeForBuiltinDartType);
final String returnTypeName = _hostApiReturnType(returnType);
if (method.isAsynchronous) {
methodArgument.add(
@@ -816,17 +830,17 @@
indent.newln();
indent.format('''
-flutter::EncodableValue ${api.name}::WrapError(std::string_view error_message) {
-\treturn flutter::EncodableValue(flutter::EncodableList{
-\t\tflutter::EncodableValue(std::string(error_message)),
-\t\tflutter::EncodableValue("Error"),
-\t\tflutter::EncodableValue()
+EncodableValue ${api.name}::WrapError(std::string_view error_message) {
+\treturn EncodableValue(EncodableList{
+\t\tEncodableValue(std::string(error_message)),
+\t\tEncodableValue("Error"),
+\t\tEncodableValue()
\t});
}
-flutter::EncodableValue ${api.name}::WrapError(const FlutterError& error) {
-\treturn flutter::EncodableValue(flutter::EncodableList{
-\t\tflutter::EncodableValue(error.message()),
-\t\tflutter::EncodableValue(error.code()),
+EncodableValue ${api.name}::WrapError(const FlutterError& error) {
+\treturn EncodableValue(EncodableList{
+\t\tEncodableValue(error.message()),
+\t\tEncodableValue(error.code()),
\t\terror.details()
\t});
}''');
@@ -844,7 +858,7 @@
indent.newln();
indent.writeln('$codeSerializerName::$codeSerializerName() {}');
indent.write(
- 'flutter::EncodableValue $codeSerializerName::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const ');
+ 'EncodableValue $codeSerializerName::ReadValueOfType(uint8_t type, flutter::ByteStreamReader* stream) const ');
indent.addScoped('{', '}', () {
indent.write('switch (type) ');
indent.addScoped('{', '}', () {
@@ -852,7 +866,7 @@
indent.writeln('case ${customClass.enumeration}:');
indent.nest(1, () {
indent.writeln(
- 'return flutter::CustomEncodableValue(${customClass.name}(std::get<flutter::EncodableList>(ReadValue(stream))));');
+ 'return CustomEncodableValue(${customClass.name}(std::get<EncodableList>(ReadValue(stream))));');
});
}
indent.writeln('default:');
@@ -864,10 +878,10 @@
});
indent.newln();
indent.write(
- 'void $codeSerializerName::WriteValue(const flutter::EncodableValue& value, flutter::ByteStreamWriter* stream) const ');
+ 'void $codeSerializerName::WriteValue(const EncodableValue& value, flutter::ByteStreamWriter* stream) const ');
indent.writeScoped('{', '}', () {
indent.write(
- 'if (const flutter::CustomEncodableValue* custom_value = std::get_if<flutter::CustomEncodableValue>(&value)) ');
+ 'if (const CustomEncodableValue* custom_value = std::get_if<CustomEncodableValue>(&value)) ');
indent.addScoped('{', '}', () {
for (final EnumeratedClass customClass in getCodecClasses(api, root)) {
indent.write(
@@ -875,7 +889,7 @@
indent.addScoped('{', '}', () {
indent.writeln('stream->WriteByte(${customClass.enumeration});');
indent.writeln(
- 'WriteValue(flutter::EncodableValue(std::any_cast<${customClass.name}>(*custom_value).ToEncodableList()), stream);');
+ 'WriteValue(EncodableValue(std::any_cast<${customClass.name}>(*custom_value).ToEncodableList()), stream);');
indent.writeln('return;');
});
}
@@ -888,7 +902,7 @@
void _writeCppSourceClassField(CppOptions generatorOptions, Root root,
Indent indent, Class klass, NamedType field) {
final HostDatatype hostDatatype = getFieldHostDatatype(
- field, root.classes, root.enums, _baseCppTypeForBuiltinDartType);
+ field, root.classes, root.enums, _shortBaseCppTypeForBuiltinDartType);
final String instanceVariableName = _makeInstanceVariableName(field);
final String qualifiedGetterName =
'${klass.name}::${_makeGetterName(field)}';
@@ -928,18 +942,17 @@
final String errorCondition;
final String errorGetter;
- const String nullValue = 'flutter::EncodableValue()';
+ const String nullValue = 'EncodableValue()';
if (returnType.isVoid) {
nonErrorPath = '${prefix}wrapped.push_back($nullValue);';
errorCondition = 'output.has_value()';
errorGetter = 'value';
} else {
- final HostDatatype hostType = getHostDatatype(
- returnType, root.classes, root.enums, _baseCppTypeForBuiltinDartType);
+ final HostDatatype hostType = getHostDatatype(returnType, root.classes,
+ root.enums, _shortBaseCppTypeForBuiltinDartType);
const String extractedValue = 'std::move(output).TakeValue()';
- final String wrapperType = hostType.isBuiltin
- ? 'flutter::EncodableValue'
- : 'flutter::CustomEncodableValue';
+ final String wrapperType =
+ hostType.isBuiltin ? 'EncodableValue' : 'CustomEncodableValue';
if (returnType.isNullable) {
// The value is a std::optional, so needs an extra layer of
// handling.
@@ -966,9 +979,9 @@
$prefix\treply(WrapError(output.$errorGetter()));
$prefix\treturn;
$prefix}
-${prefix}flutter::EncodableList wrapped;
+${prefix}EncodableList wrapped;
$nonErrorPath
-${prefix}reply(flutter::EncodableValue(std::move(wrapped)));''';
+${prefix}reply(EncodableValue(std::move(wrapped)));''';
}
@override
@@ -978,6 +991,96 @@
indent.writeln('} // namespace ${generatorOptions.namespace}');
}
}
+
+ /// Returns the expression to create an EncodableValue from a host API argument
+ /// with the given [variableName] and types.
+ String _wrappedHostApiArgumentExpression(Root root, String variableName,
+ TypeDeclaration dartType, HostDatatype hostType) {
+ final String encodableValue;
+ if (!hostType.isBuiltin &&
+ root.classes.any((Class c) => c.name == dartType.baseName)) {
+ final String operator = hostType.isNullable ? '->' : '.';
+ encodableValue =
+ 'EncodableValue($variableName${operator}ToEncodableList())';
+ } else if (!hostType.isBuiltin &&
+ root.enums.any((Enum e) => e.name == dartType.baseName)) {
+ final String nonNullValue =
+ hostType.isNullable ? '(*$variableName)' : variableName;
+ encodableValue = 'EncodableValue((int)$nonNullValue)';
+ } else {
+ final String operator = hostType.isNullable ? '*' : '';
+ encodableValue = 'EncodableValue($operator$variableName)';
+ }
+
+ if (hostType.isNullable) {
+ return '$variableName ? $encodableValue : EncodableValue()';
+ }
+ return encodableValue;
+ }
+
+ /// Writes the code to declare and populate a variable of type [hostType]
+ /// called [argName] to use as a parameter to an API method call, from an
+ /// existing EncodableValue variable called [encodableArgName].
+ void _writeEncodableValueArgumentUnwrapping(
+ Indent indent,
+ HostDatatype hostType, {
+ required String argName,
+ required String encodableArgName,
+ }) {
+ if (hostType.isNullable) {
+ // Nullable arguments are always pointers, with nullptr corresponding to
+ // null.
+ if (hostType.datatype == 'int64_t') {
+ // The EncodableValue will either be an int32_t or an int64_t depending
+ // on the value, but the generated API requires an int64_t so that it can
+ // handle any case. Create a local variable for the 64-bit value...
+ final String valueVarName = '${argName}_value';
+ indent.writeln(
+ 'const int64_t $valueVarName = $encodableArgName.IsNull() ? 0 : $encodableArgName.LongValue();');
+ // ... then declare the arg as a reference to that local.
+ indent.writeln(
+ 'const auto* $argName = $encodableArgName.IsNull() ? nullptr : &$valueVarName;');
+ } else if (hostType.datatype == 'EncodableValue') {
+ // Generic objects just pass the EncodableValue through directly.
+ indent.writeln('const auto* $argName = &$encodableArgName;');
+ } else if (hostType.isBuiltin) {
+ indent.writeln(
+ 'const auto* $argName = std::get_if<${hostType.datatype}>(&$encodableArgName);');
+ } else {
+ indent.writeln(
+ 'const auto* $argName = &(std::any_cast<const ${hostType.datatype}&>(std::get<CustomEncodableValue>($encodableArgName)));');
+ }
+ } else {
+ // Non-nullable arguments are either passed by value or reference, but the
+ // extraction doesn't need to distinguish since those are the same at the
+ // call site.
+ if (hostType.datatype == 'int64_t') {
+ // The EncodableValue will either be an int32_t or an int64_t depending
+ // on the value, but the generated API requires an int64_t so that it can
+ // handle any case.
+ indent
+ .writeln('const int64_t $argName = $encodableArgName.LongValue();');
+ } else if (hostType.datatype == 'EncodableValue') {
+ // Generic objects just pass the EncodableValue through directly. This
+ // creates an alias just to avoid having to special-case the
+ // argName/encodableArgName distinction at a higher level.
+ indent.writeln('const auto& $argName = $encodableArgName;');
+ } else if (hostType.isBuiltin) {
+ indent.writeln(
+ 'const auto& $argName = std::get<${hostType.datatype}>($encodableArgName);');
+ } else {
+ indent.writeln(
+ 'const auto& $argName = std::any_cast<const ${hostType.datatype}&>(std::get<CustomEncodableValue>($encodableArgName));');
+ }
+ }
+ }
+
+ /// A wrapper for [_baseCppTypeForBuiltinDartType] that generated Flutter
+ /// types without the namespace, since the implementation file uses `using`
+ /// directives.
+ String? _shortBaseCppTypeForBuiltinDartType(TypeDeclaration type) {
+ return _baseCppTypeForBuiltinDartType(type, includeFlutterNamespace: false);
+ }
}
/// Contains information about a host function argument.
@@ -1065,8 +1168,12 @@
return !_isReferenceType(type.datatype);
}
-String? _baseCppTypeForBuiltinDartType(TypeDeclaration type) {
- const Map<String, String> cppTypeForDartTypeMap = <String, String>{
+String? _baseCppTypeForBuiltinDartType(
+ TypeDeclaration type, {
+ bool includeFlutterNamespace = true,
+}) {
+ final String flutterNamespace = includeFlutterNamespace ? 'flutter::' : '';
+ final Map<String, String> cppTypeForDartTypeMap = <String, String>{
'void': 'void',
'bool': 'bool',
'int': 'int64_t',
@@ -1076,9 +1183,9 @@
'Int32List': 'std::vector<int32_t>',
'Int64List': 'std::vector<int64_t>',
'Float64List': 'std::vector<double>',
- 'Map': 'flutter::EncodableMap',
- 'List': 'flutter::EncodableList',
- 'Object': 'flutter::EncodableValue',
+ 'Map': '${flutterNamespace}EncodableMap',
+ 'List': '${flutterNamespace}EncodableList',
+ 'Object': '${flutterNamespace}EncodableValue',
};
if (cppTypeForDartTypeMap.containsKey(type.baseName)) {
return cppTypeForDartTypeMap[type.baseName];
@@ -1186,88 +1293,6 @@
}
}
-/// Returns the expression to create an EncodableValue from a host API argument
-/// with the given [variableName] and types.
-String _wrappedHostApiArgumentExpression(Root root, String variableName,
- TypeDeclaration dartType, HostDatatype hostType) {
- final String encodableValue;
- if (!hostType.isBuiltin &&
- root.classes.any((Class c) => c.name == dartType.baseName)) {
- final String operator = hostType.isNullable ? '->' : '.';
- encodableValue =
- 'flutter::EncodableValue($variableName${operator}ToEncodableList())';
- } else if (!hostType.isBuiltin &&
- root.enums.any((Enum e) => e.name == dartType.baseName)) {
- final String nonNullValue =
- hostType.isNullable ? '(*$variableName)' : variableName;
- encodableValue = 'flutter::EncodableValue((int)$nonNullValue)';
- } else {
- final String operator = hostType.isNullable ? '*' : '';
- encodableValue = 'flutter::EncodableValue($operator$variableName)';
- }
-
- if (hostType.isNullable) {
- return '$variableName ? $encodableValue : flutter::EncodableValue()';
- }
- return encodableValue;
-}
-
-// Writes the code to declare and populate a variable of type [hostType] called
-// [argName] to use as a parameter to an API method call, from an existing
-// EncodableValue variable called [encodableArgName].
-void _writeEncodableValueArgumentUnwrapping(
- Indent indent,
- HostDatatype hostType, {
- required String argName,
- required String encodableArgName,
-}) {
- if (hostType.isNullable) {
- // Nullable arguments are always pointers, with nullptr corresponding to
- // null.
- if (hostType.datatype == 'int64_t') {
- // The EncodableValue will either be an int32_t or an int64_t depending
- // on the value, but the generated API requires an int64_t so that it can
- // handle any case. Create a local variable for the 64-bit value...
- final String valueVarName = '${argName}_value';
- indent.writeln(
- 'const int64_t $valueVarName = $encodableArgName.IsNull() ? 0 : $encodableArgName.LongValue();');
- // ... then declare the arg as a reference to that local.
- indent.writeln(
- 'const auto* $argName = $encodableArgName.IsNull() ? nullptr : &$valueVarName;');
- } else if (hostType.datatype == 'flutter::EncodableValue') {
- // Generic objects just pass the EncodableValue through directly.
- indent.writeln('const auto* $argName = &$encodableArgName;');
- } else if (hostType.isBuiltin) {
- indent.writeln(
- 'const auto* $argName = std::get_if<${hostType.datatype}>(&$encodableArgName);');
- } else {
- indent.writeln(
- 'const auto* $argName = &(std::any_cast<const ${hostType.datatype}&>(std::get<flutter::CustomEncodableValue>($encodableArgName)));');
- }
- } else {
- // Non-nullable arguments are either passed by value or reference, but the
- // extraction doesn't need to distinguish since those are the same at the
- // call site.
- if (hostType.datatype == 'int64_t') {
- // The EncodableValue will either be an int32_t or an int64_t depending
- // on the value, but the generated API requires an int64_t so that it can
- // handle any case.
- indent.writeln('const int64_t $argName = $encodableArgName.LongValue();');
- } else if (hostType.datatype == 'flutter::EncodableValue') {
- // Generic objects just pass the EncodableValue through directly. This
- // creates an alias just to avoid having to special-case the
- // argName/encodableArgName distinction at a higher level.
- indent.writeln('const auto& $argName = $encodableArgName;');
- } else if (hostType.isBuiltin) {
- indent.writeln(
- 'const auto& $argName = std::get<${hostType.datatype}>($encodableArgName);');
- } else {
- indent.writeln(
- 'const auto& $argName = std::any_cast<const ${hostType.datatype}&>(std::get<flutter::CustomEncodableValue>($encodableArgName));');
- }
- }
-}
-
/// Validates an AST to make sure the cpp generator supports everything.
List<Error> validateCpp(CppOptions options, Root root) {
final List<Error> result = <Error>[];
diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart
index a76d02e..2e4918e 100644
--- a/packages/pigeon/lib/generator_tools.dart
+++ b/packages/pigeon/lib/generator_tools.dart
@@ -11,7 +11,7 @@
/// The current version of pigeon.
///
/// This must match the version in pubspec.yaml.
-const String pigeonVersion = '7.0.3';
+const String pigeonVersion = '7.0.4';
/// Read all the content from [stdin] to a String.
String readStdin() {
diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java
index ff2e178..0edb5fa 100644
--- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java
+++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
package com.example.alternate_language_test_plugin;
diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h
index 87832ea..286e4c5 100644
--- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h
+++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h>
diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m
index 7bd69e0..4df83cf 100644
--- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m
+++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#import "CoreTests.gen.h"
diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart
index d3638f4..93caa8f 100644
--- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart
+++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import
diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt
index b555d7b..1db2367 100644
--- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt
+++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
package com.example.test_plugin
diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift
index 870535c..5bebc81 100644
--- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift
+++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift
index 870535c..5bebc81 100644
--- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift
+++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
import Foundation
diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp
index b543a0c..4cba323 100644
--- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp
+++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#undef _HAS_EXCEPTIONS
@@ -19,6 +19,11 @@
#include <string>
namespace core_tests_pigeontest {
+using flutter::BasicMessageChannel;
+using flutter::CustomEncodableValue;
+using flutter::EncodableList;
+using flutter::EncodableMap;
+using flutter::EncodableValue;
// AllTypes
@@ -59,15 +64,13 @@
a_float_array_ = value_arg;
}
-const flutter::EncodableList& AllTypes::a_list() const { return a_list_; }
-void AllTypes::set_a_list(const flutter::EncodableList& value_arg) {
+const EncodableList& AllTypes::a_list() const { return a_list_; }
+void AllTypes::set_a_list(const EncodableList& value_arg) {
a_list_ = value_arg;
}
-const flutter::EncodableMap& AllTypes::a_map() const { return a_map_; }
-void AllTypes::set_a_map(const flutter::EncodableMap& value_arg) {
- a_map_ = value_arg;
-}
+const EncodableMap& AllTypes::a_map() const { return a_map_; }
+void AllTypes::set_a_map(const EncodableMap& value_arg) { a_map_ = value_arg; }
const AnEnum& AllTypes::an_enum() const { return an_enum_; }
void AllTypes::set_an_enum(const AnEnum& value_arg) { an_enum_ = value_arg; }
@@ -77,25 +80,26 @@
a_string_ = value_arg;
}
-flutter::EncodableList AllTypes::ToEncodableList() const {
- return flutter::EncodableList{
- flutter::EncodableValue(a_bool_),
- flutter::EncodableValue(an_int_),
- flutter::EncodableValue(a_double_),
- flutter::EncodableValue(a_byte_array_),
- flutter::EncodableValue(a4_byte_array_),
- flutter::EncodableValue(a8_byte_array_),
- flutter::EncodableValue(a_float_array_),
- flutter::EncodableValue(a_list_),
- flutter::EncodableValue(a_map_),
- flutter::EncodableValue((int)an_enum_),
- flutter::EncodableValue(a_string_),
- };
+EncodableList AllTypes::ToEncodableList() const {
+ EncodableList list;
+ list.reserve(11);
+ list.push_back(EncodableValue(a_bool_));
+ list.push_back(EncodableValue(an_int_));
+ list.push_back(EncodableValue(a_double_));
+ list.push_back(EncodableValue(a_byte_array_));
+ list.push_back(EncodableValue(a4_byte_array_));
+ list.push_back(EncodableValue(a8_byte_array_));
+ list.push_back(EncodableValue(a_float_array_));
+ list.push_back(EncodableValue(a_list_));
+ list.push_back(EncodableValue(a_map_));
+ list.push_back(EncodableValue((int)an_enum_));
+ list.push_back(EncodableValue(a_string_));
+ return list;
}
AllTypes::AllTypes() {}
-AllTypes::AllTypes(const flutter::EncodableList& list) {
+AllTypes::AllTypes(const EncodableList& list) {
auto& encodable_a_bool = list[0];
if (const bool* pointer_a_bool = std::get_if<bool>(&encodable_a_bool)) {
a_bool_ = *pointer_a_bool;
@@ -132,13 +136,13 @@
a_float_array_ = *pointer_a_float_array;
}
auto& encodable_a_list = list[7];
- if (const flutter::EncodableList* pointer_a_list =
- std::get_if<flutter::EncodableList>(&encodable_a_list)) {
+ if (const EncodableList* pointer_a_list =
+ std::get_if<EncodableList>(&encodable_a_list)) {
a_list_ = *pointer_a_list;
}
auto& encodable_a_map = list[8];
- if (const flutter::EncodableMap* pointer_a_map =
- std::get_if<flutter::EncodableMap>(&encodable_a_map)) {
+ if (const EncodableMap* pointer_a_map =
+ std::get_if<EncodableMap>(&encodable_a_map)) {
a_map_ = *pointer_a_map;
}
auto& encodable_an_enum = list[9];
@@ -240,75 +244,65 @@
a_nullable_float_array_ = value_arg;
}
-const flutter::EncodableList* AllNullableTypes::a_nullable_list() const {
+const EncodableList* AllNullableTypes::a_nullable_list() const {
return a_nullable_list_ ? &(*a_nullable_list_) : nullptr;
}
-void AllNullableTypes::set_a_nullable_list(
- const flutter::EncodableList* value_arg) {
- a_nullable_list_ = value_arg
- ? std::optional<flutter::EncodableList>(*value_arg)
- : std::nullopt;
+void AllNullableTypes::set_a_nullable_list(const EncodableList* value_arg) {
+ a_nullable_list_ =
+ value_arg ? std::optional<EncodableList>(*value_arg) : std::nullopt;
}
-void AllNullableTypes::set_a_nullable_list(
- const flutter::EncodableList& value_arg) {
+void AllNullableTypes::set_a_nullable_list(const EncodableList& value_arg) {
a_nullable_list_ = value_arg;
}
-const flutter::EncodableMap* AllNullableTypes::a_nullable_map() const {
+const EncodableMap* AllNullableTypes::a_nullable_map() const {
return a_nullable_map_ ? &(*a_nullable_map_) : nullptr;
}
-void AllNullableTypes::set_a_nullable_map(
- const flutter::EncodableMap* value_arg) {
- a_nullable_map_ = value_arg ? std::optional<flutter::EncodableMap>(*value_arg)
- : std::nullopt;
+void AllNullableTypes::set_a_nullable_map(const EncodableMap* value_arg) {
+ a_nullable_map_ =
+ value_arg ? std::optional<EncodableMap>(*value_arg) : std::nullopt;
}
-void AllNullableTypes::set_a_nullable_map(
- const flutter::EncodableMap& value_arg) {
+void AllNullableTypes::set_a_nullable_map(const EncodableMap& value_arg) {
a_nullable_map_ = value_arg;
}
-const flutter::EncodableList* AllNullableTypes::nullable_nested_list() const {
+const EncodableList* AllNullableTypes::nullable_nested_list() const {
return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr;
}
void AllNullableTypes::set_nullable_nested_list(
- const flutter::EncodableList* value_arg) {
+ const EncodableList* value_arg) {
nullable_nested_list_ =
- value_arg ? std::optional<flutter::EncodableList>(*value_arg)
- : std::nullopt;
+ value_arg ? std::optional<EncodableList>(*value_arg) : std::nullopt;
}
void AllNullableTypes::set_nullable_nested_list(
- const flutter::EncodableList& value_arg) {
+ const EncodableList& value_arg) {
nullable_nested_list_ = value_arg;
}
-const flutter::EncodableMap* AllNullableTypes::nullable_map_with_annotations()
- const {
+const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const {
return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_)
: nullptr;
}
void AllNullableTypes::set_nullable_map_with_annotations(
- const flutter::EncodableMap* value_arg) {
+ const EncodableMap* value_arg) {
nullable_map_with_annotations_ =
- value_arg ? std::optional<flutter::EncodableMap>(*value_arg)
- : std::nullopt;
+ value_arg ? std::optional<EncodableMap>(*value_arg) : std::nullopt;
}
void AllNullableTypes::set_nullable_map_with_annotations(
- const flutter::EncodableMap& value_arg) {
+ const EncodableMap& value_arg) {
nullable_map_with_annotations_ = value_arg;
}
-const flutter::EncodableMap* AllNullableTypes::nullable_map_with_object()
- const {
+const EncodableMap* AllNullableTypes::nullable_map_with_object() const {
return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr;
}
void AllNullableTypes::set_nullable_map_with_object(
- const flutter::EncodableMap* value_arg) {
+ const EncodableMap* value_arg) {
nullable_map_with_object_ =
- value_arg ? std::optional<flutter::EncodableMap>(*value_arg)
- : std::nullopt;
+ value_arg ? std::optional<EncodableMap>(*value_arg) : std::nullopt;
}
void AllNullableTypes::set_nullable_map_with_object(
- const flutter::EncodableMap& value_arg) {
+ const EncodableMap& value_arg) {
nullable_map_with_object_ = value_arg;
}
@@ -335,47 +329,49 @@
a_nullable_string_ = value_arg;
}
-flutter::EncodableList AllNullableTypes::ToEncodableList() const {
- return flutter::EncodableList{
- a_nullable_bool_ ? flutter::EncodableValue(*a_nullable_bool_)
- : flutter::EncodableValue(),
- a_nullable_int_ ? flutter::EncodableValue(*a_nullable_int_)
- : flutter::EncodableValue(),
- a_nullable_double_ ? flutter::EncodableValue(*a_nullable_double_)
- : flutter::EncodableValue(),
- a_nullable_byte_array_ ? flutter::EncodableValue(*a_nullable_byte_array_)
- : flutter::EncodableValue(),
- a_nullable4_byte_array_
- ? flutter::EncodableValue(*a_nullable4_byte_array_)
- : flutter::EncodableValue(),
- a_nullable8_byte_array_
- ? flutter::EncodableValue(*a_nullable8_byte_array_)
- : flutter::EncodableValue(),
- a_nullable_float_array_
- ? flutter::EncodableValue(*a_nullable_float_array_)
- : flutter::EncodableValue(),
- a_nullable_list_ ? flutter::EncodableValue(*a_nullable_list_)
- : flutter::EncodableValue(),
- a_nullable_map_ ? flutter::EncodableValue(*a_nullable_map_)
- : flutter::EncodableValue(),
- nullable_nested_list_ ? flutter::EncodableValue(*nullable_nested_list_)
- : flutter::EncodableValue(),
- nullable_map_with_annotations_
- ? flutter::EncodableValue(*nullable_map_with_annotations_)
- : flutter::EncodableValue(),
- nullable_map_with_object_
- ? flutter::EncodableValue(*nullable_map_with_object_)
- : flutter::EncodableValue(),
- a_nullable_enum_ ? flutter::EncodableValue((int)(*a_nullable_enum_))
- : flutter::EncodableValue(),
- a_nullable_string_ ? flutter::EncodableValue(*a_nullable_string_)
- : flutter::EncodableValue(),
- };
+EncodableList AllNullableTypes::ToEncodableList() const {
+ EncodableList list;
+ list.reserve(14);
+ list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_)
+ : EncodableValue());
+ list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_)
+ : EncodableValue());
+ list.push_back(a_nullable_double_ ? EncodableValue(*a_nullable_double_)
+ : EncodableValue());
+ list.push_back(a_nullable_byte_array_
+ ? EncodableValue(*a_nullable_byte_array_)
+ : EncodableValue());
+ list.push_back(a_nullable4_byte_array_
+ ? EncodableValue(*a_nullable4_byte_array_)
+ : EncodableValue());
+ list.push_back(a_nullable8_byte_array_
+ ? EncodableValue(*a_nullable8_byte_array_)
+ : EncodableValue());
+ list.push_back(a_nullable_float_array_
+ ? EncodableValue(*a_nullable_float_array_)
+ : EncodableValue());
+ list.push_back(a_nullable_list_ ? EncodableValue(*a_nullable_list_)
+ : EncodableValue());
+ list.push_back(a_nullable_map_ ? EncodableValue(*a_nullable_map_)
+ : EncodableValue());
+ list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_)
+ : EncodableValue());
+ list.push_back(nullable_map_with_annotations_
+ ? EncodableValue(*nullable_map_with_annotations_)
+ : EncodableValue());
+ list.push_back(nullable_map_with_object_
+ ? EncodableValue(*nullable_map_with_object_)
+ : EncodableValue());
+ list.push_back(a_nullable_enum_ ? EncodableValue((int)(*a_nullable_enum_))
+ : EncodableValue());
+ list.push_back(a_nullable_string_ ? EncodableValue(*a_nullable_string_)
+ : EncodableValue());
+ return list;
}
AllNullableTypes::AllNullableTypes() {}
-AllNullableTypes::AllNullableTypes(const flutter::EncodableList& list) {
+AllNullableTypes::AllNullableTypes(const EncodableList& list) {
auto& encodable_a_nullable_bool = list[0];
if (const bool* pointer_a_nullable_bool =
std::get_if<bool>(&encodable_a_nullable_bool)) {
@@ -416,31 +412,28 @@
a_nullable_float_array_ = *pointer_a_nullable_float_array;
}
auto& encodable_a_nullable_list = list[7];
- if (const flutter::EncodableList* pointer_a_nullable_list =
- std::get_if<flutter::EncodableList>(&encodable_a_nullable_list)) {
+ if (const EncodableList* pointer_a_nullable_list =
+ std::get_if<EncodableList>(&encodable_a_nullable_list)) {
a_nullable_list_ = *pointer_a_nullable_list;
}
auto& encodable_a_nullable_map = list[8];
- if (const flutter::EncodableMap* pointer_a_nullable_map =
- std::get_if<flutter::EncodableMap>(&encodable_a_nullable_map)) {
+ if (const EncodableMap* pointer_a_nullable_map =
+ std::get_if<EncodableMap>(&encodable_a_nullable_map)) {
a_nullable_map_ = *pointer_a_nullable_map;
}
auto& encodable_nullable_nested_list = list[9];
- if (const flutter::EncodableList* pointer_nullable_nested_list =
- std::get_if<flutter::EncodableList>(
- &encodable_nullable_nested_list)) {
+ if (const EncodableList* pointer_nullable_nested_list =
+ std::get_if<EncodableList>(&encodable_nullable_nested_list)) {
nullable_nested_list_ = *pointer_nullable_nested_list;
}
auto& encodable_nullable_map_with_annotations = list[10];
- if (const flutter::EncodableMap* pointer_nullable_map_with_annotations =
- std::get_if<flutter::EncodableMap>(
- &encodable_nullable_map_with_annotations)) {
+ if (const EncodableMap* pointer_nullable_map_with_annotations =
+ std::get_if<EncodableMap>(&encodable_nullable_map_with_annotations)) {
nullable_map_with_annotations_ = *pointer_nullable_map_with_annotations;
}
auto& encodable_nullable_map_with_object = list[11];
- if (const flutter::EncodableMap* pointer_nullable_map_with_object =
- std::get_if<flutter::EncodableMap>(
- &encodable_nullable_map_with_object)) {
+ if (const EncodableMap* pointer_nullable_map_with_object =
+ std::get_if<EncodableMap>(&encodable_nullable_map_with_object)) {
nullable_map_with_object_ = *pointer_nullable_map_with_object;
}
auto& encodable_a_nullable_enum = list[12];
@@ -463,66 +456,65 @@
values_ = value_arg;
}
-flutter::EncodableList AllNullableTypesWrapper::ToEncodableList() const {
- return flutter::EncodableList{
- flutter::EncodableValue(values_.ToEncodableList()),
- };
+EncodableList AllNullableTypesWrapper::ToEncodableList() const {
+ EncodableList list;
+ list.reserve(1);
+ list.push_back(EncodableValue(values_.ToEncodableList()));
+ return list;
}
AllNullableTypesWrapper::AllNullableTypesWrapper() {}
-AllNullableTypesWrapper::AllNullableTypesWrapper(
- const flutter::EncodableList& list) {
+AllNullableTypesWrapper::AllNullableTypesWrapper(const EncodableList& list) {
auto& encodable_values = list[0];
- if (const flutter::EncodableList* pointer_values =
- std::get_if<flutter::EncodableList>(&encodable_values)) {
+ if (const EncodableList* pointer_values =
+ std::get_if<EncodableList>(&encodable_values)) {
values_ = AllNullableTypes(*pointer_values);
}
}
HostIntegrationCoreApiCodecSerializer::HostIntegrationCoreApiCodecSerializer() {
}
-flutter::EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType(
+EncodableValue HostIntegrationCoreApiCodecSerializer::ReadValueOfType(
uint8_t type, flutter::ByteStreamReader* stream) const {
switch (type) {
case 128:
- return flutter::CustomEncodableValue(AllNullableTypes(
- std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllNullableTypes(std::get<EncodableList>(ReadValue(stream))));
case 129:
- return flutter::CustomEncodableValue(AllNullableTypesWrapper(
- std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllNullableTypesWrapper(std::get<EncodableList>(ReadValue(stream))));
case 130:
- return flutter::CustomEncodableValue(
- AllTypes(std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllTypes(std::get<EncodableList>(ReadValue(stream))));
default:
return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);
}
}
void HostIntegrationCoreApiCodecSerializer::WriteValue(
- const flutter::EncodableValue& value,
- flutter::ByteStreamWriter* stream) const {
- if (const flutter::CustomEncodableValue* custom_value =
- std::get_if<flutter::CustomEncodableValue>(&value)) {
+ const EncodableValue& value, flutter::ByteStreamWriter* stream) const {
+ if (const CustomEncodableValue* custom_value =
+ std::get_if<CustomEncodableValue>(&value)) {
if (custom_value->type() == typeid(AllNullableTypes)) {
stream->WriteByte(128);
WriteValue(
- flutter::EncodableValue(
+ EncodableValue(
std::any_cast<AllNullableTypes>(*custom_value).ToEncodableList()),
stream);
return;
}
if (custom_value->type() == typeid(AllNullableTypesWrapper)) {
stream->WriteByte(129);
- WriteValue(flutter::EncodableValue(
- std::any_cast<AllNullableTypesWrapper>(*custom_value)
- .ToEncodableList()),
- stream);
+ WriteValue(
+ EncodableValue(std::any_cast<AllNullableTypesWrapper>(*custom_value)
+ .ToEncodableList()),
+ stream);
return;
}
if (custom_value->type() == typeid(AllTypes)) {
stream->WriteByte(130);
- WriteValue(flutter::EncodableValue(
+ WriteValue(EncodableValue(
std::any_cast<AllTypes>(*custom_value).ToEncodableList()),
stream);
return;
@@ -542,22 +534,22 @@
void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger,
HostIntegrationCoreApi* api) {
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noop",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
std::optional<FlutterError> output = api->Noop();
if (output.has_value()) {
reply(WrapError(output.value()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::EncodableValue());
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue());
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -567,32 +559,31 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllTypes", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_everything_arg = args.at(0);
if (encodable_everything_arg.IsNull()) {
reply(WrapError("everything_arg unexpectedly null."));
return;
}
const auto& everything_arg = std::any_cast<const AllTypes&>(
- std::get<flutter::CustomEncodableValue>(
- encodable_everything_arg));
+ std::get<CustomEncodableValue>(encodable_everything_arg));
ErrorOr<AllTypes> output = api->EchoAllTypes(everything_arg);
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::CustomEncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ CustomEncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -602,20 +593,20 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoAllNullableTypes",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_everything_arg = args.at(0);
const auto* everything_arg =
&(std::any_cast<const AllNullableTypes&>(
- std::get<flutter::CustomEncodableValue>(
+ std::get<CustomEncodableValue>(
encodable_everything_arg)));
ErrorOr<std::optional<AllNullableTypes>> output =
api->EchoAllNullableTypes(everything_arg);
@@ -623,15 +614,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::CustomEncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ CustomEncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -641,22 +632,22 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.throwError", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
std::optional<FlutterError> output = api->ThrowError();
if (output.has_value()) {
reply(WrapError(output.value()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::EncodableValue());
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue());
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -666,15 +657,15 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoInt",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_an_int_arg = args.at(0);
if (encodable_an_int_arg.IsNull()) {
reply(WrapError("an_int_arg unexpectedly null."));
@@ -686,10 +677,9 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -699,15 +689,15 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoDouble", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_double_arg = args.at(0);
if (encodable_a_double_arg.IsNull()) {
reply(WrapError("a_double_arg unexpectedly null."));
@@ -720,10 +710,9 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -733,15 +722,15 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.echoBool",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_bool_arg = args.at(0);
if (encodable_a_bool_arg.IsNull()) {
reply(WrapError("a_bool_arg unexpectedly null."));
@@ -753,10 +742,9 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -766,15 +754,15 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoString", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_string_arg = args.at(0);
if (encodable_a_string_arg.IsNull()) {
reply(WrapError("a_string_arg unexpectedly null."));
@@ -787,10 +775,9 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -800,15 +787,15 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoUint8List", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_uint8_list_arg = args.at(0);
if (encodable_a_uint8_list_arg.IsNull()) {
reply(WrapError("a_uint8_list_arg unexpectedly null."));
@@ -822,10 +809,9 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -835,31 +821,29 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoObject", &GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_an_object_arg = args.at(0);
if (encodable_an_object_arg.IsNull()) {
reply(WrapError("an_object_arg unexpectedly null."));
return;
}
const auto& an_object_arg = encodable_an_object_arg;
- ErrorOr<flutter::EncodableValue> output =
- api->EchoObject(an_object_arg);
+ ErrorOr<EncodableValue> output = api->EchoObject(an_object_arg);
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -869,16 +853,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.extractNestedNullableString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_wrapper_arg = args.at(0);
if (encodable_wrapper_arg.IsNull()) {
reply(WrapError("wrapper_arg unexpectedly null."));
@@ -886,23 +870,22 @@
}
const auto& wrapper_arg =
std::any_cast<const AllNullableTypesWrapper&>(
- std::get<flutter::CustomEncodableValue>(
- encodable_wrapper_arg));
+ std::get<CustomEncodableValue>(encodable_wrapper_arg));
ErrorOr<std::optional<std::string>> output =
api->ExtractNestedNullableString(wrapper_arg);
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -912,16 +895,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.createNestedNullableString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_nullable_string_arg = args.at(0);
const auto* nullable_string_arg =
std::get_if<std::string>(&encodable_nullable_string_arg);
@@ -931,10 +914,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::CustomEncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ CustomEncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -944,16 +927,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.sendMultipleNullableTypes",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_bool_arg = args.at(0);
const auto* a_nullable_bool_arg =
std::get_if<bool>(&encodable_a_nullable_bool_arg);
@@ -976,10 +959,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::CustomEncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ CustomEncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -989,16 +972,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableInt",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_int_arg = args.at(0);
const int64_t a_nullable_int_arg_value =
encodable_a_nullable_int_arg.IsNull()
@@ -1014,15 +997,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1032,16 +1015,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableDouble",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_double_arg = args.at(0);
const auto* a_nullable_double_arg =
std::get_if<double>(&encodable_a_nullable_double_arg);
@@ -1051,15 +1034,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1069,16 +1052,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableBool",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_bool_arg = args.at(0);
const auto* a_nullable_bool_arg =
std::get_if<bool>(&encodable_a_nullable_bool_arg);
@@ -1088,15 +1071,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1106,16 +1089,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_string_arg = args.at(0);
const auto* a_nullable_string_arg =
std::get_if<std::string>(&encodable_a_nullable_string_arg);
@@ -1125,15 +1108,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1143,16 +1126,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableUint8List",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_uint8_list_arg = args.at(0);
const auto* a_nullable_uint8_list_arg =
std::get_if<std::vector<uint8_t>>(
@@ -1163,15 +1146,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1181,34 +1164,34 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoNullableObject",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_object_arg = args.at(0);
const auto* a_nullable_object_arg =
&encodable_a_nullable_object_arg;
- ErrorOr<std::optional<flutter::EncodableValue>> output =
+ ErrorOr<std::optional<EncodableValue>> output =
api->EchoNullableObject(a_nullable_object_arg);
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -1218,22 +1201,22 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.HostIntegrationCoreApi.noopAsync",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
api->NoopAsync([reply](std::optional<FlutterError>&& output) {
if (output.has_value()) {
reply(WrapError(output.value()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::EncodableValue());
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue());
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1244,16 +1227,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.echoAsyncString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_string_arg = args.at(0);
if (encodable_a_string_arg.IsNull()) {
reply(WrapError("a_string_arg unexpectedly null."));
@@ -1267,10 +1250,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1281,14 +1264,14 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterNoop",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
api->CallFlutterNoop(
[reply](std::optional<FlutterError>&& output) {
@@ -1296,9 +1279,9 @@
reply(WrapError(output.value()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::EncodableValue());
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue());
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1309,34 +1292,33 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoAllTypes",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_everything_arg = args.at(0);
if (encodable_everything_arg.IsNull()) {
reply(WrapError("everything_arg unexpectedly null."));
return;
}
const auto& everything_arg = std::any_cast<const AllTypes&>(
- std::get<flutter::CustomEncodableValue>(
- encodable_everything_arg));
+ std::get<CustomEncodableValue>(encodable_everything_arg));
api->CallFlutterEchoAllTypes(
everything_arg, [reply](ErrorOr<AllTypes>&& output) {
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::CustomEncodableValue(
- std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(
+ CustomEncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1347,17 +1329,17 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi."
"callFlutterSendMultipleNullableTypes",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_nullable_bool_arg = args.at(0);
const auto* a_nullable_bool_arg =
std::get_if<bool>(&encodable_a_nullable_bool_arg);
@@ -1381,10 +1363,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::CustomEncodableValue(
- std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(
+ CustomEncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1395,16 +1377,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoBool",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_bool_arg = args.at(0);
if (encodable_a_bool_arg.IsNull()) {
reply(WrapError("a_bool_arg unexpectedly null."));
@@ -1417,10 +1399,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1431,16 +1413,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoInt",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_an_int_arg = args.at(0);
if (encodable_an_int_arg.IsNull()) {
reply(WrapError("an_int_arg unexpectedly null."));
@@ -1453,10 +1435,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1467,16 +1449,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoDouble",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_double_arg = args.at(0);
if (encodable_a_double_arg.IsNull()) {
reply(WrapError("a_double_arg unexpectedly null."));
@@ -1490,10 +1472,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1504,16 +1486,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_string_arg = args.at(0);
if (encodable_a_string_arg.IsNull()) {
reply(WrapError("a_string_arg unexpectedly null."));
@@ -1527,10 +1509,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1541,16 +1523,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoUint8List",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_list_arg = args.at(0);
if (encodable_a_list_arg.IsNull()) {
reply(WrapError("a_list_arg unexpectedly null."));
@@ -1564,10 +1546,10 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1578,34 +1560,33 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoList",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_list_arg = args.at(0);
if (encodable_a_list_arg.IsNull()) {
reply(WrapError("a_list_arg unexpectedly null."));
return;
}
const auto& a_list_arg =
- std::get<flutter::EncodableList>(encodable_a_list_arg);
+ std::get<EncodableList>(encodable_a_list_arg);
api->CallFlutterEchoList(
- a_list_arg,
- [reply](ErrorOr<flutter::EncodableList>&& output) {
+ a_list_arg, [reply](ErrorOr<EncodableList>&& output) {
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1616,33 +1597,33 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoMap",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_map_arg = args.at(0);
if (encodable_a_map_arg.IsNull()) {
reply(WrapError("a_map_arg unexpectedly null."));
return;
}
const auto& a_map_arg =
- std::get<flutter::EncodableMap>(encodable_a_map_arg);
+ std::get<EncodableMap>(encodable_a_map_arg);
api->CallFlutterEchoMap(
- a_map_arg, [reply](ErrorOr<flutter::EncodableMap>&& output) {
+ a_map_arg, [reply](ErrorOr<EncodableMap>&& output) {
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
wrapped.push_back(
- flutter::EncodableValue(std::move(output).TakeValue()));
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableValue(std::move(output).TakeValue()));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1653,16 +1634,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableBool",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_bool_arg = args.at(0);
const auto* a_bool_arg = std::get_if<bool>(&encodable_a_bool_arg);
api->CallFlutterEchoNullableBool(
@@ -1671,15 +1652,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1690,16 +1671,16 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableInt",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_an_int_arg = args.at(0);
const int64_t an_int_arg_value =
encodable_an_int_arg.IsNull()
@@ -1714,15 +1695,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1733,17 +1714,17 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi."
"callFlutterEchoNullableDouble",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_double_arg = args.at(0);
const auto* a_double_arg =
std::get_if<double>(&encodable_a_double_arg);
@@ -1754,15 +1735,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1773,17 +1754,17 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi."
"callFlutterEchoNullableString",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_string_arg = args.at(0);
const auto* a_string_arg =
std::get_if<std::string>(&encodable_a_string_arg);
@@ -1794,15 +1775,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1813,17 +1794,17 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi."
"callFlutterEchoNullableUint8List",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_list_arg = args.at(0);
const auto* a_list_arg =
std::get_if<std::vector<uint8_t>>(&encodable_a_list_arg);
@@ -1835,15 +1816,15 @@
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1854,36 +1835,35 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableList",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_list_arg = args.at(0);
const auto* a_list_arg =
- std::get_if<flutter::EncodableList>(&encodable_a_list_arg);
+ std::get_if<EncodableList>(&encodable_a_list_arg);
api->CallFlutterEchoNullableList(
a_list_arg,
- [reply](
- ErrorOr<std::optional<flutter::EncodableList>>&& output) {
+ [reply](ErrorOr<std::optional<EncodableList>>&& output) {
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1894,36 +1874,35 @@
}
}
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger,
"dev.flutter.pigeon.HostIntegrationCoreApi.callFlutterEchoNullableMap",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
- const auto& args = std::get<flutter::EncodableList>(message);
+ const auto& args = std::get<EncodableList>(message);
const auto& encodable_a_map_arg = args.at(0);
const auto* a_map_arg =
- std::get_if<flutter::EncodableMap>(&encodable_a_map_arg);
+ std::get_if<EncodableMap>(&encodable_a_map_arg);
api->CallFlutterEchoNullableMap(
a_map_arg,
- [reply](
- ErrorOr<std::optional<flutter::EncodableMap>>&& output) {
+ [reply](ErrorOr<std::optional<EncodableMap>>&& output) {
if (output.has_error()) {
reply(WrapError(output.error()));
return;
}
- flutter::EncodableList wrapped;
+ EncodableList wrapped;
auto output_optional = std::move(output).TakeValue();
if (output_optional) {
- wrapped.push_back(flutter::EncodableValue(
- std::move(output_optional).value()));
+ wrapped.push_back(
+ EncodableValue(std::move(output_optional).value()));
} else {
- wrapped.push_back(flutter::EncodableValue());
+ wrapped.push_back(EncodableValue());
}
- reply(flutter::EncodableValue(std::move(wrapped)));
+ reply(EncodableValue(std::move(wrapped)));
});
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
@@ -1935,63 +1914,60 @@
}
}
-flutter::EncodableValue HostIntegrationCoreApi::WrapError(
+EncodableValue HostIntegrationCoreApi::WrapError(
std::string_view error_message) {
- return flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(std::string(error_message)),
- flutter::EncodableValue("Error"), flutter::EncodableValue()});
+ return EncodableValue(
+ EncodableList{EncodableValue(std::string(error_message)),
+ EncodableValue("Error"), EncodableValue()});
}
-flutter::EncodableValue HostIntegrationCoreApi::WrapError(
- const FlutterError& error) {
- return flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(error.message()),
- flutter::EncodableValue(error.code()), error.details()});
+EncodableValue HostIntegrationCoreApi::WrapError(const FlutterError& error) {
+ return EncodableValue(EncodableList{EncodableValue(error.message()),
+ EncodableValue(error.code()),
+ error.details()});
}
FlutterIntegrationCoreApiCodecSerializer::
FlutterIntegrationCoreApiCodecSerializer() {}
-flutter::EncodableValue
-FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType(
+EncodableValue FlutterIntegrationCoreApiCodecSerializer::ReadValueOfType(
uint8_t type, flutter::ByteStreamReader* stream) const {
switch (type) {
case 128:
- return flutter::CustomEncodableValue(AllNullableTypes(
- std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllNullableTypes(std::get<EncodableList>(ReadValue(stream))));
case 129:
- return flutter::CustomEncodableValue(AllNullableTypesWrapper(
- std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllNullableTypesWrapper(std::get<EncodableList>(ReadValue(stream))));
case 130:
- return flutter::CustomEncodableValue(
- AllTypes(std::get<flutter::EncodableList>(ReadValue(stream))));
+ return CustomEncodableValue(
+ AllTypes(std::get<EncodableList>(ReadValue(stream))));
default:
return flutter::StandardCodecSerializer::ReadValueOfType(type, stream);
}
}
void FlutterIntegrationCoreApiCodecSerializer::WriteValue(
- const flutter::EncodableValue& value,
- flutter::ByteStreamWriter* stream) const {
- if (const flutter::CustomEncodableValue* custom_value =
- std::get_if<flutter::CustomEncodableValue>(&value)) {
+ const EncodableValue& value, flutter::ByteStreamWriter* stream) const {
+ if (const CustomEncodableValue* custom_value =
+ std::get_if<CustomEncodableValue>(&value)) {
if (custom_value->type() == typeid(AllNullableTypes)) {
stream->WriteByte(128);
WriteValue(
- flutter::EncodableValue(
+ EncodableValue(
std::any_cast<AllNullableTypes>(*custom_value).ToEncodableList()),
stream);
return;
}
if (custom_value->type() == typeid(AllNullableTypesWrapper)) {
stream->WriteByte(129);
- WriteValue(flutter::EncodableValue(
- std::any_cast<AllNullableTypesWrapper>(*custom_value)
- .ToEncodableList()),
- stream);
+ WriteValue(
+ EncodableValue(std::any_cast<AllNullableTypesWrapper>(*custom_value)
+ .ToEncodableList()),
+ stream);
return;
}
if (custom_value->type() == typeid(AllTypes)) {
stream->WriteByte(130);
- WriteValue(flutter::EncodableValue(
+ WriteValue(EncodableValue(
std::any_cast<AllTypes>(*custom_value).ToEncodableList()),
stream);
return;
@@ -2015,10 +1991,10 @@
void FlutterIntegrationCoreApi::Noop(
std::function<void(void)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.noop",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments = flutter::EncodableValue();
+ EncodableValue encoded_api_arguments = EncodableValue();
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
@@ -2028,22 +2004,21 @@
const AllTypes& everything_arg,
std::function<void(const AllTypes&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllTypes", &GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(everything_arg.ToEncodableList()),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(everything_arg.ToEncodableList()),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value = std::any_cast<const AllTypes&>(
- std::get<flutter::CustomEncodableValue>(encodable_return_value));
+ std::get<CustomEncodableValue>(encodable_return_value));
on_success(return_value);
});
}
@@ -2051,23 +2026,22 @@
const AllNullableTypes& everything_arg,
std::function<void(const AllNullableTypes&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoAllNullableTypes",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(everything_arg.ToEncodableList()),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(everything_arg.ToEncodableList()),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value = std::any_cast<const AllNullableTypes&>(
- std::get<flutter::CustomEncodableValue>(encodable_return_value));
+ std::get<CustomEncodableValue>(encodable_return_value));
on_success(return_value);
});
}
@@ -2076,47 +2050,44 @@
const std::string* a_nullable_string_arg,
std::function<void(const AllNullableTypes&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.sendMultipleNullableTypes",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_nullable_bool_arg ? flutter::EncodableValue(*a_nullable_bool_arg)
- : flutter::EncodableValue(),
- a_nullable_int_arg ? flutter::EncodableValue(*a_nullable_int_arg)
- : flutter::EncodableValue(),
- a_nullable_string_arg
- ? flutter::EncodableValue(*a_nullable_string_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_nullable_bool_arg ? EncodableValue(*a_nullable_bool_arg)
+ : EncodableValue(),
+ a_nullable_int_arg ? EncodableValue(*a_nullable_int_arg)
+ : EncodableValue(),
+ a_nullable_string_arg ? EncodableValue(*a_nullable_string_arg)
+ : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value = std::any_cast<const AllNullableTypes&>(
- std::get<flutter::CustomEncodableValue>(encodable_return_value));
+ std::get<CustomEncodableValue>(encodable_return_value));
on_success(return_value);
});
}
void FlutterIntegrationCoreApi::EchoBool(
bool a_bool_arg, std::function<void(bool)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoBool", &GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_bool_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_bool_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value = std::get<bool>(encodable_return_value);
@@ -2126,18 +2097,17 @@
void FlutterIntegrationCoreApi::EchoInt(
int64_t an_int_arg, std::function<void(int64_t)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoInt",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(an_int_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(an_int_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const int64_t return_value = encodable_return_value.LongValue();
@@ -2147,18 +2117,17 @@
void FlutterIntegrationCoreApi::EchoDouble(
double a_double_arg, std::function<void(double)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoDouble", &GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_double_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_double_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value = std::get<double>(encodable_return_value);
@@ -2169,18 +2138,17 @@
const std::string& a_string_arg,
std::function<void(const std::string&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoString", &GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_string_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_string_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value =
@@ -2192,19 +2160,18 @@
const std::vector<uint8_t>& a_list_arg,
std::function<void(const std::vector<uint8_t>&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoUint8List",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_list_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_list_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value =
@@ -2213,68 +2180,64 @@
});
}
void FlutterIntegrationCoreApi::EchoList(
- const flutter::EncodableList& a_list_arg,
- std::function<void(const flutter::EncodableList&)>&& on_success,
+ const EncodableList& a_list_arg,
+ std::function<void(const EncodableList&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoList", &GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_list_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_list_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value =
- std::get<flutter::EncodableList>(encodable_return_value);
+ std::get<EncodableList>(encodable_return_value);
on_success(return_value);
});
}
void FlutterIntegrationCoreApi::EchoMap(
- const flutter::EncodableMap& a_map_arg,
- std::function<void(const flutter::EncodableMap&)>&& on_success,
+ const EncodableMap& a_map_arg,
+ std::function<void(const EncodableMap&)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_, "dev.flutter.pigeon.FlutterIntegrationCoreApi.echoMap",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(a_map_arg),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ EncodableValue(a_map_arg),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto& return_value =
- std::get<flutter::EncodableMap>(encodable_return_value);
+ std::get<EncodableMap>(encodable_return_value);
on_success(return_value);
});
}
void FlutterIntegrationCoreApi::EchoNullableBool(
const bool* a_bool_arg, std::function<void(const bool*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableBool",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_bool_arg ? flutter::EncodableValue(*a_bool_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value = std::get_if<bool>(&encodable_return_value);
@@ -2284,20 +2247,18 @@
void FlutterIntegrationCoreApi::EchoNullableInt(
const int64_t* an_int_arg, std::function<void(const int64_t*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableInt",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- an_int_arg ? flutter::EncodableValue(*an_int_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const int64_t return_value_value =
@@ -2312,20 +2273,18 @@
void FlutterIntegrationCoreApi::EchoNullableDouble(
const double* a_double_arg, std::function<void(const double*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableDouble",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_double_arg ? flutter::EncodableValue(*a_double_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_double_arg ? EncodableValue(*a_double_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value = std::get_if<double>(&encodable_return_value);
@@ -2336,20 +2295,18 @@
const std::string* a_string_arg,
std::function<void(const std::string*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableString",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_string_arg ? flutter::EncodableValue(*a_string_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value =
@@ -2361,20 +2318,18 @@
const std::vector<uint8_t>* a_list_arg,
std::function<void(const std::vector<uint8_t>*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableUint8List",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_list_arg ? flutter::EncodableValue(*a_list_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value =
@@ -2383,52 +2338,48 @@
});
}
void FlutterIntegrationCoreApi::EchoNullableList(
- const flutter::EncodableList* a_list_arg,
- std::function<void(const flutter::EncodableList*)>&& on_success,
+ const EncodableList* a_list_arg,
+ std::function<void(const EncodableList*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableList",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_list_arg ? flutter::EncodableValue(*a_list_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value =
- std::get_if<flutter::EncodableList>(&encodable_return_value);
+ std::get_if<EncodableList>(&encodable_return_value);
on_success(return_value);
});
}
void FlutterIntegrationCoreApi::EchoNullableMap(
- const flutter::EncodableMap* a_map_arg,
- std::function<void(const flutter::EncodableMap*)>&& on_success,
+ const EncodableMap* a_map_arg,
+ std::function<void(const EncodableMap*)>&& on_success,
std::function<void(const FlutterError&)>&& on_error) {
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger_,
"dev.flutter.pigeon.FlutterIntegrationCoreApi.echoNullableMap",
&GetCodec());
- flutter::EncodableValue encoded_api_arguments =
- flutter::EncodableValue(flutter::EncodableList{
- a_map_arg ? flutter::EncodableValue(*a_map_arg)
- : flutter::EncodableValue(),
- });
+ EncodableValue encoded_api_arguments = EncodableValue(EncodableList{
+ a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(),
+ });
channel->Send(
encoded_api_arguments,
[on_success = std::move(on_success), on_error = std::move(on_error)](
const uint8_t* reply, size_t reply_size) {
- std::unique_ptr<flutter::EncodableValue> response =
+ std::unique_ptr<EncodableValue> response =
GetCodec().DecodeMessage(reply, reply_size);
const auto& encodable_return_value = *response;
const auto* return_value =
- std::get_if<flutter::EncodableMap>(&encodable_return_value);
+ std::get_if<EncodableMap>(&encodable_return_value);
on_success(return_value);
});
}
@@ -2443,22 +2394,22 @@
void HostTrivialApi::SetUp(flutter::BinaryMessenger* binary_messenger,
HostTrivialApi* api) {
{
- auto channel = std::make_unique<flutter::BasicMessageChannel<>>(
+ auto channel = std::make_unique<BasicMessageChannel<>>(
binary_messenger, "dev.flutter.pigeon.HostTrivialApi.noop",
&GetCodec());
if (api != nullptr) {
channel->SetMessageHandler(
- [api](const flutter::EncodableValue& message,
- const flutter::MessageReply<flutter::EncodableValue>& reply) {
+ [api](const EncodableValue& message,
+ const flutter::MessageReply<EncodableValue>& reply) {
try {
std::optional<FlutterError> output = api->Noop();
if (output.has_value()) {
reply(WrapError(output.value()));
return;
}
- flutter::EncodableList wrapped;
- wrapped.push_back(flutter::EncodableValue());
- reply(flutter::EncodableValue(std::move(wrapped)));
+ EncodableList wrapped;
+ wrapped.push_back(EncodableValue());
+ reply(EncodableValue(std::move(wrapped)));
} catch (const std::exception& exception) {
reply(WrapError(exception.what()));
}
@@ -2469,16 +2420,15 @@
}
}
-flutter::EncodableValue HostTrivialApi::WrapError(
- std::string_view error_message) {
- return flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(std::string(error_message)),
- flutter::EncodableValue("Error"), flutter::EncodableValue()});
+EncodableValue HostTrivialApi::WrapError(std::string_view error_message) {
+ return EncodableValue(
+ EncodableList{EncodableValue(std::string(error_message)),
+ EncodableValue("Error"), EncodableValue()});
}
-flutter::EncodableValue HostTrivialApi::WrapError(const FlutterError& error) {
- return flutter::EncodableValue(flutter::EncodableList{
- flutter::EncodableValue(error.message()),
- flutter::EncodableValue(error.code()), error.details()});
+EncodableValue HostTrivialApi::WrapError(const FlutterError& error) {
+ return EncodableValue(EncodableList{EncodableValue(error.message()),
+ EncodableValue(error.code()),
+ error.details()});
}
} // namespace core_tests_pigeontest
diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h
index 3815239..d696b51 100644
--- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h
+++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// Autogenerated from Pigeon (v7.0.3), do not edit directly.
+// Autogenerated from Pigeon (v7.0.4), do not edit directly.
// See also: https://pub.dev/packages/pigeon
#ifndef PIGEON_CORE_TESTS_GEN_H_
@@ -262,7 +262,7 @@
public:
HostIntegrationCoreApi(const HostIntegrationCoreApi&) = delete;
HostIntegrationCoreApi& operator=(const HostIntegrationCoreApi&) = delete;
- virtual ~HostIntegrationCoreApi(){};
+ virtual ~HostIntegrationCoreApi() {}
// A no-op function taking no arguments and returning no value, to sanity
// test basic calling.
virtual std::optional<FlutterError> Noop() = 0;
@@ -509,7 +509,7 @@
public:
HostTrivialApi(const HostTrivialApi&) = delete;
HostTrivialApi& operator=(const HostTrivialApi&) = delete;
- virtual ~HostTrivialApi(){};
+ virtual ~HostTrivialApi() {}
virtual std::optional<FlutterError> Noop() = 0;
// The codec used by HostTrivialApi.
diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml
index 9b17974..ad4be28 100644
--- a/packages/pigeon/pubspec.yaml
+++ b/packages/pigeon/pubspec.yaml
@@ -2,7 +2,7 @@
description: Code generator tool to make communication between Flutter and the host platform type-safe and easier.
repository: https://github.com/flutter/packages/tree/main/packages/pigeon
issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3Apigeon
-version: 7.0.3 # This must match the version in lib/generator_tools.dart
+version: 7.0.4 # This must match the version in lib/generator_tools.dart
environment:
sdk: ">=2.12.0 <3.0.0"
diff --git a/packages/pigeon/test/cpp_generator_test.dart b/packages/pigeon/test/cpp_generator_test.dart
index 9aa4784..36cb007 100644
--- a/packages/pigeon/test/cpp_generator_test.dart
+++ b/packages/pigeon/test/cpp_generator_test.dart
@@ -57,6 +57,7 @@
expect(code, contains('class Input'));
expect(code, contains('class Output'));
expect(code, contains('class Api'));
+ expect(code, contains('virtual ~Api() {}\n'));
}
{
final StringBuffer sink = StringBuffer();
@@ -546,13 +547,22 @@
// Serialization handles optionals.
expect(
code,
- contains('nullable_bool_ ? flutter::EncodableValue(*nullable_bool_) '
- ': flutter::EncodableValue()'));
+ contains('nullable_bool_ ? EncodableValue(*nullable_bool_) '
+ ': EncodableValue()'));
expect(
code,
contains(
- 'nullable_nested_ ? flutter::EncodableValue(nullable_nested_->ToEncodableList()) '
- ': flutter::EncodableValue()'));
+ 'nullable_nested_ ? EncodableValue(nullable_nested_->ToEncodableList()) '
+ ': EncodableValue()'));
+
+ // Serialization should use push_back, not initializer lists, to avoid
+ // copies.
+ expect(code, contains('list.reserve(4)'));
+ expect(
+ code,
+ contains('list.push_back(nullable_bool_ ? '
+ 'EncodableValue(*nullable_bool_) : '
+ 'EncodableValue())'));
}
});
@@ -660,8 +670,14 @@
expect(code, contains('non_nullable_string_ = value_arg;'));
expect(code, contains('non_nullable_nested_ = value_arg;'));
// Serialization uses the value directly.
- expect(code, contains('flutter::EncodableValue(non_nullable_bool_)'));
+ expect(code, contains('EncodableValue(non_nullable_bool_)'));
expect(code, contains('non_nullable_nested_.ToEncodableList()'));
+
+ // Serialization should use push_back, not initializer lists, to avoid
+ // copies.
+ expect(code, contains('list.reserve(4)'));
+ expect(
+ code, contains('list.push_back(EncodableValue(non_nullable_bool_))'));
}
});
@@ -987,11 +1003,11 @@
expect(
code,
contains(
- 'const auto* a_list_arg = std::get_if<flutter::EncodableList>(&encodable_a_list_arg);'));
+ 'const auto* a_list_arg = std::get_if<EncodableList>(&encodable_a_list_arg);'));
expect(
code,
contains(
- 'const auto* a_map_arg = std::get_if<flutter::EncodableMap>(&encodable_a_map_arg);'));
+ 'const auto* a_map_arg = std::get_if<EncodableMap>(&encodable_a_map_arg);'));
// Ints are complicated since there are two possible pointer types, but
// the paramter always needs an int64_t*.
expect(
@@ -1006,7 +1022,7 @@
expect(
code,
contains(
- 'const auto* an_object_arg = &(std::any_cast<const ParameterObject&>(std::get<flutter::CustomEncodableValue>(encodable_an_object_arg)));'));
+ 'const auto* an_object_arg = &(std::any_cast<const ParameterObject&>(std::get<CustomEncodableValue>(encodable_an_object_arg)));'));
// "Object" requires no extraction at all since it has to use
// EncodableValue directly.
expect(
@@ -1128,11 +1144,11 @@
expect(
code,
contains(
- 'const auto& a_list_arg = std::get<flutter::EncodableList>(encodable_a_list_arg);'));
+ 'const auto& a_list_arg = std::get<EncodableList>(encodable_a_list_arg);'));
expect(
code,
contains(
- 'const auto& a_map_arg = std::get<flutter::EncodableMap>(encodable_a_map_arg);'));
+ 'const auto& a_map_arg = std::get<EncodableMap>(encodable_a_map_arg);'));
// Ints use a copy since there are two possible reference types, but
// the paramter always needs an int64_t.
expect(
@@ -1144,7 +1160,7 @@
expect(
code,
contains(
- 'const auto& an_object_arg = std::any_cast<const ParameterObject&>(std::get<flutter::CustomEncodableValue>(encodable_an_object_arg));'));
+ 'const auto& an_object_arg = std::any_cast<const ParameterObject&>(std::get<CustomEncodableValue>(encodable_an_object_arg));'));
// "Object" requires no extraction at all since it has to use
// EncodableValue directly.
expect(
@@ -1275,28 +1291,28 @@
expect(
code,
contains(
- 'a_bool_arg ? flutter::EncodableValue(*a_bool_arg) : flutter::EncodableValue()'));
+ 'a_bool_arg ? EncodableValue(*a_bool_arg) : EncodableValue()'));
expect(
code,
contains(
- 'an_int_arg ? flutter::EncodableValue(*an_int_arg) : flutter::EncodableValue()'));
+ 'an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue()'));
expect(
code,
contains(
- 'a_string_arg ? flutter::EncodableValue(*a_string_arg) : flutter::EncodableValue()'));
+ 'a_string_arg ? EncodableValue(*a_string_arg) : EncodableValue()'));
expect(
code,
contains(
- 'a_list_arg ? flutter::EncodableValue(*a_list_arg) : flutter::EncodableValue()'));
+ 'a_list_arg ? EncodableValue(*a_list_arg) : EncodableValue()'));
expect(
code,
contains(
- 'a_map_arg ? flutter::EncodableValue(*a_map_arg) : flutter::EncodableValue()'));
+ 'a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue()'));
// Class types use ToEncodableList.
expect(
code,
contains(
- 'an_object_arg ? flutter::EncodableValue(an_object_arg->ToEncodableList()) : flutter::EncodableValue()'));
+ 'an_object_arg ? EncodableValue(an_object_arg->ToEncodableList()) : EncodableValue()'));
}
});
@@ -1411,14 +1427,13 @@
generator.generate(generatorOptions, root, sink);
final String code = sink.toString();
// Standard types are wrapped an EncodableValues.
- expect(code, contains('flutter::EncodableValue(a_bool_arg)'));
- expect(code, contains('flutter::EncodableValue(an_int_arg)'));
- expect(code, contains('flutter::EncodableValue(a_string_arg)'));
- expect(code, contains('flutter::EncodableValue(a_list_arg)'));
- expect(code, contains('flutter::EncodableValue(a_map_arg)'));
+ expect(code, contains('EncodableValue(a_bool_arg)'));
+ expect(code, contains('EncodableValue(an_int_arg)'));
+ expect(code, contains('EncodableValue(a_string_arg)'));
+ expect(code, contains('EncodableValue(a_list_arg)'));
+ expect(code, contains('EncodableValue(a_map_arg)'));
// Class types use ToEncodableList.
- expect(code,
- contains('flutter::EncodableValue(an_object_arg.ToEncodableList())'));
+ expect(code, contains('EncodableValue(an_object_arg.ToEncodableList())'));
}
});
@@ -1452,9 +1467,7 @@
// A bare 'auto' here would create a copy, not a reference, which is
// ineffecient.
expect(
- code,
- contains(
- 'const auto& args = std::get<flutter::EncodableList>(message);'));
+ code, contains('const auto& args = std::get<EncodableList>(message);'));
expect(code, contains('const auto& encodable_an_arg_arg = args.at(0);'));
});
@@ -1732,7 +1745,7 @@
generator.generate(generatorOptions, root, sink);
final String code = sink.toString();
expect(code, isNot(contains('reply(wrap')));
- expect(code, contains('reply(flutter::EncodableValue('));
+ expect(code, contains('reply(EncodableValue('));
});
test('does not keep unowned references in async handlers', () {