Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
CTA-LAPP
PHOENIX_LIBS
PhoenixGenerator
Commits
d20b8582
Commit
d20b8582
authored
Dec 03, 2020
by
Pierre Aubert
Browse files
Fix getter for pointers
parent
16dee4de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
src/saveClassConfig.cpp
src/saveClassConfig.cpp
+7
-5
No files found.
src/saveClassConfig.cpp
View file @
d20b8582
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment