15 return type.isSameBegining(
"std::list");
24 PString subType(type.substr(9lu));
25 return subType.eraseFirstLastChar(
"<> \t\n");
33 PString restVarName(varType.replace(
"unsigned",
"").eraseChar(
" \n\t*&"));
34 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");
42 if(type ==
"PString" || type ==
"std::string"){
44 }
else if(type ==
"PPath"){
46 }
else if(type ==
"char"){
48 }
else if(type ==
"unsigned char"){
50 }
else if(type ==
"int" || type ==
"short"){
52 }
else if(type ==
"unsigned int" || type ==
"unsigned short"){
54 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t"){
56 }
else if(type ==
"size_t" || type ==
"long unsigned int"){
58 }
else if(type ==
"bool"){
60 }
else if(type ==
"float"){
62 }
else if(type ==
"double"){
74 if(type ==
"PString" || type ==
"std::string"){
75 return "\"Some string\"";
76 }
else if(type ==
"PPath"){
77 return "\"Some/Path\"";
78 }
else if(type ==
"char"){
80 }
else if(type ==
"unsigned char"){
82 }
else if(type ==
"int" || type ==
"short"){
84 }
else if(type ==
"unsigned int" || type ==
"unsigned short"){
86 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t"){
88 }
else if(type ==
"size_t" || type ==
"long unsigned int"){
90 }
else if(type ==
"bool"){
92 }
else if(type ==
"float"){
94 }
else if(type ==
"double"){
109PString
makeVarType(
const PString & varType,
bool isSetter,
bool isConst,
bool isRef,
bool isPtr){
110 PString varTypeName(
"");
113 if(isSimpleType || isPtr){
114 if(isConst && !isSetter && (!isSimpleType || isPtr)){varTypeName +=
"const ";}
115 varTypeName += varType;
116 if(isRef && !isPtr){varTypeName +=
" &";}
118 if(isConst && !isPtr){varTypeName +=
"const ";}
119 varTypeName += varType +
" &";
PString getTestDefaultValueTypeInCpp(const PString &type)
Get the default value of a type in C++.
PString generator_getListNestedType(const PString &type)
Get the nested type inside a std::list.
bool generator_typeIsList(const PString &type)
Say if a given type is a std::list.
PString makeVarType(const PString &varType, bool isSetter, bool isConst, bool isRef, bool isPtr)
Makes the var type by taking account of the type.
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.