Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit d20b8582 authored by Pierre Aubert's avatar Pierre Aubert
Browse files

Fix getter for pointers

parent 16dee4de
......@@ -19,13 +19,15 @@ using namespace std;
* @return var type by taking account of the type
*/
std::string makeVarType(const std::string & varType, bool isSetter, bool isConst, bool isRef){
string varTypeName("");
string restVarName(eraseCharsInStr(replaceStrInStr(varType, "unsigned", ""), " \n\t*&"));
std::string varTypeName("");
std::string restVarName(eraseCharsInStr(replaceStrInStr(varType, "unsigned", ""), " \n\t*&"));
bool isPtr(findInString(varType, '*'));
bool isSimpleType = (restVarName == "char" || restVarName == "short" || restVarName == "int" || restVarName == "float" || restVarName == "double" || restVarName == "bool" || restVarName == "long unsigned int" || restVarName == "size_t" || restVarName == "ssize_t");
std::cerr << "makeVarType : varType = '"<<varType<<"', isSimpleType = " << isSimpleType << ", isPtr = " << isPtr << std::endl;
bool isPtr(findInString(varType, '*') || findInString(varType, '&'));
bool isSimpleType = (restVarName == "char" || restVarName == "short" || restVarName == "int" || restVarName == "float" || restVarName == "double" || restVarName == "bool" || restVarName == "long unsigned int");
if(isSimpleType || isPtr){
if(isConst && !isSetter && !isSimpleType) varTypeName += "const ";
if(isConst && !isSetter && (!isSimpleType || isPtr)) varTypeName += "const ";
varTypeName += varType;
if(isRef && !isPtr) varTypeName += " &";
}else{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment