18 PString functionDecl(
"void ");
19 if(className !=
"") functionDecl += className +
"::";
20 functionDecl +=
"set" + varName.firstToUpper() +
"(";
21 functionDecl +=
makeVarType(varType,
true,
true,
false, isPtr);
22 functionDecl +=
" " + varName +
")";
43 for(PVecClassAttribute::const_iterator it(vecAttr.begin()); it != vecAttr.end(); ++it){
44 fs <<
"\t\t" <<
setter_createSetterDecl(it->getType(), it->getName(),
"", it->getIsPointer()) <<
";" << std::endl;
57 for(PVecClassAttribute::const_iterator it(listAttr.begin()); it != listAttr.end(); ++it){
58 fs <<
"///Sets the " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
59 fs <<
"/**\t@param " << it->getName() <<
" : " << it->getName() <<
" of the " << classConfig.
getName() << std::endl;
60 fs <<
"*/" << std::endl;
63 fs <<
"\tp_" << it->getName() <<
" = " << it->getName() <<
";" << std::endl;
64 fs <<
"}" << std::endl << std::endl;
PString setter_createSetterDecl(const PString &varType, const PString &varName, const PString &className, bool isPtr)
Creates a function decl for setters.
std::vector< PClassAttribute > PVecClassAttribute
virtual ~CppTraitSetter()
Desctructor of CppTraitSetter.
virtual void publicMethodDeclaration(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Declaration of methods.
CppTraitSetter()
Consctructor of CppTraitSetter.
virtual void publicMethodImplementation(std::ofstream &fs, const PClassConfig &classConfig, const GeneratorMode &mode) const
Implementation of methods.
Class to describe a basic class.
const std::vector< PClassAttribute > & getListAttribute() const
Returns the list of attributes of the class.
const PString & getName() const
Returns the class name.
bool getIsEnum() const
Say if the current PClassConfig is an enum.
PString defTemplate
Template definition for the class header.
PString templateDeclaration
Template declaration of the method implementation.
bool enableSetter
True to enable setters trait generator.
PString makeVarType(const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr)
Makes the var type by taking account of the type.