summaryrefslogtreecommitdiffstats
path: root/addon/doxyparse/doxyparse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'addon/doxyparse/doxyparse.cpp')
-rw-r--r--addon/doxyparse/doxyparse.cpp66
1 files changed, 28 insertions, 38 deletions
diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp
index 592ac42..59b560f 100644
--- a/addon/doxyparse/doxyparse.cpp
+++ b/addon/doxyparse/doxyparse.cpp
@@ -89,19 +89,19 @@ static bool is_c_code = true;
static void findXRefSymbols(FileDef *fd)
{
// get the interface to a parser that matches the file extension
- ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
+ CodeParserInterface &intf=Doxygen::parserManager->getCodeParser(fd->getDefFileExtension());
// get the programming language from the file name
SrcLangExt lang = getLanguageFromFileName(fd->name());
// reset the parsers state
- pIntf->resetCodeParserState();
+ intf.resetCodeParserState();
// create a new backend object
Doxyparse *parse = new Doxyparse(fd);
// parse the source code
- pIntf->parseCode(*parse, 0, fileToString(fd->absFilePath()), lang, FALSE, 0, fd);
+ intf.parseCode(*parse, 0, fileToString(fd->absFilePath()), lang, FALSE, 0, fd);
// dismiss the object.
delete parse;
@@ -183,28 +183,25 @@ std::string sanitizeString(std::string data) {
return !new_data.isEmpty() ? new_data.data() : "";
}
-std::string argumentData(Argument *argument) {
+std::string argumentData(const Argument &argument) {
std::string data = "";
- if (argument->type != NULL && argument->type.size() > 1)
- data = sanitizeString(argument->type.data());
- else if (argument->name != NULL)
- data = sanitizeString(argument->name.data());
+ if (argument.type.size() > 1)
+ data = sanitizeString(argument.type.data());
+ else if (!argument.name.isEmpty())
+ data = sanitizeString(argument.name.data());
return data;
}
std::string functionSignature(MemberDef* md) {
std::string signature = sanitizeString(md->name().data());
if(md->isFunction()){
- ArgumentList *argList = md->argumentList();
+ const ArgumentList &argList = md->argumentList();
signature += "(";
- if (argList) {
- ArgumentListIterator iterator(*argList);
- Argument * argument = iterator.toFirst();
- if(argument != NULL) {
- signature += argumentData(argument);
- for(++iterator; (argument = iterator.current()); ++iterator) {
- signature += std::string(",") + argumentData(argument);
- }
+ auto it = argList.begin();
+ if(it!=argList.end()) {
+ signature += argumentData(*it);
+ for(++it; it!=argList.end(); ++it) {
+ signature += std::string(",") + argumentData(*it);
}
}
signature += ")";
@@ -255,19 +252,14 @@ void cModule(ClassDef* cd) {
}
}
-static bool checkOverrideArg(ArgumentList *argList, MemberDef *md) {
- ArgumentListIterator iterator(*argList);
- Argument * argument = iterator.toFirst();
-
- if(!md->isFunction() || argList->count() == 0){
- return false;
+static bool checkOverrideArg(const ArgumentList &argList, MemberDef *md) {
+ if(!md->isFunction() || argList.empty()){
+ return false;
}
- if(argument != NULL) {
- for(; (argument = iterator.current()); ++iterator){
- if(md->name() == argument->name) {
- return true;
- }
+ for (const Argument &argument : argList) {
+ if(md->name() == argument.name) {
+ return true;
}
}
@@ -278,17 +270,15 @@ void functionInformation(MemberDef* md) {
std::string temp = "";
int size = md->getEndBodyLine() - md->getStartBodyLine() + 1;
printNumberOfLines(size);
- ArgumentList *argList = md->argumentList();
- if (argList) {
- ArgumentListIterator iterator(*argList);
- Argument * argument = iterator.toFirst();
- if(argument != NULL) {
- temp = argumentData(argument);
+ const ArgumentList &argList = md->argumentList();
+ if (!argList.empty())
+ {
+ temp = argumentData(argList.front());
// TODO: This is a workaround; better not include "void" in argList, in the first place.
- if(temp != "void") {
- printNumberOfArguments(argList->count());
- }
- }
+ if (temp!="void")
+ {
+ printNumberOfArguments(argList.size());
+ }
}
printNumberOfConditionalPaths(md);