mirror of
https://github.com/Kistler-Group/sdbus-cpp.git
synced 2025-07-29 17:47:18 +02:00
fix(codegen): generate correct annotation code (#473)
Before the patch, generating an adaptor from https://gitlab.freedesktop.org/hadess/mpris-spec/-/blob/master/spec/org.mpris.MediaPlayer2.xml would produce incorrect code like this: ``` m_object.addVTable( sdbus::setInterfaceFlags().withPropertyUpdateBehavior(sdbus::Flags::EMITS_CHANGE_SIGNAL); , sdbus::registerMethod("Raise").implementedAs([this](){ return this->Raise(); }) , sdbus::registerMethod("Quit").implementedAs([this](){ return this->Quit(); }) ... ``` With this patch, the code produced is: ``` m_object.addVTable( sdbus::setInterfaceFlags().withPropertyUpdateBehavior(sdbus::Flags::EMITS_CHANGE_SIGNAL) , sdbus::registerMethod("Raise").implementedAs([this](){ return this->Raise(); }) , sdbus::registerMethod("Quit").implementedAs([this](){ return this->Quit(); }) ... ```
This commit is contained in:
@ -121,7 +121,7 @@ std::string AdaptorGenerator::processInterface(Node& interface) const
|
|||||||
if(!annotationRegistration.empty())
|
if(!annotationRegistration.empty())
|
||||||
{
|
{
|
||||||
std::stringstream str;
|
std::stringstream str;
|
||||||
str << "sdbus::setInterfaceFlags()" << annotationRegistration << ";";
|
str << "sdbus::setInterfaceFlags()" << annotationRegistration;
|
||||||
annotationRegistration = str.str();
|
annotationRegistration = str.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user