📣 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 947ee71e authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Fix generator

parent 3478814d
......@@ -14,7 +14,7 @@ using namespace std;
///Constructor of PClassGenerator
PClassGenerator::PClassGenerator(){
initialisationPClassGenerator();
}
///Destructor of PClassGenerator
......@@ -27,12 +27,12 @@ PClassGenerator::~PClassGenerator(){
* @return true on success, false otherwise
*/
bool PClassGenerator::saveFileImplDef(const std::string & baseFileName){
string baseToUse("");
if(baseFileName == "") baseToUse = p_className;
else baseToUse = baseFileName;
string includeName(baseToUse + ".h");
string sourceName(baseToUse + ".cpp");
if(p_useTemplate) sourceName = baseToUse + "_impl.h";
std::string baseToUse("");
if(baseFileName == ""){baseToUse = p_className;}
else{baseToUse = baseFileName;}
std::string includeName(baseToUse + ".h");
std::string sourceName(baseToUse + ".cpp");
if(p_useTemplate){sourceName = baseToUse + "_impl.h";}
bool b(saveFileDef(includeName, sourceName));
b &= saveFileImpl(sourceName, includeName);
return b;
......@@ -51,7 +51,7 @@ bool PClassGenerator::saveFileDef(const std::string & fileNameInclude, const std
return false;
}
licenceSave(fs);
string macroDef(makeMultiIncludeDefineMacro(fileNameInclude));
std::string macroDef(makeMultiIncludeDefineMacro(fileNameInclude));
fs << "#ifndef " << macroDef << endl;
fs << "#define " << macroDef << endl << endl << endl;
bool b = saveClassDef(fs);
......@@ -167,7 +167,7 @@ void PClassGenerator::setTemplateDefVar(const std::string & templateDef){
void PClassGenerator::initialisationPClassGenerator(){
p_templateDefVar = "";
p_templateListVar = "";
p_useCopyFunction = false;
p_useCopyFunction = true;
p_useTemplate = false;
p_classTypeName = "";
}
......
......@@ -29,6 +29,7 @@ OptionParser createOptionParser(){
parser.addOption("name", "n", OptionType::FILENAME, true, "base name of the file to be created");
std::string templateDef("");
parser.addOption("template", "t", templateDef, "template definition of the class (ex: 'typename T' or 'typename T, typename U', etc)");
parser.addOption("config", "c", templateDef, "Configuration file to create a class (*.pdata)");
parser.closeMode();
parser.addMode("source");
......
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