19 lines
447 B
C++
19 lines
447 B
C++
#include "FastDDSGen.h"
|
|
|
|
bool FastDDSGen::generateFastDDSCode(std::string idlFilePath)
|
|
{
|
|
// 检查IDL文件是否存在
|
|
if (!fs::exists(idlFilePath)) {
|
|
return false;
|
|
}
|
|
|
|
std::string idlDirPath = fs::path(idlFilePath).parent_path().string();
|
|
// 构建fastddsgen命令
|
|
std::string command = "fastddsgen " + idlFilePath + " -replace" + " -d " + idlDirPath;
|
|
|
|
// 执行命令
|
|
int result = std::system(command.c_str());
|
|
|
|
return result == 0;
|
|
}
|