17 return (restVarName ==
"char" || restVarName ==
"short" || restVarName ==
"int" || restVarName ==
"float" || restVarName ==
"double" || restVarName ==
"bool" || restVarName ==
"long" || restVarName ==
"longint" || restVarName ==
"size_t" || restVarName ==
"ssize_t" || restVarName ==
"void");
25 if(varType.size() == 0lu){
return false;}
26 return varType.
find(
'*') && varType.back() ==
'*';
34 if(type ==
"PString"){
36 }
else if(type ==
"char"){
38 }
else if(type ==
"unsigned char"){
40 }
else if(type ==
"int" || type ==
"short" || type ==
"unsigned short"){
42 }
else if(type ==
"unsigned int"){
44 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t"){
46 }
else if(type ==
"size_t" || type ==
"long unsigned int"){
48 }
else if(type ==
"bool"){
67 if(isSimpleType || isPtr){
68 if(isConst && !isSetter && (!isSimpleType || isPtr)) varTypeName +=
"const ";
69 varTypeName += varType;
70 if(isRef && !isPtr) varTypeName +=
" &";
72 if(isConst && !isPtr) varTypeName +=
"const ";
73 varTypeName += varType +
" &";
87 if(className !=
"") functionDecl += className +
"::";
89 functionDecl +=
makeVarType(varType,
true,
true,
false, isPtr);
90 functionDecl +=
" " + varName +
")";
104 functionDecl +=
makeVarType(varType,
false, isConst, !isConst, isPtr) +
" ";
105 if(className !=
"") functionDecl += className +
"::";
115 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
116 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
117 fs <<
"\t\t" <<
createSetterDecl(it->getType(), it->getName(),
"", it->getIsPointer()) <<
";" << std::endl;
126 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
127 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
128 fs <<
"\t\t" <<
createGetterDecl(it->getType(), it->getName(),
"",
true, it->getIsPointer()) <<
" const;" << std::endl;
129 fs <<
"\t\t" <<
createGetterDecl(it->getType(), it->getName(),
"",
false, it->getIsPointer()) <<
";" << std::endl;
140 fs <<
"\t\t///Load the current "<<name<<
" with a stream" << std::endl;
141 fs <<
"\t\t/** @param[out] ds : stream to be used" << std::endl;
142 fs <<
"\t\t * @return true on success, false otherwise" << std::endl;
143 fs <<
"\t\t*/" << std::endl;
144 fs <<
"\t\ttemplate<typename Stream, DataStreamMode::DataStreamMode Mode>" << std::endl;
145 fs <<
"\t\tbool readWriteStream(Stream & ds){" << std::endl;
146 fs <<
"\t\t\tbool b(true);" << std::endl;
148 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
149 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
150 fs <<
"\t\t\tb &= DataStream<Stream, Mode, "<<it->getType()<<
" >::data_stream(ds, p_" << it->getName() <<
");" << std::endl;
153 fs <<
"\t\t\treturn b;" << std::endl;
154 fs <<
"\t\t}" << std::endl << std::endl;
163 fs <<
"///@brief Generic "<<name<<
" serialisation/deserialisation, load/save and size function" << std::endl;
164 fs <<
"template<typename Stream, DataStreamMode::DataStreamMode Mode>" << std::endl;
165 fs <<
"struct DataStream<Stream, Mode, "<<name<<
">{" << std::endl;
166 fs <<
"\t///Generic function to load/save/serialise/deserialise "<<name << std::endl;
167 fs <<
"\t/**\t@param data : "<<name<<
" to be used" << std::endl;
168 fs <<
"\t * \t@return true on success, false otherwise" << std::endl;
169 fs <<
"\t*/" << std::endl;
170 fs <<
"\tstatic bool data_stream(Stream & ds, "<<name<<
" & data){" << std::endl;
171 fs <<
"\t\treturn data.readWriteStream<Stream, Mode>(ds);" << std::endl;
172 fs <<
"\t}" << std::endl;
173 fs <<
"};" << std::endl << std::endl;
181 if(listTemplate.size() == 0lu){
return "";}
182 PString templateDef(
"template<");
184 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
185 templateDef += comma;
189 templateDef +=
">\n";
198 PString defTemplate(
"<"), comma(
"");
199 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
200 defTemplate += comma + it->
split(
' ').back();
215 fs <<
"namespace " << name <<
" {\n";
217 fs <<
"\tenum " << name <<
" {\n\t\t";
219 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
220 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
221 if(it->getDocumentation() !=
"") fs <<
"\t\t" << it->getDocumentation() << std::endl;
222 fs << comma << it->getName();
223 if(it->getDefaultValue() !=
""){
224 fs <<
" = " << it->getDefaultValue();
228 fs <<
"\n\t};" << std::endl;
229 fs <<
"}" << std::endl << std::endl;
231 if(enableDataStream){
232 fs <<
"///@brief Generic "<<name <<
" deserialisation, load and size function for a "<<name <<
"::"<<name <<
"" << std::endl;
233 fs <<
"template<typename Stream>" << std::endl;
234 fs <<
"struct DataStream<Stream, DataStreamMode::READ, "<<name <<
"::"<<name <<
">{" << std::endl;
235 fs <<
"\t///Generic function to load/deserialise "<<name <<
"" << std::endl;
236 fs <<
"\t/**\t@param[out] ds : Stream to be used" << std::endl;
237 fs <<
"\t * \t@param data : "<<name <<
" to be loaded" << std::endl;
238 fs <<
"\t * \t@return true on success, false otherwise" << std::endl;
239 fs <<
"\t*/" << std::endl;
240 fs <<
"\tstatic bool data_stream(Stream & ds, "<<name <<
"::"<<name <<
" & data){" << std::endl;
241 fs <<
"\t\tint value(0);" << std::endl;
242 fs <<
"\t\tbool b = DataStream<Stream, DataStreamMode::READ, int>::data_stream(ds, value);" << std::endl;
243 fs <<
"\t\tdata = ("<<name <<
"::"<<name <<
")value;" << std::endl;
244 fs <<
"\t\treturn b;" << std::endl;
245 fs <<
"\t}" << std::endl;
246 fs <<
"};" << std::endl << std::endl;
248 fs <<
"///@brief Generic "<<name <<
" serialisation, save and size function for a "<<name <<
"::"<<name <<
"" << std::endl;
249 fs <<
"template<typename Stream>" << std::endl;
250 fs <<
"struct DataStream<Stream, DataStreamMode::WRITE, "<<name <<
"::"<<name <<
">{" << std::endl;
251 fs <<
"\t///Generic function to save/serialise "<<name <<
"" << std::endl;
252 fs <<
"\t/**\t@param[out] ds : Stream to be used" << std::endl;
253 fs <<
"\t * \t@param data : "<<name <<
" to be saved" << std::endl;
254 fs <<
"\t * \t@return true on success, false otherwise" << std::endl;
255 fs <<
"\t*/" << std::endl;
256 fs <<
"\tstatic bool data_stream(Stream & ds, "<<name <<
"::"<<name <<
" & data){" << std::endl;
257 fs <<
"\t\tint value = (int)data;" << std::endl;
258 fs <<
"\t\treturn DataStream<Stream, DataStreamMode::WRITE, int>::data_stream(ds, value);" << std::endl;
259 fs <<
"\t}" << std::endl;
260 fs <<
"};" << std::endl << std::endl;
262 if(enableTypeStream){
263 fs <<
"///Get the type name of "<<name << std::endl;
264 fs <<
"/**\t@return type name of "<<name <<
" as string" << std::endl;
265 fs <<
"*/" << std::endl;
266 fs <<
"template<>" << std::endl;
267 fs <<
"std::string phoenix_getTypeName<"<<name<<
"::"<<name<<
">(){" << std::endl;
268 fs <<
"\treturn \""<<name<<
"\";" << std::endl;
269 fs <<
"}" << std::endl << std::endl;
283 if(listTemplate.size() != 0lu){
286 fs <<
"class " << name;
289 fs <<
" : public " << *it;
297 fs <<
"{" << std::endl;
298 fs <<
"\tpublic:" << std::endl;
299 fs <<
"\t\t" << name <<
"();" << std::endl;
300 fs <<
"\t\t" << name <<
"(const " << name <<
" & other);" << std::endl;
301 fs <<
"\t\tvirtual ~" << name <<
"();" << std::endl;
302 fs <<
"\t\t" << name <<
" & operator = (const " << name <<
" & other);" << std::endl;
306 if(enableDataStream){
310 fs <<
"\tprotected:" << std::endl;
311 fs <<
"\t\tvoid copy" << name <<
"(const " << name <<
" & other);" << std::endl;
313 fs <<
"\tprivate:" << std::endl;
314 fs <<
"\t\tvoid initialisation" << name <<
"();" << std::endl;
315 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
316 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
317 if(it->getDocumentation() !=
"") fs <<
"\t\t" << it->getDocumentation() << std::endl;
319 fs <<
"\t\t" << it->getType() <<
" p_" << it->getName() <<
";" << std::endl;
321 fs <<
"};" << std::endl << std::endl;
323 if(enableDataStream){
325 fs << std::endl << std::endl;
327 if(enableTypeStream){
328 if(listTemplate.size() != 0lu){
329 fs <<
"///Get the name of the class " << name << std::endl;
330 fs <<
"/**\t@return name of the class " << name << std::endl;
331 fs <<
"*/" << std::endl;
333 fs <<
"std::string phoenix_getTypeName<"<<name <<
getClassDefTemplate(listTemplate) <<
" >(){" << std::endl;
334 fs <<
"\treturn \""<<name<<
"\"";
336 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
337 fs <<
" + phoenix_getTypeToStr<"<<it->
split(
' ').back()<<
">()";
340 fs <<
";" << std::endl;
341 fs <<
"}" << std::endl << std::endl;
344 fs <<
"template<>" << std::endl;
345 fs <<
"std::string phoenix_getTypeName<"<<name<<
">();" << std::endl << std::endl;
358 if(!enableTypeStream){
return;}
360 fs <<
"///Get the name of the class " << name << std::endl;
361 fs <<
"/**\t@return name of the class " << name << std::endl;
362 fs <<
"*/" << std::endl;
364 if(listTemplate.size() == 0lu){
365 fs <<
"template<>" << std::endl;
367 fs << templateDeclaration;
369 fs <<
"std::string phoenix_getTypeName<"<<name << defTemplate <<
" >(){" << std::endl;
370 fs <<
"\treturn \""<<name<<
"\"";
371 if(listTemplate.size() != 0lu){
373 for(PVecString::const_iterator it(listTemplate.begin()); it != listTemplate.end(); ++it){
374 fs <<
" + phoenix_getTypeToStr<"<<it->
split(
' ').back()<<
">()";
378 fs <<
";" << std::endl;
379 fs <<
"}" << std::endl << std::endl;
390 fs <<
"///Constructor of class " << name << std::endl;
391 fs << templateDeclaration;
392 fs << name << defTemplate <<
"::" << name <<
"()";
395 fs << std::endl <<
"\t: " << *it <<
"()";
398 fs <<
", " << *it <<
"()";
404 fs <<
"{" << std::endl;
405 fs <<
"\tinitialisation" << name <<
"();" << std::endl;
406 fs <<
"}" << std::endl << std::endl;
417 fs <<
"///Copy Constructor of class " << name << std::endl;
418 fs <<
"/**\t@param other : " << name <<
" we want ot copy" << std::endl;
419 fs <<
"*/" << std::endl;
420 fs << templateDeclaration;
421 fs << name << defTemplate <<
"::" << name <<
"(const " << name << defTemplate <<
" & other){" << std::endl;
422 fs <<
"\tcopy" << name <<
"(other);" << std::endl;
423 fs <<
"}" << std::endl << std::endl;
434 fs <<
"///Destructor of class " << name << std::endl;
435 fs << templateDeclaration;
436 fs << name << defTemplate <<
"::~" << name <<
"(){" << std::endl;
437 fs <<
"\t" << std::endl;
438 fs <<
"}" << std::endl << std::endl;
449 fs <<
"///Operator = of class " << name << std::endl;
450 fs <<
"/**\t@param other : " << name <<
" we want ot copy" << std::endl;
451 fs <<
" * \t@return copied class " << name << std::endl;
452 fs <<
"*/" << std::endl;
453 fs << templateDeclaration;
454 fs << name << defTemplate <<
" & " << name << defTemplate <<
"::operator =" <<
" (const " << name << defTemplate <<
" & other){" << std::endl;
455 fs <<
"\tcopy" << name <<
"(other);" << std::endl;
456 fs <<
"\treturn *this;" << std::endl;
457 fs <<
"}" << std::endl << std::endl;
467 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
468 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
469 fs <<
"///Sets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
470 fs <<
"/**\t@param " << it->getName() <<
" : " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
471 fs <<
"*/" << std::endl;
472 fs << templateDeclaration;
473 fs <<
createSetterDecl(it->getType(), it->getName(), classConfig.
getName() + defTemplate, it->getIsPointer()) <<
"{" << std::endl;
474 fs <<
"\tp_" << it->getName() <<
" = " << it->getName() <<
";" << std::endl;
475 fs <<
"}" << std::endl << std::endl;
486 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
487 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
488 fs <<
"///Gets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
489 fs <<
"/**\t@return " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
490 fs <<
"*/" << std::endl;
491 fs << templateDeclaration;
492 fs <<
createGetterDecl(it->getType(), it->getName(), classConfig.
getName() + defTemplate,
true, it->getIsPointer()) <<
" const{" << std::endl;
493 fs <<
"\treturn p_" << it->getName() <<
";" << std::endl;
494 fs <<
"}" << std::endl << std::endl;
495 fs <<
"///Gets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
496 fs <<
"/**\t@return " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
497 fs <<
"*/" << std::endl;
498 fs << templateDeclaration;
499 fs <<
createGetterDecl(it->getType(), it->getName(), classConfig.
getName() + defTemplate,
false, it->getIsPointer()) <<
"{" << std::endl;
500 fs <<
"\treturn p_" << it->getName() <<
";" << std::endl;
501 fs <<
"}" << std::endl << std::endl;
513 fs <<
"///Copy Function of class " << name << std::endl;
514 fs <<
"/**\t@param other : " << name <<
" we want ot copy" << std::endl;
515 fs <<
"*/" << std::endl;
516 fs << templateDeclaration;
517 fs <<
"void " << name << defTemplate <<
"::copy" << name <<
"(const " << name << defTemplate <<
" & other){" << std::endl;
518 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
519 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
520 fs <<
"\tp_" << it->getName() <<
" = other.p_" << it->getName() <<
";" << std::endl;
522 fs <<
"}" << std::endl << std::endl;
532 const PString & templateDeclaration)
535 fs <<
"///Initialisation Function of class " << name << std::endl;
536 fs << templateDeclaration;
537 fs <<
"void " << name << defTemplate <<
"::initialisation" << name <<
"(){" << std::endl;
538 const std::vector<PClassAttribute> & listAttr(classConfig.
getListAttribute());
539 for(std::vector<PClassAttribute>::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
540 if(it->getDefaultValue() !=
""){
541 fs <<
"\tp_" << it->getName() <<
" = "<<it->getDefaultValue()<<
";" << std::endl;
543 PString varType(it->getType());
547 fs <<
"\tp_" << it->getName() <<
" = NULL;" << std::endl;
548 }
else if(isSimpleType){
550 if(defaultValue !=
""){
551 fs <<
"\tp_" << it->getName() <<
" = "<<defaultValue<<
";" << std::endl;
553 }
else if(varType ==
"PString"){
554 fs <<
"\tp_" << it->getName() <<
" = \"\";" << std::endl;
558 fs <<
"}" << std::endl << std::endl;
587 bool saveClassDecl(
const std::vector<PClassConfig> & classConfig,
const PPath & headerFile,
const PVecPath & listInclude,
bool enableDataStream,
bool enableTypeStream,
588 const PString & includeTemplate)
590 if(headerFile ==
"")
return false;
592 fs.open(headerFile.c_str());
594 std::cerr <<
"saveClassDecl : can't open file '" << headerFile <<
"'" << std::endl;
599 fs <<
"#ifndef " << macroDef << std::endl;
600 fs <<
"#define " << macroDef << std::endl << std::endl;
601 if(listInclude.size() != 0lu){
602 for(PVecPath::const_iterator it(listInclude.begin()); it != listInclude.end(); ++it){
603 fs <<
"#include " << *it << std::endl;
607 if(enableDataStream){
608 fs <<
"#include \"data_all.h\"" << std::endl << std::endl;
610 if(enableTypeStream){
611 fs <<
"#include \"phoenix_type_stream.h\"" << std::endl << std::endl;
614 for(std::vector<PClassConfig>::const_iterator it(classConfig.begin()); it != classConfig.end(); ++it){
616 saveEnumDecl(fs, *it, enableDataStream, enableTypeStream);
622 if(includeTemplate !=
""){
623 fs <<
"#include \""<<includeTemplate<<
"\"" << std::endl << std::endl;
626 fs << std::endl << std::endl <<
"#endif" << std::endl << std::endl;
638 bool saveClassImpl(
const std::vector<PClassConfig> & classConfig,
const PPath & sourceFile,
const PPath & headerFile,
bool enableTypeStream){
639 if(sourceFile ==
"" || headerFile ==
"")
return false;
641 fs.open(sourceFile.c_str());
643 std::cerr <<
"saveClassImpl : can't open file '" << sourceFile <<
"'" << std::endl;
647 fs << std::endl <<
"#include \"" << headerFile.
getFileName() <<
"\"" << std::endl << std::endl;
648 for(std::vector<PClassConfig>::const_iterator it(classConfig.begin()); it != classConfig.end(); ++it){
649 if(it->getIsEnum()){
continue;}
663 if(listTemplate.size() == 0lu){
return;}
685 if(sourceFile ==
"" || headerFile ==
"")
return false;
687 fs.open(sourceFile.c_str());
689 std::cerr <<
"saveClassTemplate : can't open file '" << sourceFile <<
"'" << std::endl;
694 fs <<
"#ifndef " << macroDef << std::endl;
695 fs <<
"#define " << macroDef << std::endl << std::endl;
696 fs << std::endl <<
"#include \"" << headerFile.
getFileName() <<
"\"" << std::endl << std::endl;
697 for(std::vector<PClassConfig>::const_iterator it(classConfig.begin()); it != classConfig.end(); ++it){
700 fs <<
"\n\n#endif\n\n" << std::endl;
710 void checkClassConfig(
bool & hasSource,
bool & hasTemplate,
const std::vector<PClassConfig> & classConfig){
713 for(std::vector<PClassConfig>::const_iterator it(classConfig.begin()); it != classConfig.end(); ++it){
714 bool isTemplate = it->getListTemplate().size() != 0lu;
715 hasSource |= !isTemplate;
716 hasTemplate |= isTemplate;
728 bool saveClassImplDecl(
const std::vector<PClassConfig> & classConfig,
const PPath & baseFileName,
const PVecPath & listInclude,
bool enableDataStream,
bool enableTypeStream){
729 if(baseFileName ==
"")
return false;
730 bool hasSource(
false), hasTemplate(
false);
732 PPath includeTemplate(
"");
737 if(!
saveClassDecl(classConfig,
PString(baseFileName +
".h"), listInclude, enableDataStream, enableTypeStream, includeTemplate))
return false;
std::vector< PPath > PVecPath
std::vector< PString > PVecString
Class to describe a basic class.
const PString & getClassDocumentation() const
Returns the class documentation.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.
const PVecString & getListTemplate() const
Returns the list of the template of the class.
const PString & getName() const
Returns the class name.
const PVecString & getListParentClass() const
Returns the list of the parents of the class.
Path of a directory or a file.
PPath getFileName() const
Get the name of the file, from last char to /.
PString replace(const PString &pattern, const PString &replaceStr) const
Replace a PString into an other PString.
PString eraseChar(char ch) const
Erase char ch of current string.
std::vector< PString > split(char separator) const
Cut a PString on the given separator char.
bool find(char ch) const
Find a char in a string.
PString firstToUpper() const
Convert first letter of the PString in upper case.
void saveClassGetTypeNameImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration, bool enableTypeStream)
Saves constructor of the class.
void saveClassTemplate(std::ofstream &fs, const PClassConfig &classConfig)
Creates template implementation file.
PString getClassDefTemplate(const PVecString &listTemplate)
Get the template call in the class declaration.
PString createSetterDecl(const PString &varType, const PString &varName, const PString &className, bool isPtr)
Creates a function decl for setters.
void saveClassDataStreamGenericFunction(std::ofstream &fs, const PClassConfig &classConfig)
Creates the method which enable to save/load generated class with any kind of stream/message/file.
void saveClassCopyConstructorImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves copy constructor of the class.
void saveDeclGetters(std::ofstream &fs, const PClassConfig &classConfig)
Creates getters header file.
void saveClassDataStreamMethod(std::ofstream &fs, const PClassConfig &classConfig)
Creates the method which enable to save/load generated class with any kind of stream/message/file.
bool saveClassImplDecl(const std::vector< PClassConfig > &classConfig, const PPath &baseFileName, const PVecPath &listInclude, bool enableDataStream, bool enableTypeStream)
Creates header file.
PString getClassDeclTempalteDef(const PVecString &listTemplate)
Get the template definition in the class declaration.
void saveClassDecl(std::ofstream &fs, const PClassConfig &classConfig, bool enableDataStream, bool enableTypeStream)
Creates header file.
void saveClassGettersImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves the class getters implementation.
void saveClassImpl(std::ofstream &fs, const PClassConfig &classConfig, bool enableTypeStream)
Creates source file.
PString makeVarType(const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr)
Makes the var type by taking account of the type.
void saveClassSettersImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves the class setters implementation.
void saveClassCopyFunctionImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves the copy function of a class.
PString createGetterDecl(const PString &varType, const PString &varName, const PString &className, bool isConst, bool isPtr)
Creates a function decl for setters.
void saveClassConstructorImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves constructor of the class.
bool getIsPointer(const PString &varType)
Check if the given type is a pointer or not.
void saveClassEqualOperatorImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves = operator of the class.
void checkClassConfig(bool &hasSource, bool &hasTemplate, const std::vector< PClassConfig > &classConfig)
Check if the configuration has source or template to determine if the .cpp or _impl....
void saveEnumDecl(std::ofstream &fs, const PClassConfig &classConfig, bool enableDataStream, bool enableTypeStream)
Creates header file.
void saveClassDestructorImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves destructor of the class.
void saveClassInitialisationFunctionImpl(std::ofstream &fs, const PClassConfig &classConfig, const PString &defTemplate, const PString &templateDeclaration)
Saves the copy function of a class.
PString getDefaultValueTypeInCpp(const PString &type)
Get the default value of a type in C++.
bool getIsSimpleType(const PString &varType)
Check if the given type is a simple type.
void saveDeclSetters(std::ofstream &fs, const PClassConfig &classConfig)
Creates setters header file.