Skip to content

Commit

Permalink
Allowing extra include for generated protocol transport message by th…
Browse files Browse the repository at this point in the history
…e commsdsl2tools_qt.
  • Loading branch information
arobenko committed Dec 25, 2024
1 parent e86a393 commit 4e33899
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/commsdsl2tools_qt/src/ToolsQtFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ bool ToolsQtFrame::toolsWriteProtTransportMsgHeaderInternal() const
"\n"
"#pragma once\n\n"
"#^#INCLUDES#$#\n"
"#^#INC#$#\n"
"\n"
"#^#TOP_NS_BEGIN#$#\n"
"#^#NS_BEGIN#$#\n"
Expand All @@ -223,6 +224,7 @@ bool ToolsQtFrame::toolsWriteProtTransportMsgHeaderInternal() const
{"TOP_NS_BEGIN", gen.toolsNamespaceBeginForInterface(*info.first)},
{"TOP_NS_END", gen.toolsNamespaceEndForInterface(*info.first)},
{"INCLUDES", util::strListToString(includes, "\n", "\n")},
{"INC", toolsProtTransportMsgHeaderExtraIncInternal(*info.first)},
{"DEF", toolsProtTransportMsgDefInternal(*info.first)},
};

Expand Down Expand Up @@ -589,6 +591,12 @@ std::string ToolsQtFrame::toolsProtTransportMsgDefInternal(const commsdsl::gen::
return util::processTemplate(Templ, repl);
}

std::string ToolsQtFrame::toolsProtTransportMsgHeaderExtraIncInternal(const commsdsl::gen::Interface& iFace) const
{
auto incFile = generator().getCodeDir() + '/' + toolsRelPathInternal(iFace) + ProtTransportMsgSuffix + strings::cppHeaderSuffixStr() + strings::incFileSuffixStr();
return util::readFileContents(incFile);
}

std::string ToolsQtFrame::toolsProtTransportMsgReadFuncInternal(const commsdsl::gen::Interface& iFace) const
{
std::string readCode;
Expand Down
1 change: 1 addition & 0 deletions app/commsdsl2tools_qt/src/ToolsQtFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class ToolsQtFrame final : public commsdsl::gen::Frame
unsigned toolsCalcBackPayloadOffsetInternal() const;
std::string toolsRelPathInternal(const commsdsl::gen::Interface& iFace) const;
std::string toolsProtTransportMsgDefInternal(const commsdsl::gen::Interface& iFace) const;
std::string toolsProtTransportMsgHeaderExtraIncInternal(const commsdsl::gen::Interface& iFace) const;
std::string toolsProtTransportMsgReadFuncInternal(const commsdsl::gen::Interface& iFace) const;
std::string toolsTransportMsgHeaderDefInternal() const;
std::string toolsTransportMsgSrcDefInternal(const commsdsl::gen::Interface& iFace) const;
Expand Down

0 comments on commit 4e33899

Please sign in to comment.