code = ReplaceAll(code, "<DELEGATE_PARCEL_WRITE>",
GenDelegateParcelWrite(iface, decl));
+ std::string prefix = GetHandlePrefix();
+ std::transform(prefix.begin(), prefix.end(), prefix.begin(), ::toupper);
+ code = ReplaceAll(code, "<UPPERCASE_PREFIX>", prefix);
+
+ std::string name = iface.GetID();
+ std::transform(name.begin(), name.end(), name.begin(), ::toupper);
+ code = ReplaceAll(code, "<UPPERCASE_NAME>", name);
+
stream << SmartIndent(code);
}
* <DELEGATE_PARAMS_CHECK> The implementation to check whether arguments are nullptr or not
* <DELEGATE_ENUM_VALUE> The enumeration value of the method.
* <DELEGATE_PARCEL_WRITE> The implementation to write arguments to the parcel.
+ * <UPPERCASE_PREFIX> The uppercase prefix of the interface.
+ * <UPPERCASE_NAME> The uppercase name of the interface.
*/
constexpr const char CB_INTERFACE_DELEGATE_BASE[] =
R"__c_cb(
return ret_;
}
- rpc_port_parcel_write_int32(parcel_, <DELEGATE_ENUM_VALUE>);
+ rpc_port_parcel_write_int32(parcel_, <UPPERCASE_PREFIX>_<UPPERCASE_NAME>_METHOD_CALLBACK_);
rpc_port_parcel_write(parcel_, &h->parcelable, h);