PhoenixGenerator  3.4.0
Generate code from template files and projects in C++, Rust, Python and wrapped C++ to Python
Loading...
Searching...
No Matches
CppTraitSetter.cpp File Reference
#include "type_utils.h"
#include "CppTraitSetter.h"
Include dependency graph for CppTraitSetter.cpp:

Go to the source code of this file.

Functions

PString setter_createSetterDecl (const PString &varType, const PString &varName, const PString &className, bool isPtr)
 Creates a function decl for setters.

Function Documentation

◆ setter_createSetterDecl()

PString setter_createSetterDecl ( const PString & varType,
const PString & varName,
const PString & className,
bool isPtr )

Creates a function decl for setters.

Parameters
varType: type of the var to set
varName: name of the var to set
className: name of the class
isPtr: true if te variable is a pointer
Returns
setters function decl

Definition at line 18 of file CppTraitSetter.cpp.

18 {
19 PString functionDecl("void ");
20 if(className != "") functionDecl += className + "::";
21 functionDecl += "set" + varName.firstToUpper() + "(";
22 functionDecl += makeVarType(varType, true, true, false, isPtr);
23 functionDecl += " " + varName + ")";
24 return functionDecl;
25}
PString makeVarType(const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr)
Makes the var type by taking account of the type.

References makeVarType(), and setter_createSetterDecl().

Referenced by CppTraitSetter::publicMethodDeclaration(), CppTraitSetter::publicMethodImplementation(), and setter_createSetterDecl().

Here is the call graph for this function:
Here is the caller graph for this function: