Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

Commit

Permalink
removing double quotes from function arguments list
Browse files Browse the repository at this point in the history
Signed-off-by: Igor Ribeiro Barbosa Duarte <[email protected]>
Signed-off-by: Jonathan Moraes <[email protected]>
Signed-off-by: Kleber <[email protected]>
Signed-off-by: leonardork <[email protected]>
Signed-off-by: Marcelo Ferreira <[email protected]>
Signed-off-by: Matheus Miranda <[email protected]>
Signed-off-by: Sabryna de Sousa <[email protected]>
Signed-off-by: VinyPinheiro <[email protected]>
  • Loading branch information
joenio committed Dec 28, 2017
1 parent 36c6d52 commit 2df61e1
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions addon/doxyparse/doxyparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,24 @@ static int isPartOfCStruct(MemberDef * md) {
return is_c_code && md->getClassDef() != NULL;
}

std::string removeDoubleQuotes(std::string data) {
// remove surrounding double quotes
if (data.front() == '"' && data.back() == '"') {
data.erase(0, 1); // first double quote
data.erase(data.size() - 1); // last double quote
}
return data;
}

std::string argumentData(Argument *argument) {
std::string data = "";
if (argument->type != NULL)
data = removeDoubleQuotes(argument->type.data());
else if (argument->name != NULL)
data = removeDoubleQuotes(argument->name.data());
return data;
}

std::string functionSignature(MemberDef* md) {
std::string signature = md->name().data();
if(md->isFunction()){
Expand All @@ -175,15 +193,9 @@ std::string functionSignature(MemberDef* md) {
signature += "(";
Argument * argument = iterator.toFirst();
if(argument != NULL) {
if (argument->type != NULL)
signature += argument->type.data();
else if (argument->name != NULL)
signature += argument->name.data();
signature += argumentData(argument);
for(++iterator; (argument = iterator.current()); ++iterator){
if (argument->type != NULL)
signature += std::string(",") + argument->type.data();
else if (argument->name != NULL)
signature += std::string(",") + argument->name.data();
signature += std::string(",") + argumentData(argument);
}
}
signature += ")";
Expand Down

0 comments on commit 2df61e1

Please sign in to comment.