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"){
76 }
else if(type ==
"PPath"){
78 }
else if(type ==
"char" || type ==
"unsigned char" || type ==
"int" || type ==
"short" || type ==
"unsigned int" || type ==
"unsigned short"){
80 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t" || type ==
"size_t" || type ==
"long unsigned int"){
82 }
else if(type ==
"bool"){
84 }
else if(type ==
"float" || type ==
"double"){
87 return "\"default_value\"";
96 if(type ==
"PString" || type ==
"std::string"){
97 return "\"Some string\"";
98 }
else if(type ==
"PPath"){
99 return "\"Some/Path\"";
100 }
else if(type ==
"char"){
102 }
else if(type ==
"unsigned char"){
104 }
else if(type ==
"int" || type ==
"short"){
106 }
else if(type ==
"unsigned int" || type ==
"unsigned short"){
108 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t"){
110 }
else if(type ==
"size_t" || type ==
"long unsigned int"){
112 }
else if(type ==
"bool"){
114 }
else if(type ==
"float"){
116 }
else if(type ==
"double"){
128 if(type ==
"PString" || type ==
"std::string"){
129 return "\"Some string\"";
130 }
else if(type ==
"PPath"){
131 return "\"Some/Path\"";
132 }
else if(type ==
"char" || type ==
"unsigned char" || type ==
"int" || type ==
"short" || type ==
"unsigned int" || type ==
"unsigned short"){
134 }
else if(type ==
"long int" || type ==
"long" || type ==
"ssize_t" || type ==
"size_t" || type ==
"long unsigned int"){
136 }
else if(type ==
"bool"){
138 }
else if(type ==
"float" || type ==
"double"){
140 }
else if(type.isSameBegining(
"std::vector")){
141 return "[0, 1, 2, 3, 4]";
144 return "\"default_value\"";
156PString
makeVarType(
const PString & varType,
bool isSetter,
bool isConst,
bool isRef,
bool isPtr){
157 PString varTypeName(
"");
160 if(isSimpleType || isPtr){
161 if(isConst && !isSetter && (!isSimpleType || isPtr)){varTypeName +=
"const ";}
162 varTypeName += varType;
163 if(isRef && !isPtr){varTypeName +=
" &";}
165 if(isConst && !isPtr){varTypeName +=
"const ";}
166 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.
PString getDefaultValueTypeInPython(const PString &type)
Get default value for a given type in Python.
bool generator_typeIsList(const PString &type)
Say if a given type is a std::list.
PString getTestDefaultValueTypeInPython(const PString &type)
Get default test value for a given type in Python.
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.