📣 An issue occured with the embedded container registry on October 25 2021, between 10:30 and 12:10 (UTC+2). Any persisting issues should be reported to CC-IN2P3 Support. 🐛

Commit fdf1c3dd authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Can save found offset in yml file

parent 51bd656f
Pipeline #136568 passed with stages
in 7 minutes and 4 seconds
......@@ -29,6 +29,8 @@ OptionParser createOptionParser(){
parser.addOption("inputraw", "i", OptionType::FILENAME, true, "input file of raw message file");
parser.addOption("inputfull", "f", OptionType::FILENAME, true, "input file of fully decoded messages");
parser.addOption("output", "o", OptionType::FILENAME, false, "output yml file of found offsets");
return parser;
}
......@@ -136,9 +138,10 @@ bool updateAttributeToBeFound(POffsetFinder & finder, PMapDataCol & mapDataCol,
///Create the source from configuration file
/** @param fileInputRaw : input file of raw message file
* @param fileInputFull : input file of fully decoded messages
* @param outputYml : output yml file of found offsets
* @return true on success, false otherwise
*/
bool computeAttributeOffset(const std::string & fileInputRaw, const std::string & fileInputFull){
bool computeAttributeOffset(const std::string & fileInputRaw, const std::string & fileInputFull, const std::string & outputYml){
if(fileInputRaw == "" || fileInputFull == ""){return false;}
POffsetFinder finder;
PMapDataCol mapDataCol;
......@@ -157,6 +160,9 @@ bool computeAttributeOffset(const std::string & fileInputRaw, const std::string
size_t nbMessage(it->second.getTabData().size()/messageSize);
finder.computeOffset(it->second.getTabData().data(), messageSize, nbMessage);
finder.print();
if(outputYml != ""){
finder.saveYml(outputYml);
}
return true;
}
......@@ -166,11 +172,12 @@ int main(int argc, char** argv){
parser.parseArgument(argc, argv);
const OptionMode & defaultMode = parser.getDefaultMode();
std::string fileInputRaw(""), fileInputFull("");
std::string fileInputRaw(""), fileInputFull(""), outputYml("");
defaultMode.getValue(fileInputRaw, "inputraw");
defaultMode.getValue(fileInputFull, "inputfull");
defaultMode.getValue(outputYml, "output");
return computeAttributeOffset(fileInputRaw, fileInputFull) - 1;
return computeAttributeOffset(fileInputRaw, fileInputFull, outputYml) - 1;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment