diff options
Diffstat (limited to 'src/doxygen.cpp')
-rw-r--r-- | src/doxygen.cpp | 879 |
1 files changed, 436 insertions, 443 deletions
diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 880a3f4..3850448 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -248,7 +248,7 @@ class Statistics } g_s; -static void addMemberDocs(const Entry *root,MemberDefMutable *md, const char *funcDecl, +static void addMemberDocs(const Entry *root,MemberDefMutable *md, const QCString &funcDecl, const ArgumentList *al,bool over_load,uint64 spec); static void findMember(const Entry *root, const QCString &relates, @@ -309,7 +309,7 @@ static void addRelatedPage(Entry *root) { if (!g.groupname.isEmpty() && (gd=Doxygen::groupLinkedMap->find(g.groupname))) break; } - //printf("---> addRelatedPage() %s gd=%p\n",root->name.data(),gd); + //printf("---> addRelatedPage() %s gd=%p\n",qPrint(root->name),gd); QCString doc; if (root->brief.isEmpty()) { @@ -350,7 +350,7 @@ static void buildGroupListFiltered(const Entry *root,bool additional, bool inclu { GroupDef *gd = Doxygen::groupLinkedMap->find(root->name); //printf("Processing group '%s':'%s' add=%d ext=%d gd=%p\n", - // root->type.data(),root->name.data(),additional,includeExternal,gd); + // qPrint(root->type),qPrint(root->name),additional,includeExternal,gd); if (gd) { @@ -449,7 +449,7 @@ static void organizeSubGroupsFiltered(const Entry *root,bool additional) GroupDef *gd; if ((gd=Doxygen::groupLinkedMap->find(root->name))) { - //printf("adding %s to group %s\n",root->name.data(),gd->name().data()); + //printf("adding %s to group %s\n",qPrint(root->name),qPrint(gd->name())); addGroupToGroups(root,gd); } } @@ -488,7 +488,7 @@ static void buildFileList(const Entry *root) fd=findFileDef(Doxygen::inputNameLinkedMap,fn.left(newIndex) + "/" + root->name,ambig); if (!fd) ambig = save_ambig; } - //printf("**************** root->name=%s fd=%p\n",root->name.data(),fd); + //printf("**************** root->name=%s fd=%p\n",qPrint(root->name),fd); if (fd && !ambig) { //printf("Adding documentation!\n"); @@ -506,13 +506,12 @@ static void buildFileList(const Entry *root) { gd->addFile(fd); fd->makePartOfGroup(gd); - //printf("File %s: in group %s\n",fd->name().data(),s->data()); + //printf("File %s: in group %s\n",qPrint(fd->name()),qPrint(gd->name())); } } } else { - const char *fn = root->fileName.data(); QCString text(4096); text.sprintf("the name '%s' supplied as " "the argument in the \\file statement ", @@ -528,7 +527,7 @@ static void buildFileList(const Entry *root) { text+="is not an input file"; } - warn(fn,root->startLine,"%s", text.data()); + warn(root->fileName,root->startLine,"%s", qPrint(text)); } } for (const auto &e : root->children()) buildFileList(e.get()); @@ -544,7 +543,7 @@ static void addIncludeFile(DefMutable *cd,FileDef *ifd,const Entry *root) ) && root->protection!=Private ) { - //printf(">>>>>> includeFile=%s\n",root->includeFile.data()); + //printf(">>>>>> includeFile=%s\n",qPrint(root->includeFile)); bool local=Config_getBool(FORCE_LOCAL_INCLUDES); QCString includeFile = root->includeFile; @@ -562,7 +561,7 @@ static void addIncludeFile(DefMutable *cd,FileDef *ifd,const Entry *root) bool ambig; FileDef *fd=0; // see if we need to include a verbatim copy of the header file - //printf("root->includeFile=%s\n",root->includeFile.data()); + //printf("root->includeFile=%s\n",qPrint(root->includeFile)); if (!includeFile.isEmpty() && (fd=findFileDef(Doxygen::inputNameLinkedMap,includeFile,ambig))==0 ) @@ -583,7 +582,7 @@ static void addIncludeFile(DefMutable *cd,FileDef *ifd,const Entry *root) { text+="is not an input file"; } - warn(root->fileName,root->startLine, "%s", text.data()); + warn(root->fileName,root->startLine, "%s", qPrint(text)); } else if (includeFile.isEmpty() && ifd && // see if the file extension makes sense @@ -643,7 +642,7 @@ static bool addNamespace(Entry *root,ClassDef *cd) { NamespaceDef *nd=0; QCString nsName = stripAnonymousNamespaceScope(e->name); - //printf("addNameSpace() trying: %s\n",nsName.data()); + //printf("addNameSpace() trying: %s\n",qPrint(nsName)); if (!nsName.isEmpty() && nsName.at(0)!='@' && (nd=getResolvedNamespace(nsName)) ) @@ -665,14 +664,14 @@ static bool addNamespace(Entry *root,ClassDef *cd) static Definition *findScope(Entry *root,int level=0) { if (root==0) return 0; - //printf("start findScope name=%s\n",root->name.data()); + //printf("start findScope name=%s\n",qPrint(root->name)); Definition *result=0; if (root->section&Entry::SCOPE_MASK) { result = findScope(root->parent,level+1); // traverse to the root of the tree if (result) { - //printf("Found %s inside %s at level %d\n",root->name.data(),result->name().data(),level); + //printf("Found %s inside %s at level %d\n",qPrint(root->name),qPrint(result->name()),level); // TODO: look at template arguments result = result->findInnerCompound(root->name); } @@ -680,11 +679,11 @@ static Definition *findScope(Entry *root,int level=0) { // TODO: look at template arguments result = Doxygen::globalScope->findInnerCompound(root->name); - //printf("Found in globalScope %s at level %d\n",result->name().data(),level); + //printf("Found in globalScope %s at level %d\n",qPrint(result->name()),level); } } - //printf("end findScope(%s,%d)=%s\n",root->name.data(), - // level,result==0 ? "<none>" : result->name().data()); + //printf("end findScope(%s,%d)=%s\n",qPrint(root->name), + // level,result==0 ? "<none>" : qPrint(result->name())); return result; } #endif @@ -707,7 +706,7 @@ QCString stripTemplateSpecifiers(const QCString &s) } if (c=='>' && round==0 && count>0) count--; } - //printf("stripTemplateSpecifiers(%s)=%s\n",s.data(),result.data()); + //printf("stripTemplateSpecifiers(%s)=%s\n",qPrint(s),qPrint(result)); return result; } @@ -715,11 +714,11 @@ QCString stripTemplateSpecifiers(const QCString &s) * full qualified name \a name. Creates an artificial scope if the scope is * not found and set the parent/child scope relation if the scope is found. */ -static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt lang,const TagInfo *tagInfo) +static Definition *buildScopeFromQualifiedName(const QCString &name_,SrcLangExt lang,const TagInfo *tagInfo) { QCString name = stripTemplateSpecifiers(name_); int level = name.contains("::"); - //printf("buildScopeFromQualifiedName(%s) level=%d\n",name.data(),level); + //printf("buildScopeFromQualifiedName(%s) level=%d\n",qPrint(name),level); int i=0; int p=0,l; Definition *prevScope=Doxygen::globalScope; @@ -743,7 +742,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt l else if (nd==0 && cd==0 && fullScope.find('<')==-1) // scope is not known and could be a namespace! { // introduce bogus namespace - //printf("++ adding dummy namespace %s to %s tagInfo=%p\n",nsName.data(),prevScope->name().data(),tagInfo); + //printf("++ adding dummy namespace %s to %s tagInfo=%p\n",qPrint(nsName),qPrint(prevScope->name()),tagInfo); NamespaceDefMutable *newNd= toNamespaceDefMutable( Doxygen::namespaceLinkedMap->add(fullScope, @@ -788,7 +787,7 @@ static Definition *buildScopeFromQualifiedName(const QCString name_,SrcLangExt l static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,const QCString &n, FileDef *fileScope,const TagInfo *tagInfo) { - //printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? startScope->name().data() : 0, n.data()); + //printf("<findScopeFromQualifiedName(%s,%s)\n",startScope ? qPrint(startScope->name()) : 0, qPrint(n)); Definition *resultScope=toDefinition(startScope); if (resultScope==0) resultScope=Doxygen::globalScope; QCString scope=stripTemplateSpecifiersFromScope(n,FALSE); @@ -804,7 +803,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co { QCString nestedNameSpecifier = scope.mid(i1,l1); Definition *orgScope = resultScope; - //printf(" nestedNameSpecifier=%s\n",nestedNameSpecifier.data()); + //printf(" nestedNameSpecifier=%s\n",qPrint(nestedNameSpecifier)); resultScope = const_cast<Definition*>(resultScope->findInnerCompound(nestedNameSpecifier)); //printf(" resultScope=%p\n",resultScope); if (resultScope==0) @@ -822,7 +821,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co // for a nested class A::I in used namespace N, we get // N::A::I while looking for A, so we should compare // resultScope->name() against scope.left(i2+l2) - //printf(" -> result=%s scope=%s\n",resultScope->name().data(),scope.data()); + //printf(" -> result=%s scope=%s\n",qPrint(resultScope->name()),qPrint(scope)); if (rightScopeMatch(resultScope->name(),scope.left(i2+l2))) { break; @@ -845,16 +844,16 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co // so use this instead. QCString fqn = QCString(usedName) + scope.right(scope.length()-p); resultScope = buildScopeFromQualifiedName(fqn,startScope->getLanguage(),0); - //printf("Creating scope from fqn=%s result %p\n",fqn.data(),resultScope); + //printf("Creating scope from fqn=%s result %p\n",qPrint(fqn),resultScope); if (resultScope) { - //printf("> Match! resultScope=%s\n",resultScope->name().data()); + //printf("> Match! resultScope=%s\n",qPrint(resultScope->name())); return resultScope; } } } - //printf("> name %s not found in scope %s\n",nestedNameSpecifier.data(),orgScope->name().data()); + //printf("> name %s not found in scope %s\n",qPrint(nestedNameSpecifier),qPrint(orgScope->name())); return 0; } nextFragment: @@ -862,7 +861,7 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co l1=l2; p=i2+l2; } - //printf(">findScopeFromQualifiedName scope %s\n",resultScope->name().data()); + //printf(">findScopeFromQualifiedName scope %s\n",qPrint(resultScope->name())); return resultScope; } @@ -987,7 +986,7 @@ static void addClassToContext(const Entry *root) Debug::print(Debug::Classes,0," Existing class %s!\n",qPrint(cd->name())); //if (cd->templateArguments()==0) //{ - // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,root->scopeSpec.data()); + // //printf("existing ClassDef tempArgList=%p specScope=%s\n",root->tArgList,qPrint(root->scopeSpec)); // cd->setTemplateArguments(tArgList); //} @@ -1033,7 +1032,7 @@ static void addClassToContext(const Entry *root) extractNamespaceName(fullName,className,namespaceName); //printf("New class: fullname %s namespace '%s' name='%s' brief='%s' docs='%s'\n", - // fullName.data(),namespaceName.data(),className.data(),root->brief.data(),root->doc.data()); + // qPrint(fullName),qPrint(namespaceName),qPrint(className),qPrint(root->brief),qPrint(root->doc)); QCString tagName; QCString refFileName; @@ -1063,7 +1062,7 @@ static void addClassToContext(const Entry *root) tArgList = getTemplateArgumentsFromName(fullName,root->tArgLists); } // add class to the list - //printf("ClassDict.insert(%s)\n",fullName.data()); + //printf("ClassDict.insert(%s)\n",qPrint(fullName)); cd = toClassDefMutable( Doxygen::classLinkedMap->add(fullName, std::unique_ptr<ClassDef>( @@ -1081,10 +1080,10 @@ static void addClassToContext(const Entry *root) cd->setArtificial(root->artificial); cd->setClassSpecifier(root->spec); cd->setTypeConstraints(root->typeConstr); - //printf("new ClassDef %s tempArgList=%p specScope=%s\n",fullName.data(),root->tArgList,root->scopeSpec.data()); + //printf("new ClassDef %s tempArgList=%p specScope=%s\n",qPrint(fullName),root->tArgList,qPrint(root->scopeSpec)); - //printf("class %s template args=%s\n",fullName.data(), - // tArgList ? tempArgListToString(tArgList,root->lang).data() : "<none>"); + //printf("class %s template args=%s\n",qPrint(fullName), + // tArgList ? tempArgListToString(tArgList,qPrint(root->lang)) : "<none>"); if (tArgList) { cd->setTemplateArguments(*tArgList); @@ -1123,9 +1122,9 @@ static void addClassToContext(const Entry *root) if (fd && (root->section & Entry::COMPOUND_MASK)) { //printf(">> Inserting class '%s' in file '%s' (root->fileName='%s')\n", - // cd->name().data(), - // fd->name().data(), - // root->fileName.data() + // qPrint(cd->name()), + // qPrint(fd->name()), + // qPrint(root->fileName) // ); cd->setFileDef(fd); fd->insertClass(cd); @@ -1206,7 +1205,7 @@ static void addConceptToContext(const Entry *root) extractNamespaceName(qualifiedName,className,namespaceName); //printf("New concept: fullname %s namespace '%s' name='%s' brief='%s' docs='%s'\n", - // qualifiedName.data(),namespaceName.data(),className.data(),root->brief.data(),root->doc.data()); + // qPrint(qualifiedName),qPrint(namespaceName),qPrint(className),qPrint(root->brief),qPrint(root->doc)); QCString tagName; QCString refFileName; @@ -1224,7 +1223,7 @@ static void addConceptToContext(const Entry *root) } std::unique_ptr<ArgumentList> tArgList = getTemplateArgumentsFromName(qualifiedName,root->tArgLists); // add concept to the list - //printf("ClassDict.insert(%s)\n",fullName.data()); + //printf("ClassDict.insert(%s)\n",qPrint(fullName)); cd = toConceptDefMutable( Doxygen::conceptLinkedMap->add(qualifiedName, std::unique_ptr<ConceptDef>( @@ -1273,9 +1272,9 @@ static void addConceptToContext(const Entry *root) if (fd) { //printf(">> Inserting concept '%s' in file '%s' (root->fileName='%s')\n", - // cd->name().data(), - // fd->name().data(), - // root->fileName.data() + // qPrint(cd->name()), + // qPrint(fd->name()), + // qPrint(root->fileName) // ); cd->setFileDef(fd); fd->insertConcept(cd); @@ -1318,7 +1317,7 @@ static void resolveClassNestingRelations() { ClassAlias(const QCString &name,std::unique_ptr<ClassDef> cd,DefinitionMutable *ctx) : aliasFullName(name),aliasCd(std::move(cd)), aliasContext(ctx) {} - const QCString aliasFullName; + QCString aliasFullName; std::unique_ptr<ClassDef> aliasCd; DefinitionMutable *aliasContext; }; @@ -1329,13 +1328,13 @@ static void resolveClassNestingRelations() if (cd && visitedClasses.find(icd.get())==visitedClasses.end()) { QCString name = stripAnonymousNamespaceScope(icd->name()); - //printf("processing=%s, iteration=%d\n",cd->name().data(),iteration); + //printf("processing=%s, iteration=%d\n",qPrint(cd->name()),iteration); // also add class to the correct structural context Definition *d = findScopeFromQualifiedName(Doxygen::globalScope, name,icd->getFileDef(),0); if (d) { - //printf("****** adding %s to scope %s in iteration %d\n",cd->name().data(),d->name().data(),iteration); + //printf("****** adding %s to scope %s in iteration %d\n",qPrint(cd->name()),qPrint(d->name()),iteration); DefinitionMutable *dm = toDefinitionMutable(d); if (dm) { @@ -1374,7 +1373,7 @@ static void resolveClassNestingRelations() } //else //{ - // printf("****** ignoring %s: scope not (yet) found in iteration %d\n",cd->name().data(),iteration); + // printf("****** ignoring %s: scope not (yet) found in iteration %d\n",qPrint(cd->name()),iteration); //} } } @@ -1396,7 +1395,7 @@ static void resolveClassNestingRelations() if (cd && visitedClasses.find(icd.get())==visitedClasses.end()) { QCString name = stripAnonymousNamespaceScope(cd->name()); - //printf("processing unresolved=%s, iteration=%d\n",cd->name().data(),iteration); + //printf("processing unresolved=%s, iteration=%d\n",qPrint(cd->name()),iteration); /// create the scope artificially // anyway, so we can at least relate scopes properly. Definition *d = buildScopeFromQualifiedName(name,cd->getLanguage(),0); @@ -1413,7 +1412,7 @@ static void resolveClassNestingRelations() cd->setOuterScope(d); warn(cd->getDefFileName(),cd->getDefLine(), "Internal inconsistency: scope for class %s not " - "found!",name.data() + "found!",qPrint(name) ); } } @@ -1429,7 +1428,7 @@ void distributeClassGroupRelations() ClassDefSet visitedClasses; for (const auto &cd : *Doxygen::classLinkedMap) { - //printf("Checking %s\n",cd->name().data()); + //printf("Checking %s\n",qPrint(cd->name())); // distribute the group to nested classes as well if (visitedClasses.find(cd.get())==visitedClasses.end() && !cd->partOfGroups().empty()) { @@ -1440,7 +1439,7 @@ void distributeClassGroupRelations() ClassDefMutable *ncdm = toClassDefMutable(ncd); if (ncdm && ncdm->partOfGroups().empty()) { - //printf(" Adding %s to group '%s'\n",ncd->name().data(), + //printf(" Adding %s to group '%s'\n",qPrint(ncd->name()), // gd->groupTitle()); ncdm->makePartOfGroup(gd); const_cast<GroupDef*>(gd)->addClass(ncdm); @@ -1459,7 +1458,7 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class if (fullName.right(2)=="::") fullName=fullName.left(fullName.length()-2); fullName+="."+fieldName; - //printf("** adding class %s based on %s\n",fullName.data(),templ->name().data()); + //printf("** adding class %s based on %s\n",qPrint(fullName),qPrint(templ->name())); ClassDefMutable *cd = toClassDefMutable( Doxygen::classLinkedMap->add(fullName, std::unique_ptr<ClassDef>( @@ -1503,7 +1502,7 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class { for (const auto &md : *ml) { - //printf(" Member %s type=%s\n",md->name().data(),md->typeString()); + //printf(" Member %s type=%s\n",qPrint(md->name()),md->typeString()); MemberDefMutable *imd = createMemberDef(md->getDefFileName(),md->getDefLine(),md->getDefColumn(), md->typeString(),md->name(),md->argsString(),md->excpString(), md->protection(),md->virtualness(),md->isStatic(),Member, @@ -1541,8 +1540,8 @@ static void processTagLessClasses(const ClassDef *rootCd, ClassDefMutable *tagParentCd, const QCString &prefix,int count) { - //printf("%d: processTagLessClasses %s\n",count,cd->name().data()); - //printf("checking members for %s\n",cd->name().data()); + //printf("%d: processTagLessClasses %s\n",count,qPrint(cd->name())); + //printf("checking members for %s\n",qPrint(cd->name())); if (tagParentCd && !cd->getClasses().empty()) { MemberList *ml = cd->getMemberList(MemberListType_pubAttribs); @@ -1555,19 +1554,19 @@ static void processTagLessClasses(const ClassDef *rootCd, { for (const auto &icd : cd->getClasses()) { - //printf(" member %s: type='%s'\n",md->name().data(),type.data()); - //printf(" comparing '%s'<->'%s'\n",type.data(),icd->name().data()); + //printf(" member %s: type='%s'\n",qPrint(md->name()),qPrint(type)); + //printf(" comparing '%s'<->'%s'\n",qPrint(type),qPrint(icd->name())); if (type.find(icd->name())!=-1) // matching tag less struct/union { QCString name = md->name(); if (md->isAnonymous()) name = "__unnamed" + name.right(name.length()-1)+"__"; if (!prefix.isEmpty()) name.prepend(prefix+"."); - //printf(" found %s for class %s\n",name.data(),cd->name().data()); + //printf(" found %s for class %s\n",qPrint(name),qPrint(cd->name())); ClassDefMutable *ncd = createTagLessInstance(rootCd,icd,name); if (ncd) { processTagLessClasses(rootCd,icd,ncd,name,count+1); - //printf(" addTagged %s to %s\n",ncd->name().data(),tagParentCd->name().data()); + //printf(" addTagged %s to %s\n",qPrint(ncd->name()),qPrint(tagParentCd->name())); ncd->setTagLessReference(icd); // replace tag-less type for generated/original member @@ -1650,7 +1649,7 @@ static void buildNamespaceList(const Entry *root) !root->name.isEmpty() ) { - //printf("** buildNamespaceList(%s)\n",root->name.data()); + //printf("** buildNamespaceList(%s)\n",qPrint(root->name)); QCString fName = root->name; if (root->section==Entry::PACKAGEDOC_SEC) @@ -1661,8 +1660,8 @@ static void buildNamespaceList(const Entry *root) QCString fullName = stripAnonymousNamespaceScope(fName); if (!fullName.isEmpty()) { - //printf("Found namespace %s in %s at line %d\n",root->name.data(), - // root->fileName.data(), root->startLine); + //printf("Found namespace %s in %s at line %d\n",qPrint(root->name), + // qPrint(root->fileName), root->startLine); NamespaceDef *ndi = Doxygen::namespaceLinkedMap->find(fullName); if (ndi) // existing namespace { @@ -1704,7 +1703,7 @@ static void buildNamespaceList(const Entry *root) tagName = tagInfo->tagName; tagFileName = tagInfo->fileName; } - //printf("++ new namespace %s lang=%s tagName=%s\n",fullName.data(),langToString(root->lang).data(),tagName.data()); + //printf("++ new namespace %s lang=%s tagName=%s\n",qPrint(fullName),qPrint(langToString(root->lang)),qPrint(tagName)); // add namespace to the list NamespaceDefMutable *nd = toNamespaceDefMutable( Doxygen::namespaceLinkedMap->add(fullName, @@ -1741,7 +1740,7 @@ static void buildNamespaceList(const Entry *root) // also add namespace to the correct structural context Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,fullName,0,tagInfo); - //printf("adding namespace %s to context %s\n",nd->name().data(),d?d->name().data():"<none>"); + //printf("adding namespace %s to context %s\n",qPrint(nd->name()),d?qPrint(d->name()):"<none>"); if (d==0) // we didn't find anything, create the scope artificially // anyway, so we can at least relate scopes properly. { @@ -1821,7 +1820,7 @@ static void findUsingDirectives(const Entry *root) if (root->section==Entry::USINGDIR_SEC) { //printf("Found using directive %s at line %d of %s\n", - // root->name.data(),root->startLine,root->fileName.data()); + // qPrint(root->name),root->startLine,qPrint(root->fileName)); QCString name=substitute(root->name,".","::"); if (name.right(2)=="::") { @@ -1857,7 +1856,7 @@ static void findUsingDirectives(const Entry *root) QCString scope=scopeOffset>0 ? nsName.left(scopeOffset)+"::" : QCString(); usingNd = getResolvedNamespace(scope+name); - //printf("Trying with scope='%s' usingNd=%p\n",(scope+name).data(),usingNd); + //printf("Trying with scope='%s' usingNd=%p\n",(scope+qPrint(name)),usingNd); if (scopeOffset==0) { scopeOffset=-1; @@ -1895,7 +1894,7 @@ static void findUsingDirectives(const Entry *root) usingNd = findUsedNamespace(fd->getUsedNamespaces(),name); } - //printf("%s -> %s\n",name.data(),usingNd?usingNd->name().data():"<none>"); + //printf("%s -> %s\n",qPrint(name),usingNd?qPrint(usingNd->name()):"<none>"); // add the namespace the correct scope if (usingNd) @@ -1903,18 +1902,18 @@ static void findUsingDirectives(const Entry *root) //printf("using fd=%p nd=%p\n",fd,nd); if (nd) { - //printf("Inside namespace %s\n",nd->name().data()); + //printf("Inside namespace %s\n",qPrint(nd->name())); nd->addUsingDirective(usingNd); } else if (fd) { - //printf("Inside file %s\n",fd->name().data()); + //printf("Inside file %s\n",qPrint(fd->name())); fd->addUsingDirective(usingNd); } } else // unknown namespace, but add it anyway. { - //printf("++ new unknown namespace %s lang=%s\n",name.data(),langToString(root->lang).data()); + //printf("++ new unknown namespace %s lang=%s\n",qPrint(name),qPrint(langToString(root->lang))); // add namespace to the list nd = toNamespaceDefMutable( Doxygen::namespaceLinkedMap->add(name, @@ -1925,7 +1924,7 @@ static void findUsingDirectives(const Entry *root) nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->addSectionsToDefinition(root->anchors); - //printf("** Adding namespace %s hidden=%d\n",name.data(),root->hidden); + //printf("** Adding namespace %s hidden=%d\n",qPrint(name),root->hidden); nd->setHidden(root->hidden); nd->setArtificial(TRUE); nd->setLanguage(root->lang); @@ -1980,7 +1979,7 @@ static void findUsingDeclarations(const Entry *root) ) { //printf("Found using declaration %s at line %d of %s inside section %x\n", - // root->name.data(),root->startLine,root->fileName.data(), + // qPrint(root->name),root->startLine,qPrint(root->fileName), // rootNav->parent()->section()); if (!root->name.isEmpty()) { @@ -2020,7 +2019,7 @@ static void findUsingDeclarations(const Entry *root) usingCd = toClassDefMutable(Doxygen::hiddenClassLinkedMap->find(name)); // check if it is already hidden } - //printf("%s -> %p\n",root->name.data(),usingCd); + //printf("%s -> %p\n",qPrint(root->name),usingCd); if (usingCd==0) // definition not in the input => add an artificial class { Debug::print(Debug::Classes,0," New using class '%s' (sec=0x%08x)! #tArgLists=%d\n", @@ -2046,12 +2045,12 @@ static void findUsingDeclarations(const Entry *root) if (nd) { - //printf("Inside namespace %s\n",nd->name().data()); + //printf("Inside namespace %s\n",qPrint(nd->name())); nd->addUsingDeclaration(usingCd); } else if (fd) { - //printf("Inside file %s\n",fd->name().data()); + //printf("Inside file %s\n",qPrint(fd->name())); fd->addUsingDeclaration(usingCd); } } @@ -2068,14 +2067,14 @@ static void findUsingDeclImports(const Entry *root) ) { //printf("Found using declaration %s inside section %x\n", - // root->name.data(), root->parent()->section); + // qPrint(root->name), root->parent()->section); QCString fullName=removeRedundantWhiteSpace(root->parent()->name); fullName=stripAnonymousNamespaceScope(fullName); fullName=stripTemplateSpecifiersFromScope(fullName); ClassDefMutable *cd = getClassMutable(fullName); if (cd) { - //printf("found class %s\n",cd->name().data()); + //printf("found class %s\n",qPrint(cd->name())); int i=root->name.find("::"); if (i!=-1) { @@ -2085,7 +2084,7 @@ static void findUsingDeclImports(const Entry *root) const ClassDef *bcd = resolver.resolveClass(cd,scope); // todo: file in fileScope parameter if (bcd && bcd!=cd) { - //printf("found class %s memName=%s\n",bcd->name().data(),memName.data()); + //printf("found class %s memName=%s\n",qPrint(bcd->name()),qPrint(memName)); const MemberNameInfoLinkedMap &mnlm=bcd->memberNameInfoLinkedMap(); const MemberNameInfo *mni = mnlm.find(memName); if (mni) @@ -2164,7 +2163,7 @@ static void findIncludedUsingDirectives() { for (const auto &fd : *fn) { - //printf("----- adding using directives for file %s\n",fd->name().data()); + //printf("----- adding using directives for file %s\n",qPrint(fd->name())); fd->addIncludedUsingDirectives(visitedFiles); } } @@ -2252,7 +2251,7 @@ static MemberDef *addVariableToClass( for (const auto &imd : *mn) { //printf("md->getClassDef()=%p cd=%p type=[%s] md->typeString()=[%s]\n", - // md->getClassDef(),cd,type.data(),md->typeString()); + // md->getClassDef(),cd,qPrint(type),md->typeString()); MemberDefMutable *md = toMemberDefMutable(imd.get()); if (md && md->getClassDef()==cd && @@ -2318,7 +2317,7 @@ static MemberDef *addVariableToClass( addMemberToGroups(root,md.get()); md->setBodyDef(root->fileDef()); - //printf(" New member adding to %s (%p)!\n",cd->name().data(),cd); + //printf(" New member adding to %s (%p)!\n",qPrint(cd->name()),cd); cd->insertMember(md.get()); md->setRefItems(root->sli); @@ -2326,7 +2325,7 @@ static MemberDef *addVariableToClass( cd->insertUsedFile(root->fileDef()); root->markAsProcessed(); - //printf(" Adding member=%s\n",md->name().data()); + //printf(" Adding member=%s\n",qPrint(md->name())); // add the member to the global list MemberDef *result = md.get(); mn = Doxygen::memberNameLinkedMap->add(name); @@ -2524,7 +2523,7 @@ static MemberDef *addVariableToFile( // new global variable, enum value or typedef std::unique_ptr<MemberDefMutable> md { createMemberDef( fileName,root->startLine,root->startColumn, - type,name,args,0, + type,name,args,QCString(), root->protection, Normal,root->stat,Member, mtype,!root->tArgLists.empty() ? root->tArgLists.back() : ArgumentList(), root->argList, root->metaData) }; @@ -2638,7 +2637,7 @@ static bool isVarWithConstructor(const Entry *root) int ti; SymbolResolver resolver(fd); - //printf("isVarWithConstructor(%s)\n",rootNav->name().data()); + //printf("isVarWithConstructor(%s)\n",qPrint(rootNav->name())); if (root->parent()->section & Entry::COMPOUND_MASK) { // inside a class result=FALSE; @@ -2731,7 +2730,7 @@ static bool isVarWithConstructor(const Entry *root) if (reg::search(resType,match,idChars) && match.position()==0) // resType starts with identifier { resType=match.str(); - //printf("resType=%s\n",resType.data()); + //printf("resType=%s\n",qPrint(resType)); if (resType=="int" || resType=="long" || resType=="float" || resType=="double" || resType=="char" || resType=="signed" || resType=="const" || resType=="unsigned" || resType=="void") @@ -2745,8 +2744,8 @@ static bool isVarWithConstructor(const Entry *root) } done: - //printf("isVarWithConstructor(%s,%s)=%d\n",rootNav->parent()->name().data(), - // root->type.data(),result); + //printf("isVarWithConstructor(%s,%s)=%d\n",qPrint(rootNav->parent()->name()), + // qPrint(root->type),result); return result; } @@ -2764,7 +2763,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) root->mGrpId, qPrint(root->relates) ); - //printf("root->parent->name=%s\n",root->parent->name.data()); + //printf("root->parent->name=%s\n",qPrint(root->parent->name)); QCString type = root->type; QCString name = root->name; @@ -2788,7 +2787,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) if (j!=std::string::npos) args=sargs.substr(0,j); // extract, e.g '[10]' from '[10])' } //printf("new: type='%s' name='%s' args='%s'\n", - // type.data(),name.data(),args.data()); + // qPrint(type),qPrint(name),qPrint(args)); } else { @@ -2807,7 +2806,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) { type=type.left(type.length()-1); args.prepend(") "); - //printf("type=%s args=%s\n",type.data(),args.data()); + //printf("type=%s args=%s\n",qPrint(type),qPrint(args)); } } } @@ -2948,8 +2947,8 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) } //printf("name='%s' scope=%s scope.right=%s\n", - // name.data(),scope.data(), - // scope.right(scope.length()-si).data()); + // qPrint(name),qPrint(scope), + // qPrint(scope.right(scope.length()-si))); addVariableToClass(root, // entry cd, // class to add member to mtype, // member type @@ -2963,7 +2962,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) } else if (!name.isEmpty()) // global variable { - //printf("Inserting member in global scope %s!\n",scope.data()); + //printf("Inserting member in global scope %s!\n",qPrint(scope)); addVariableToFile(root,mtype,scope,type,name,args,FALSE,/*0,*/0); } @@ -2974,7 +2973,7 @@ static void addVariable(const Entry *root,int isFuncPtr=-1) // If found they are stored in their class or in the global list. static void buildTypedefList(const Entry *root) { - //printf("buildVarList(%s)\n",rootNav->name().data()); + //printf("buildVarList(%s)\n",qPrint(rootNav->name())); if (!root->name.isEmpty() && root->section==Entry::VARIABLE_SEC && root->type.find("typedef ")!=-1 // its a typedef @@ -3027,7 +3026,7 @@ static void buildDictionaryList(const Entry *root) static void buildVarList(const Entry *root) { - //printf("buildVarList(%s) section=%08x\n",rootNav->name().data(),rootNav->section()); + //printf("buildVarList(%s) section=%08x\n",qPrint(rootNav->name()),rootNav->section()); int isFuncPtr=-1; if (!root->name.isEmpty() && (root->type.isEmpty() || g_compoundKeywords.find(root->type.str())==g_compoundKeywords.end()) && @@ -3233,7 +3232,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd, } //printf("root->name='%s; args='%s' root->argList='%s'\n", - // root->name.data(),args.data(),argListToString(root->argList).data() + // qPrint(root->name),qPrint(args),qPrint(argListToString(root->argList)) // ); // adding class member @@ -3327,7 +3326,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd, md->setRefItems(root->sli); // add member to the global list of all members - //printf("Adding member=%s class=%s\n",md->name().data(),cd->name().data()); + //printf("Adding member=%s class=%s\n",qPrint(md->name()),qPrint(cd->name())); MemberName *mn = Doxygen::memberNameLinkedMap->add(name); mn->push_back(std::move(md)); } @@ -3339,7 +3338,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt QCString scope = sc; Debug::print(Debug::Functions,0," --> new function %s found!\n",qPrint(rname)); //printf("New function type='%s' name='%s' args='%s' bodyLine=%d\n", - // root->type.data(),rname.data(),root->args.data(),root->bodyLine); + // qPrint(root->type),qPrint(rname),qPrint(root->args),root->bodyLine); // new global function QCString name=removeRedundantWhiteSpace(rname); @@ -3446,7 +3445,7 @@ static void addGlobalFunction(const Entry *root,const QCString &rname,const QCSt } // add member to the list of file members - //printf("Adding member=%s\n",md->name().data()); + //printf("Adding member=%s\n",qPrint(md->name())); MemberName *mn = Doxygen::functionNameLinkedMap->add(name); mn->push_back(std::move(md)); } @@ -3478,7 +3477,7 @@ static void buildFunctionList(const Entry *root) bool isFriend=root->type.find("friend ")!=-1; QCString rname = removeRedundantWhiteSpace(root->name); - //printf("rname=%s\n",rname.data()); + //printf("rname=%s\n",qPrint(rname)); QCString scope=root->parent()->name; //stripAnonymousNamespaceScope(root->parent->name); if (!rname.isEmpty() && scope.find('@')==-1) @@ -3560,7 +3559,7 @@ static void buildFunctionList(const Entry *root) { const NamespaceDef *mnd = md->getNamespaceDef(); NamespaceDef *rnd = 0; - //printf("root namespace=%s\n",rootNav->parent()->name().data()); + //printf("root namespace=%s\n",qPrint(rootNav->parent()->name())); QCString fullScope = scope; QCString parentScope = root->parent()->name; if (!parentScope.isEmpty() && !leftScopeMatch(parentScope,scope)) @@ -3568,14 +3567,14 @@ static void buildFunctionList(const Entry *root) if (!scope.isEmpty()) fullScope.prepend("::"); fullScope.prepend(parentScope); } - //printf("fullScope=%s\n",fullScope.data()); + //printf("fullScope=%s\n",qPrint(fullScope)); rnd = getResolvedNamespace(fullScope); const FileDef *mfd = md->getFileDef(); QCString nsName,rnsName; - if (mnd) nsName = mnd->name().copy(); - if (rnd) rnsName = rnd->name().copy(); + if (mnd) nsName = mnd->name(); + if (rnd) rnsName = rnd->name(); //printf("matching arguments for %s%s %s%s\n", - // md->name().data(),md->argsString(),rname.data(),argListToString(root->argList).data()); + // qPrint(md->name()),md->argsString(),qPrint(rname),qPrint(argListToString(root->argList))); const ArgumentList &mdAl = md->argumentList(); const ArgumentList &mdTempl = md->templateArguments(); @@ -3619,7 +3618,7 @@ static void buildFunctionList(const Entry *root) gd = Doxygen::groupLinkedMap->find(root->groups.front().groupname); } //printf("match!\n"); - //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,nsName.data(),rnsName.data()); + //printf("mnd=%p rnd=%p nsName=%s rnsName=%s\n",mnd,rnd,qPrint(nsName),qPrint(rnsName)); // see if we need to create a new member found=(mnd && rnd && nsName==rnsName) || // members are in the same namespace ((mnd==0 && rnd==0 && mfd!=0 && // no external reference and @@ -3634,7 +3633,7 @@ static void buildFunctionList(const Entry *root) } //printf("combining function with prototype found=%d in namespace %s\n", - // found,nsName.data()); + // found,qPrint(nsName)); if (found) { @@ -3729,7 +3728,7 @@ static void buildFunctionList(const Entry *root) } //printf("unrelated function %d '%s' '%s' '%s'\n", - // root->parent->section,root->type.data(),rname.data(),root->args.data()); + // root->parent->section,qPrint(root->type),qPrint(rname),qPrint(root->args)); } else { @@ -3931,7 +3930,7 @@ static void transferRelatedFunctionDocumentation() MemberDefMutable *md = toMemberDefMutable(imd.get()); if (md) { - //printf(" Function '%s'\n",md->name().data()); + //printf(" Function '%s'\n",qPrint(md->name())); MemberName *rmn; if ((rmn=Doxygen::memberNameLinkedMap->find(md->name()))) // check if there is a member with the same name { @@ -3949,7 +3948,7 @@ static void transferRelatedFunctionDocumentation() ) ) { - //printf(" Found related member '%s'\n",md->name().data()); + //printf(" Found related member '%s'\n",qPrint(md->name())); if (rmd->relatedAlso()) md->setRelatedAlso(rmd->relatedAlso()); else if (rmd->isForeign()) @@ -3984,7 +3983,7 @@ static TemplateNameMap getTemplateArgumentsInName(const ArgumentList &templateAr { const auto &match = *it; std::string n = match.str(); - if (n==arg.name) + if (n==arg.name.str()) { if (templateNames.find(n)==templateNames.end()) { @@ -4024,10 +4023,10 @@ static ClassDef *findClassWithinClassContext(Definition *context,ClassDef *cd,co } //printf("3. result=%p\n",result); //printf("** Trying to find %s within context %s class %s result=%s lookup=%p\n", - // name.data(), - // context ? context->name().data() : "<none>", - // cd ? cd->name().data() : "<none>", - // result ? result->name().data() : "<none>", + // qPrint(name), + // context ? qPrint(context->name()) : "<none>", + // cd ? qPrint(cd->name()) : "<none>", + // result ? qPrint(result->name()) : "<none>", // Doxygen::classLinkedMap->find(name) // ); return result; @@ -4051,7 +4050,7 @@ static void findUsedClassesForClass(const Entry *root, const MemberDef *md=mi->memberDef(); if (md->isVariable() || md->isObjCProperty()) // for each member variable in this class { - //printf(" Found variable %s in class %s\n",md->name().data(),masterCd->name().data()); + //printf(" Found variable %s in class %s\n",qPrint(md->name()),qPrint(masterCd->name())); QCString type = normalizeNonTemplateArgumentsInString(md->typeString(),masterCd,formalArgs); QCString typedefValue = resolveTypeDef(masterCd,type); if (!typedefValue.isEmpty()) @@ -4063,16 +4062,16 @@ static void findUsedClassesForClass(const Entry *root, QCString templSpec; bool found=FALSE; // the type can contain template variables, replace them if present - type = substituteTemplateArgumentsInString(type.str(),formalArgs,actualArgs); + type = substituteTemplateArgumentsInString(type,formalArgs,actualArgs); - //printf(" template substitution gives=%s\n",type.data()); + //printf(" template substitution gives=%s\n",qPrint(type)); while (!found && extractClassNameFromType(type,pos,usedClassName,templSpec,root->lang)!=-1) { // find the type (if any) that matches usedClassName SymbolResolver resolver(masterCd->getFileDef()); const ClassDefMutable *typeCd = resolver.resolveClassMutable(masterCd,usedClassName,false,true); //printf("====> usedClassName=%s -> typeCd=%s\n", - // usedClassName.data(),typeCd?typeCd->name().data():"<none>"); + // qPrint(usedClassName),typeCd?qPrint(typeCd->name()):"<none>"); if (typeCd) { usedClassName = typeCd->name(); @@ -4088,7 +4087,7 @@ static void findUsedClassesForClass(const Entry *root, } // add any template arguments to the class QCString usedName = removeRedundantWhiteSpace(usedClassName+templSpec); - //printf(" usedName=%s\n",usedName.data()); + //printf(" usedName=%s\n",qPrint(usedName)); TemplateNameMap formTemplateNames; if (templateNames.empty()) @@ -4118,7 +4117,7 @@ static void findUsedClassesForClass(const Entry *root, ClassDef::Class)))); if (usedCdm) { - //printf("making %s a template argument!!!\n",usedCd->name().data()); + //printf("making %s a template argument!!!\n",qPrint(usedCd->name())); usedCdm->makeTemplateArgument(); usedCdm->setUsedOnly(TRUE); usedCdm->setLanguage(masterCd->getLanguage()); @@ -4143,7 +4142,7 @@ static void findUsedClassesForClass(const Entry *root, { ClassDef *usedCd=findClassWithinClassContext(context,masterCd,usedName); //printf("Looking for used class %s: result=%s master=%s\n", - // usedName.data(),usedCd?usedCd->name().data():"<none>",masterCd?masterCd->name().data():"<none>"); + // qPrint(usedName),usedCd?qPrint(usedCd->name()):"<none>",masterCd?qPrint(masterCd->name()):"<none>"); if (usedCd) { @@ -4215,15 +4214,15 @@ static void findBaseClassesForClass( for (const BaseInfo &bi : root->extends) { //printf("masterCd=%s bi.name='%s' #actualArgs=%d\n", - // masterCd->localName().data(),bi.name.data(),actualArgs ? (int)actualArgs->size() : -1); + // qPrint(masterCd->localName()),qPrint(bi.name),actualArgs ? (int)actualArgs->size() : -1); TemplateNameMap formTemplateNames; if (templateNames.empty()) { formTemplateNames = getTemplateArgumentsInName(formalArgs,bi.name.str()); } BaseInfo tbi = bi; - tbi.name = substituteTemplateArgumentsInString(bi.name.str(),formalArgs,actualArgs); - //printf("bi->name=%s tbi.name=%s\n",bi->name.data(),tbi.name.data()); + tbi.name = substituteTemplateArgumentsInString(bi.name,formalArgs,actualArgs); + //printf("bi->name=%s tbi.name=%s\n",qPrint(bi->name),qPrint(tbi.name)); if (mode==DocumentedOnly) { @@ -4258,7 +4257,7 @@ static void findTemplateInstanceRelation(const Entry *root, Debug::print(Debug::Classes,0," derived from template %s with parameters %s isArtificial=%d\n", qPrint(templateClass->name()),qPrint(templSpec),isArtificial); //printf("findTemplateInstanceRelation(base=%s templSpec=%s templateNames=", - // templateClass->name().data(),templSpec.data()); + // qPrint(templateClass->name()),qPrint(templSpec)); //for (const auto &kv : templNames) //{ // printf("(%s->%d) ",kv.first.c_str(),kv.second); @@ -4286,7 +4285,7 @@ static void findTemplateInstanceRelation(const Entry *root, // search for new template instances caused by base classes of // instanceClass - auto it_pair = g_classEntries.equal_range(templateClass->name().data()); + auto it_pair = g_classEntries.equal_range(templateClass->name().str()); for (auto it=it_pair.first ; it!=it_pair.second ; ++it) { const Entry *templateRoot = it->second; @@ -4300,7 +4299,7 @@ static void findTemplateInstanceRelation(const Entry *root, isArtificial,templArgs,templateNames); } - //Debug::print(Debug::Classes,0," Template instance %s : \n",instanceClass->name().data()); + //Debug::print(Debug::Classes,0," Template instance %s : \n",qPrint(instanceClass->name())); //ArgumentList *tl = templateClass->templateArguments(); } else @@ -4401,10 +4400,10 @@ static int findEndOfTemplate(const QCString &s,int startPos) return brCount==0 ? e : -1; } -static int findTemplateSpecializationPosition(const char *name) +static int findTemplateSpecializationPosition(const QCString &name) { - if (name==0 || name[0]=='\0') return 0; - int l = static_cast<int>(strlen(name)); + if (name.isEmpty()) return 0; + int l = static_cast<int>(name.length()); if (name[l-1]=='>') // search backward to find the matching <, allowing nested <...> and strings. { int count=1; @@ -4442,7 +4441,7 @@ static bool findClassRelation( ) { //printf("findClassRelation(class=%s base=%s templateNames=", - // cd->name().data(),bi->name.data()); + // qPrint(cd->name()),qPrint(bi->name)); //for (const auto &kv : templateNames) //{ // printf("(%s->%d) ",kv.first.c_str(),kv.second); @@ -4451,7 +4450,7 @@ static bool findClassRelation( QCString biName=bi->name; bool explicitGlobalScope=FALSE; - //printf("findClassRelation: biName='%s'\n",biName.data()); + //printf("findClassRelation: biName='%s'\n",qPrint(biName)); if (biName.left(2)=="::") // explicit global scope { biName=biName.right(biName.length()-2); @@ -4463,12 +4462,12 @@ static bool findClassRelation( do // for each parent scope, starting with the largest scope // (in case of nested classes) { - QCString scopeName= parentNode ? parentNode->name.data() : ""; + QCString scopeName= parentNode ? parentNode->name : QCString(); int scopeOffset=explicitGlobalScope ? 0 : scopeName.length(); do // try all parent scope prefixes, starting with the largest scope { //printf("scopePrefix='%s' biName='%s'\n", - // scopeName.left(scopeOffset).data(),biName.data()); + // qPrint(scopeName.left(scopeOffset)),qPrint(biName)); QCString baseClassName=biName; if (scopeOffset>0) @@ -4488,12 +4487,12 @@ static bool findClassRelation( const MemberDef *baseClassTypeDef = resolver.getTypedef(); QCString templSpec = resolver.getTemplateSpec(); //printf("baseClassName=%s baseClass=%p cd=%p explicitGlobalScope=%d\n", - // baseClassName.data(),baseClass,cd,explicitGlobalScope); + // qPrint(baseClassName),baseClass,cd,explicitGlobalScope); //printf(" scope='%s' baseClassName='%s' baseClass=%s templSpec=%s\n", - // cd ? cd->name().data():"<none>", - // baseClassName.data(), - // baseClass?baseClass->name().data():"<none>", - // templSpec.data() + // cd ? qPrint(cd->name()):"<none>", + // qPrint(baseClassName), + // baseClass?qPrint(baseClass->name()):"<none>", + // qPrint(templSpec) // ); //if (baseClassName.left(root->name.length())!=root->name || // baseClassName.at(root->name.length())!='<' @@ -4538,7 +4537,7 @@ static bool findClassRelation( ); baseClassTypeDef = resolver.getTypedef(); //printf("baseClass=%p -> baseClass=%s templSpec=%s\n", - // baseClass,baseClassName.data(),templSpec.data()); + // baseClass,qPrint(baseClassName),qPrint(templSpec)); } } else if (baseClass && !templSpec.isEmpty()) // we have a known class, but also @@ -4547,7 +4546,7 @@ static bool findClassRelation( // instance (for instance if a class // derived from a template argument) { - //printf("baseClass=%s templSpec=%s\n",baseClass->name().data(),templSpec.data()); + //printf("baseClass=%s templSpec=%s\n",qPrint(baseClass->name()),qPrint(templSpec)); ClassDefMutable *templClass=getClassMutable(baseClass->name()+templSpec); if (templClass) { @@ -4580,7 +4579,7 @@ static bool findClassRelation( { baseClass=toClassDefMutable(findClassWithinClassContext(context,cd,baseClassName)); //printf("findClassWithinClassContext(%s,%s)=%p\n", - // cd->name().data(),baseClassName.data(),baseClass); + // qPrint(cd->name()),qPrint(baseClassName),baseClass); found = baseClass!=0 && baseClass!=cd; } @@ -4589,7 +4588,7 @@ static bool findClassRelation( { // for PHP the "use A\B as C" construct map class C to A::B, so we lookup // the class name also in the alias mapping. - auto it = Doxygen::namespaceAliasMap.find(baseClassName.data()); + auto it = Doxygen::namespaceAliasMap.find(baseClassName.str()); if (it!=Doxygen::namespaceAliasMap.end()) // see if it is indeed a class. { baseClass=getClassMutable(it->second.c_str()); @@ -4635,7 +4634,7 @@ static bool findClassRelation( if (baseClassTypeDef || cd->isCSharp()) { usedName=biName; - //printf("***** usedName=%s templSpec=%s\n",usedName.data(),templSpec.data()); + //printf("***** usedName=%s templSpec=%s\n",qPrint(usedName),qPrint(templSpec)); } Protection prot = bi->prot; if (Config_getBool(SIP_SUPPORT)) prot=Public; @@ -4650,7 +4649,7 @@ static bool findClassRelation( warn(root->fileName,root->startLine, "Detected potential recursive class relation " "between class %s and base class %s!", - cd->name().data(),baseClass->name().data() + qPrint(cd->name()),qPrint(baseClass->name()) ); } } @@ -4685,7 +4684,7 @@ static bool findClassRelation( { baseClass = toClassDefMutable(Doxygen::classLinkedMap->find(baseClassName)); //printf("*** classDDict->find(%s)=%p biName=%s templSpec=%s\n", - // baseClassName.data(),baseClass,biName.data(),templSpec.data()); + // qPrint(baseClassName),baseClass,qPrint(biName),qPrint(templSpec)); if (baseClass==0) // not found (or alias) { baseClass = toClassDefMutable( @@ -4752,7 +4751,7 @@ static bool findClassRelation( warn(root->fileName,root->startLine, "Detected potential recursive class relation " "between class %s and base class %s!\n", - root->name.data(),baseClassName.data() + qPrint(root->name),qPrint(baseClassName) ); } // for mode==TemplateInstance this case is quite common and @@ -4852,7 +4851,7 @@ static void findInheritedTemplateInstances() ClassDefMutable *cdm = toClassDefMutable(cd); if (cdm) { - //printf("Class %s %zu\n",cd->name().data(),root->extends.size()); + //printf("Class %s %zu\n",qPrint(cd->name()),root->extends.size()); findBaseClassesForClass(root,cd,cdm,cdm,TemplateInstances,FALSE); } } @@ -4905,7 +4904,7 @@ static void computeClassRelations() warn_undoc( root->fileName,root->startLine, "Compound %s is not documented.", - root->name.data() + qPrint(root->name) ); } } @@ -4962,7 +4961,7 @@ static void computeTemplateClassRelations() } } - tbi.name = substituteTemplateArgumentsInString(bi.name.str(),tl,templArgs); + tbi.name = substituteTemplateArgumentsInString(bi.name,tl,templArgs); // find a documented base class in the correct scope if (!findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,DocumentedOnly,FALSE)) { @@ -5058,7 +5057,7 @@ static void addListReferences() addRefItem(xrefItems, name, theTranslator->trPage(TRUE,TRUE), - name,pd->title(),0,0); + name,pd->title(),QCString(),0); } } @@ -5073,7 +5072,7 @@ static void addListReferences() addRefItem(xrefItems, name, theTranslator->trDir(TRUE,TRUE), - name,dd->displayName(),0,0); + name,dd->displayName(),QCString(),0); } } @@ -5093,7 +5092,7 @@ static void generateXRefPages() // over_load is set the standard overload text is added. static void addMemberDocs(const Entry *root, - MemberDefMutable *md, const char *funcDecl, + MemberDefMutable *md, const QCString &funcDecl, const ArgumentList *al, bool over_load, uint64 spec @@ -5101,7 +5100,7 @@ static void addMemberDocs(const Entry *root, { if (md==0) return; //printf("addMemberDocs: '%s'::'%s' '%s' funcDecl='%s' mSpec=%lld\n", - // root->parent()->name.data(),md->name().data(),md->argsString(),funcDecl,spec); + // qPrint(root->parent()->name),qPrint(md->name()),md->argsString(),funcDecl,spec); QCString fDecl=funcDecl; // strip extern specifier fDecl.stripPrefix("extern "); @@ -5178,8 +5177,8 @@ static void addMemberDocs(const Entry *root, } //printf("initializer: '%s'(isEmpty=%d) '%s'(isEmpty=%d)\n", - // md->initializer().data(),md->initializer().isEmpty(), - // root->initializer.data(),root->initializer.isEmpty() + // qPrint(md->initializer()),md->initializer().isEmpty(), + // qPrint(root->initializer),root->initializer.isEmpty() // ); std::string rootInit = root->initializer.str(); if (md->initializer().isEmpty() && !rootInit.empty()) @@ -5227,13 +5226,13 @@ static void addMemberDocs(const Entry *root, root->fileName,root->startLine, "member %s belongs to two different groups. The second " "one found here will be ignored.", - md->name().data() + qPrint(md->name()) ); } } else // set group id { - //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,md->name().data()); + //printf("setMemberGroupId=%d md=%s\n",root->mGrpId,qPrint(md->name())); md->setMemberGroupId(root->mGrpId); } } @@ -5244,7 +5243,7 @@ static void addMemberDocs(const Entry *root, // template list specifier static const ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd, - const char *scopeName) + const QCString &scopeName) { SymbolResolver resolver(fd); const ClassDef *tcd = resolver.resolveClass(nd,scopeName,true,true); @@ -5259,11 +5258,11 @@ static const ClassDef *findClassDefinition(FileDef *fd,NamespaceDef *nd, static bool findGlobalMember(const Entry *root, const QCString &namespaceName, - const char *type, - const char *name, - const char *tempArg, - const char *, - const char *decl, + const QCString &type, + const QCString &name, + const QCString &tempArg, + const QCString &, + const QCString &decl, uint64 spec) { Debug::print(Debug::FindMembers,0, @@ -5339,7 +5338,7 @@ static bool findGlobalMember(const Entry *root, } const FileDef *fd=root->fileDef(); - //printf("File %s\n",fd ? fd->name().data() : "<none>"); + //printf("File %s\n",fd ? qPrint(fd->name()) : "<none>"); LinkedRefMap<const NamespaceDef> nl; if (fd) { @@ -5383,8 +5382,8 @@ static bool findGlobalMember(const Entry *root, } //printf("%s<->%s\n", - // argListToString(md->argumentList()).data(), - // argListToString(root->argList).data()); + // qPrint(argListToString(md->argumentList())), + // qPrint(argListToString(root->argList))); // for static members we also check if the comment block was found in // the same file. This is needed because static members with the same @@ -5403,7 +5402,7 @@ static bool findGlobalMember(const Entry *root, //printf("Comparing return types '%s'<->'%s'\n", // md->typeString(),type); if (md->templateArguments().size()!=root->tArgLists.back().size() || - qstrcmp(md->typeString(),type)!=0 || + md->typeString()!=type || md->requiresClause()!=root->req) { //printf(" ---> no matching\n"); @@ -5437,7 +5436,7 @@ static bool findGlobalMember(const Entry *root, " of file "+md->getDefFileName()+"\n"; } } - warn(root->fileName,root->startLine, "%s", warnMsg.data()); + warn(root->fileName,root->startLine, "%s", qPrint(warnMsg)); } } else // got docs for an undefined member! @@ -5451,7 +5450,7 @@ static bool findGlobalMember(const Entry *root, ) { warn(root->fileName,root->startLine, - "documented symbol '%s' was not declared or defined.",decl + "documented symbol '%s' was not declared or defined.",qPrint(decl) ); } } @@ -5495,7 +5494,7 @@ static QCString substituteTemplatesInString( static const reg::Ex re(R"(\a\w*)"); reg::Iterator it(src,re); reg::Iterator end; - //printf("type=%s\n",sa->type.data()); + //printf("type=%s\n",qPrint(sa->type)); size_t p=0; for (; it!=end ; ++it) // for each word in srcType { @@ -5530,9 +5529,9 @@ static QCString substituteTemplatesInString( ++tdaIt; } //if (tda) printf("tsa=%s|%s tda=%s|%s\n", - // tsa.type.data(),tsa.name.data(), - // tda->type.data(),tda->name.data()); - if (name==tsa.name) + // qPrint(tsa.type),qPrint(tsa.name), + // qPrint(tda->type),qPrint(tda->name)); + if (name==tsa.name.str()) { if (tda && tda->name.isEmpty()) { @@ -5555,9 +5554,9 @@ static QCString substituteTemplatesInString( } //printf(" srcList='%s' dstList='%s faList='%s'\n", - // argListToString(srclali.current()).data(), - // argListToString(dstlali.current()).data(), - // funcTempArgList ? argListToString(funcTempArgList).data() : "<none>"); + // qPrint(argListToString(srclali.current())), + // qPrint(argListToString(dstlali.current())), + // funcTempArgList ? qPrint(argListToString(funcTempArgList)) : "<none>"); ++srcIt; } dst+=name; @@ -5565,7 +5564,7 @@ static QCString substituteTemplatesInString( } dst+=src.substr(p); //printf(" substituteTemplatesInString(%s)=%s\n", - // src.data(),dst.data()); + // qPrint(src),qPrint(dst)); return dst; } @@ -5604,7 +5603,7 @@ static void substituteTemplatesInArgList( srcTempArgLists,dstTempArgLists, src.trailingReturnType().str())); //printf("substituteTemplatesInArgList: replacing %s with %s\n", - // argListToString(src).data(),argListToString(dst).data() + // qPrint(argListToString(src)),qPrint(argListToString(dst)) // ); } @@ -5616,13 +5615,13 @@ static void addLocalObjCMethod(const Entry *root, const QCString &exceptions,const QCString &funcDecl, uint64 spec) { - //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data()); + //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className)); ClassDefMutable *cd=0; if (Config_getBool(EXTRACT_LOCAL_METHODS) && (cd=getClassMutable(scopeName))) { Debug::print(Debug::FindMembers,0,"4. Local objective C method %s\n" " scopeName=%s\n",qPrint(root->name),qPrint(scopeName)); - //printf("Local objective C method '%s' of class '%s' found\n",root->name.data(),cd->name().data()); + //printf("Local objective C method '%s' of class '%s' found\n",qPrint(root->name),qPrint(cd->name())); std::unique_ptr<MemberDefMutable> md { createMemberDef( root->fileName,root->startLine,root->startColumn, funcType,funcName,funcArgs,exceptions, @@ -5700,13 +5699,13 @@ static void addMemberFunction(const Entry *root, qPrint(md->argsString()), qPrint(root->fileName)); //printf("Member %s (member scopeName=%s) (this scopeName=%s) isEnumValue()=%d\n", - // md->name().data(),cd->name().data(),scopeName.data(),md->isEnumValue()); + // qPrint(md->name()),qPrint(cd->name()),qPrint(scopeName),md->isEnumValue()); FileDef *fd=root->fileDef(); NamespaceDef *nd=0; if (!namespaceName.isEmpty()) nd=getResolvedNamespace(namespaceName); - //printf("scopeName %s->%s\n",scopeName.data(), - // stripTemplateSpecifiersFromScope(scopeName,FALSE).data()); + //printf("scopeName %s->%s\n",qPrint(scopeName), + // qPrint(stripTemplateSpecifiersFromScope(scopeName,FALSE))); // if the member we are searching for is an enum value that is part of // a "strong" enum, we need to look into the fields of the enum for a match @@ -5717,7 +5716,7 @@ static void addMemberFunction(const Entry *root, if (className.left(enumNamePos)==cd->name()) { MemberName *enumMn=Doxygen::memberNameLinkedMap->find(enumName); - //printf("enumMn(%s)=%p\n",className.data(),enumMn); + //printf("enumMn(%s)=%p\n",qPrint(className),enumMn); if (enumMn) { for (const auto &emd : *enumMn) @@ -5742,12 +5741,12 @@ static void addMemberFunction(const Entry *root, tcd=cd; } //printf("Looking for %s inside nd=%s result=%p (%s) cd=%p\n", - // scopeName.data(),nd?nd->name().data():"<none>",tcd,tcd?tcd->name().data():"",cd); + // qPrint(scopeName),nd?qPrint(nd->name()):"<none>",tcd,tcd?qPrint(tcd->name()):"",cd); if (cd && tcd==cd) // member's classes match { Debug::print(Debug::FindMembers,0, - "4. class definition %s found\n",cd->name().data()); + "4. class definition %s found\n",qPrint(cd->name())); // get the template parameter lists found at the member declaration ArgumentLists declTemplArgs = cd->getTemplateParameterLists(); @@ -5816,8 +5815,7 @@ static void addMemberFunction(const Entry *root, "5b. Comparing return types '%s'<->'%s' #args %d<->%d\n", qPrint(md->typeString()),qPrint(funcType), md->templateArguments().size(),root->tArgLists.back().size()); - if (md->templateArguments().size()!=root->tArgLists.back().size() || - qstrcmp(memType,funcType)) + if (md->templateArguments().size()!=root->tArgLists.back().size() || memType!=funcType) { //printf(" ---> no matching\n"); matching = FALSE; @@ -5898,7 +5896,7 @@ static void addMemberFunction(const Entry *root, { ClassDefMutable *ccd=md->getClassDefMutable(); MemberDef *cmd=md.get(); - //printf("ccd->name()==%s className=%s\n",ccd->name().data(),className.data()); + //printf("ccd->name()==%s className=%s\n",qPrint(ccd->name()),qPrint(className)); if (ccd!=0 && rightScopeMatch(ccd->name(),className)) { const ArgumentList &templAl = md->templateArguments(); @@ -5960,7 +5958,7 @@ static void addMemberFunction(const Entry *root, warnMsg+='\n'; } - QCString fullFuncDecl=funcDecl.copy(); + QCString fullFuncDecl=funcDecl; if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); warnMsg+=" "; @@ -5984,7 +5982,7 @@ static void addMemberFunction(const Entry *root, warnMsg+='\n'; warnMsg+=" "; } - if (md->typeString()) + if (!md->typeString().isEmpty()) { warnMsg+=md->typeString(); warnMsg+=' '; @@ -5992,8 +5990,7 @@ static void addMemberFunction(const Entry *root, QCString qScope = cd->qualifiedNameWithTemplateParameters(); if (!qScope.isEmpty()) warnMsg+=qScope+"::"+md->name(); - if (md->argsString()) - warnMsg+=md->argsString(); + warnMsg+=md->argsString(); if (noMatchCount>1) { warnMsg+="' at line "+QCString().setNum(md->getDefLine()) + @@ -6006,7 +6003,7 @@ static void addMemberFunction(const Entry *root, } } } - warn_simple(root->fileName,root->startLine,warnMsg); + warn_simple(root->fileName,root->startLine,qPrint(warnMsg)); } } @@ -6042,7 +6039,7 @@ static void addMemberSpecialization(const Entry *root, declMd ? declMd->protection() : root->protection, root->virt,root->stat,Member, mtype,tArgList,root->argList,root->metaData) }; - //printf("new specialized member %s args='%s'\n",md->name().data(),funcArgs.data()); + //printf("new specialized member %s args='%s'\n",qPrint(md->name()),qPrint(funcArgs)); md->setTagInfo(root->tagInfo()); md->setLanguage(root->lang); md->setId(root->id); @@ -6100,7 +6097,7 @@ static void addOverloaded(const Entry *root,MemberName *mn, // new overloaded member function std::unique_ptr<ArgumentList> tArgList = getTemplateArgumentsFromName(cd->name()+"::"+funcName,root->tArgLists); - //printf("new related member %s args='%s'\n",md->name().data(),funcArgs.data()); + //printf("new related member %s args='%s'\n",qPrint(md->name()),qPrint(funcArgs)); std::unique_ptr<MemberDefMutable> md { createMemberDef( root->fileName,root->startLine,root->startColumn, funcType,funcName,funcArgs,exceptions, @@ -6229,17 +6226,17 @@ static void findMember(const Entry *root, " ::","::" ).stripWhiteSpace(); - //printf("funcDecl='%s'\n",funcDecl.data()); + //printf("funcDecl='%s'\n",qPrint(funcDecl)); if (isFriend && funcDecl.left(6)=="class ") { //printf("friend class\n"); funcDecl=funcDecl.right(funcDecl.length()-6); - funcName = funcDecl.copy(); + funcName = funcDecl; } else if (isFriend && funcDecl.left(7)=="struct ") { funcDecl=funcDecl.right(funcDecl.length()-7); - funcName = funcDecl.copy(); + funcName = funcDecl; } else { @@ -6249,14 +6246,14 @@ static void findMember(const Entry *root, ); } //printf("scopeName='%s' funcType='%s' funcName='%s' funcArgs='%s'\n", - // scopeName.data(),funcType.data(),funcName.data(),funcArgs.data()); + // qPrint(scopeName),qPrint(funcType),qPrint(funcName),qPrint(funcArgs)); // the class name can also be a namespace name, we decide this later. // if a related class name is specified and the class name could // not be derived from the function declaration, then use the // related field. //printf("scopeName='%s' className='%s' namespaceName='%s'\n", - // scopeName.data(),className.data(),namespaceName.data()); + // qPrint(scopeName),qPrint(className),qPrint(namespaceName)); if (!relates.isEmpty()) { // related member, prefix user specified scope isRelated=TRUE; @@ -6324,12 +6321,12 @@ static void findMember(const Entry *root, // split scope into a namespace and a class part extractNamespaceName(scopeName,className,namespaceName,TRUE); //printf("scopeName='%s' className='%s' namespaceName='%s'\n", - // scopeName.data(),className.data(),namespaceName.data()); + // qPrint(scopeName),qPrint(className),qPrint(namespaceName)); //namespaceName=removeAnonymousScopes(namespaceName); if (namespaceName.find('@')!=-1) return; // skip stuff in anonymous namespace... - //printf("namespaceName='%s' className='%s'\n",namespaceName.data(),className.data()); + //printf("namespaceName='%s' className='%s'\n",qPrint(namespaceName),qPrint(className)); // merge class and namespace scopes again scopeName.resize(0); if (!namespaceName.isEmpty()) @@ -6352,7 +6349,7 @@ static void findMember(const Entry *root, { scopeName=className; } - //printf("new scope='%s'\n",scopeName.data()); + //printf("new scope='%s'\n",qPrint(scopeName)); QCString tempScopeName=scopeName; ClassDefMutable *cd=getClassMutable(scopeName); @@ -6369,9 +6366,9 @@ static void findMember(const Entry *root, } } //printf("scopeName=%s cd=%p root->tArgLists=%p result=%s\n", - // scopeName.data(),cd,root->tArgLists,tempScopeName.data()); + // qPrint(scopeName),cd,root->tArgLists,qPrint(tempScopeName)); - //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data()); + //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className)); // rebuild the function declaration (needed to get the scope right). if (!scopeName.isEmpty() && !isRelated && !isFriend && !Config_getBool(HIDE_SCOPE_NAMES)) { @@ -6452,7 +6449,7 @@ static void findMember(const Entry *root, if (!funcName.isEmpty()) // function name is valid { Debug::print(Debug::FindMembers,0, - "1. funcName='%s'\n",funcName.data()); + "1. funcName='%s'\n",qPrint(funcName)); // check if 'className' is actually a scoped enum, in which case we need to // process it as a global, see issue #6471 @@ -6512,7 +6509,7 @@ static void findMember(const Entry *root, else { //printf("*** Specialized member %s of unknown scope %s%s found!\n", - // scopeName.data(),funcName.data(),funcArgs.data()); + // qPrint(scopeName),qPrint(funcName),qPrint(funcArgs)); } } else if (overloaded) // check if the function belongs to only one class @@ -6523,11 +6520,11 @@ static void findMember(const Entry *root, { if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec)) { - QCString fullFuncDecl=funcDecl.copy(); + QCString fullFuncDecl=funcDecl; if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); warn(root->fileName,root->startLine, "Cannot determine class for function\n%s", - fullFuncDecl.data() + qPrint(fullFuncDecl) ); } } @@ -6537,7 +6534,7 @@ static void findMember(const Entry *root, Debug::print(Debug::FindMembers,0,"2. related function\n" " scopeName=%s className=%s\n",qPrint(scopeName),qPrint(className)); if (className.isEmpty()) className=relates; - //printf("scopeName='%s' className='%s'\n",scopeName.data(),className.data()); + //printf("scopeName='%s' className='%s'\n",qPrint(scopeName),qPrint(className)); if ((cd=getClassMutable(scopeName))) { bool newMember=TRUE; // assume we have a new member @@ -6588,7 +6585,7 @@ static void findMember(const Entry *root, } if (rmd_found) // member already exists as rmd -> add docs { - //printf("addMemberDocs for related member %s\n",root->name.data()); + //printf("addMemberDocs for related member %s\n",qPrint(root->name)); //rmd->setMemberDefTemplateArguments(root->mtArgList); addMemberDocs(root,rmd_found,funcDecl,0,overloaded,spec); } @@ -6616,7 +6613,7 @@ static void findMember(const Entry *root, funcDecl=funcType + " " + funcName; } - //printf("New related name '%s' '%d'\n",funcName.data(), + //printf("New related name '%s' '%d'\n",qPrint(funcName), // root->argList ? (int)root->argList->count() : -1); // first note that we pass: @@ -6657,7 +6654,7 @@ static void findMember(const Entry *root, md->setTagInfo(root->tagInfo()); //printf("Related member name='%s' decl='%s' bodyLine='%d'\n", - // funcName.data(),funcDecl.data(),root->bodyLine); + // qPrint(funcName),qPrint(funcDecl),root->bodyLine); // try to find the matching line number of the body from the // global function list @@ -6731,18 +6728,18 @@ static void findMember(const Entry *root, { addMemberToGroups(root,md.get()); } - //printf("Adding member=%s\n",md->name().data()); + //printf("Adding member=%s\n",qPrint(md->name())); mn->push_back(std::move(md)); } if (root->relatesType == Duplicate) { if (!findGlobalMember(root,namespaceName,funcType,funcName,funcTempList,funcArgs,funcDecl,spec)) { - QCString fullFuncDecl=funcDecl.copy(); + QCString fullFuncDecl=funcDecl; if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE); warn(root->fileName,root->startLine, "Cannot determine file/namespace for relatedalso function\n%s", - fullFuncDecl.data() + qPrint(fullFuncDecl) ); } } @@ -6752,7 +6749,7 @@ static void findMember(const Entry *root, warn_undoc(root->fileName,root->startLine, "class '%s' for related function '%s' is not " "documented.", - className.data(),funcName.data() + qPrint(className),qPrint(funcName) ); } } @@ -6767,14 +6764,14 @@ static void findMember(const Entry *root, { warn(root->fileName,root->startLine, "class for member '%s' cannot " - "be found.", funcName.data() + "be found.", qPrint(funcName) ); } else if (!className.isEmpty() && !globMem) { warn(root->fileName,root->startLine, "member '%s' of class '%s' cannot be found", - funcName.data(),className.data()); + qPrint(funcName),qPrint(className)); } } } @@ -6791,14 +6788,14 @@ static void findMember(const Entry *root, // find the members corresponding to the different documentation blocks // that are extracted from the sources. -static void filterMemberDocumentation(const Entry *root,const QCString relates) +static void filterMemberDocumentation(const Entry *root,const QCString &relates) { int i=-1,l; Debug::print(Debug::FindMembers,0, "findMemberDocumentation(): root->type='%s' root->inside='%s' root->name='%s' root->args='%s' section=%x root->spec=%lld root->mGrpId=%d\n", qPrint(root->type),qPrint(root->inside),qPrint(root->name),qPrint(root->args),root->section,root->spec,root->mGrpId ); - //printf("root->parent()->name=%s\n",root->parent()->name.data()); + //printf("root->parent()->name=%s\n",qPrint(root->parent()->name)); bool isFunc=TRUE; QCString type = root->type; @@ -6811,7 +6808,7 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates) // fix type and argument args.prepend(type.right(type.length()-i-l)); type=type.left(i+l); - //printf("Results type=%s,name=%s,args=%s\n",type.data(),root->name.data(),args.data()); + //printf("Results type=%s,name=%s,args=%s\n",qPrint(type),qPrint(root->name),qPrint(args)); isFunc=FALSE; } else if ((type.left(8)=="typedef " && args.find('(')!=-1)) @@ -6820,12 +6817,12 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates) isFunc=FALSE; } - //printf("Member %s isFunc=%d\n",root->name.data(),isFunc); + //printf("Member %s isFunc=%d\n",qPrint(root->name),isFunc); if (root->section==Entry::MEMBERDOC_SEC) { //printf("Documentation for inline member '%s' found args='%s'\n", - // root->name.data(),args.data()); - //if (relates.length()) printf(" Relates %s\n",relates.data()); + // qPrint(root->name),qPrint(args)); + //if (relates.length()) printf(" Relates %s\n",qPrint(relates)); if (type.isEmpty()) { findMember(root, @@ -6849,7 +6846,7 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates) } else if (root->section==Entry::OVERLOADDOC_SEC) { - //printf("Overloaded member %s found\n",root->name.data()); + //printf("Overloaded member %s found\n",qPrint(root->name)); findMember(root, relates, type, @@ -6870,9 +6867,9 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates) ) { //printf("Documentation for member '%s' found args='%s' excp='%s'\n", - // root->name.data(),args.data(),root->exception.data()); - //if (relates.length()) printf(" Relates %s\n",relates.data()); - //printf("Inside=%s\n Relates=%s\n",root->inside.data(),relates.data()); + // qPrint(root->name),qPrint(args),qPrint(root->exception)); + //if (relates.length()) printf(" Relates %s\n",qPrint(relates)); + //printf("Inside=%s\n Relates=%s\n",qPrint(root->inside),qPrint(relates)); if (type=="friend class" || type=="friend struct" || type=="friend union") { @@ -6915,8 +6912,8 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates) } else if (root->section==Entry::VARIABLEDOC_SEC) { - //printf("Documentation for variable %s found\n",root->name.data()); - //if (!relates.isEmpty()) printf(" Relates %s\n",relates.data()); + //printf("Documentation for variable %s found\n",qPrint(root->name)); + //if (!relates.isEmpty()) printf(" Relates %s\n",qPrint(relates)); findMember(root, relates, type, @@ -6982,7 +6979,7 @@ static void findObjCMethodDefinitions(const Entry *root) { if (objCMethod->section==Entry::FUNCTION_SEC) { - //Printf(" Found ObjC method definition %s\n",objCMethod->name.data()); + //Printf(" Found ObjC method definition %s\n",qPrint(objCMethod->name)); findMember(objCMethod.get(), objCMethod->relates, objCMethod->type, @@ -7010,7 +7007,7 @@ static void findEnums(const Entry *root) bool isGlobal; bool isRelated=FALSE; bool isMemberOf=FALSE; - //printf("Found enum with name '%s' relates=%s\n",root->name.data(),root->relates.data()); + //printf("Found enum with name '%s' relates=%s\n",qPrint(root->name),qPrint(root->relates)); int i; QCString name; @@ -7041,13 +7038,13 @@ static void findEnums(const Entry *root) if (getClass(root->relates)==0 && !scope.isEmpty()) scope=mergeScopes(scope,root->relates); else - scope=root->relates.copy(); + scope=root->relates; if ((cd=getClassMutable(scope))==0) nd=getResolvedNamespaceMutable(scope); } if (cd && !name.isEmpty()) // found a enum inside a compound { - //printf("Enum '%s'::'%s'\n",cd->name().data(),name.data()); + //printf("Enum '%s'::'%s'\n",qPrint(cd->name()),qPrint(name)); fd=0; mnsd=Doxygen::memberNameLinkedMap; isGlobal=FALSE; @@ -7069,7 +7066,7 @@ static void findEnums(const Entry *root) // new enum type std::unique_ptr<MemberDefMutable> md { createMemberDef( root->fileName,root->startLine,root->startColumn, - 0,name,0,0, + QCString(),name,QCString(),QCString(), root->protection,Normal,FALSE, isMemberOf ? Foreign : isRelated ? Related : Member, MemberType_Enumeration, @@ -7083,16 +7080,16 @@ static void findEnums(const Entry *root) md->setMemberSpecifiers(root->spec); md->setEnumBaseType(root->args); //printf("Enum %s definition at line %d of %s: protection=%d scope=%s\n", - // root->name.data(),root->bodyLine,root->fileName.data(),root->protection,cd?cd->name().data():"<none>"); + // qPrint(root->name),root->bodyLine,qPrint(root->fileName),root->protection,cd?qPrint(cd->name()):"<none>"); md->addSectionsToDefinition(root->anchors); md->setMemberGroupId(root->mGrpId); md->enableCallGraph(root->callGraph); md->enableCallerGraph(root->callerGraph); md->enableReferencedByRelation(root->referencedByRelation); md->enableReferencesRelation(root->referencesRelation); - //printf("%s::setRefItems(%zu)\n",md->name().data(),root->sli.size()); + //printf("%s::setRefItems(%zu)\n",qPrint(md->name()),root->sli.size()); md->setRefItems(root->sli); - //printf("found enum %s nd=%p\n",md->name().data(),nd); + //printf("found enum %s nd=%p\n",qPrint(md->name()),nd); bool defSet=FALSE; QCString baseType = root->args; @@ -7151,7 +7148,7 @@ static void findEnums(const Entry *root) md->setBriefDescription(root->brief,root->briefFile,root->briefLine); md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); - //printf("Adding member=%s\n",md->name().data()); + //printf("Adding member=%s\n",qPrint(md->name())); addMemberToGroups(root,md.get()); MemberName *mn = mnsd->add(name); @@ -7177,7 +7174,7 @@ static void addEnumValuesToEnums(const Entry *root) MemberNameLinkedMap *mnsd=0; bool isGlobal; bool isRelated=FALSE; - //printf("Found enum with name '%s' relates=%s\n",root->name.data(),root->relates.data()); + //printf("Found enum with name '%s' relates=%s\n",qPrint(root->name),qPrint(root->relates)); int i; QCString name; @@ -7207,34 +7204,34 @@ static void addEnumValuesToEnums(const Entry *root) if (getClassMutable(root->relates)==0 && !scope.isEmpty()) scope=mergeScopes(scope,root->relates); else - scope=root->relates.copy(); + scope=root->relates; if ((cd=getClassMutable(scope))==0) nd=getResolvedNamespaceMutable(scope); } if (cd && !name.isEmpty()) // found a enum inside a compound { - //printf("Enum in class '%s'::'%s'\n",cd->name().data(),name.data()); + //printf("Enum in class '%s'::'%s'\n",qPrint(cd->name()),qPrint(name)); fd=0; mnsd=Doxygen::memberNameLinkedMap; isGlobal=FALSE; } else if (nd && !nd->isAnonymous()) // found enum inside namespace { - //printf("Enum in namespace '%s'::'%s'\n",nd->name().data(),name.data()); + //printf("Enum in namespace '%s'::'%s'\n",qPrint(nd->name()),qPrint(name)); mnsd=Doxygen::functionNameLinkedMap; isGlobal=TRUE; } else // found a global enum { fd=root->fileDef(); - //printf("Enum in file '%s': '%s'\n",fd->name().data(),name.data()); + //printf("Enum in file '%s': '%s'\n",qPrint(fd->name()),qPrint(name)); mnsd=Doxygen::functionNameLinkedMap; isGlobal=TRUE; } if (!name.isEmpty()) { - //printf("** name=%s\n",name.data()); + //printf("** name=%s\n",qPrint(name)); MemberName *mn = mnsd->find(name); // for all members with this name if (mn) { @@ -7268,7 +7265,7 @@ static void addEnumValuesToEnums(const Entry *root) // values are only visible inside the enum scope, so we must create // them here and only add them to the enum //printf("md->qualifiedName()=%s e->name=%s tagInfo=%p name=%s\n", - // md->qualifiedName().data(),e->name.data(),e->tagInfo,e->name.data()); + // qPrint(md->qualifiedName()),qPrint(e->name),e->tagInfo,qPrint(e->name)); QCString qualifiedName = substitute(root->name,"::","."); if (!scope.isEmpty() && root->tagInfo()) { @@ -7285,7 +7282,7 @@ static void addEnumValuesToEnums(const Entry *root) } std::unique_ptr<MemberDefMutable> fmd { createMemberDef( fileName,e->startLine,e->startColumn, - e->type,e->name,e->args,0, + e->type,e->name,e->args,QCString(), e->protection, Normal,e->stat,Member, MemberType_EnumValue,ArgumentList(),ArgumentList(),e->metaData) }; const NamespaceDef *mnd = md->getNamespaceDef(); @@ -7316,7 +7313,7 @@ static void addEnumValuesToEnums(const Entry *root) } else { - //printf("e->name=%s isRelated=%d\n",e->name.data(),isRelated); + //printf("e->name=%s isRelated=%d\n",qPrint(e->name),isRelated); MemberName *fmn=0; MemberNameLinkedMap *emnsd = isRelated ? Doxygen::functionNameLinkedMap : mnsd; if (!e->name.isEmpty() && (fmn=emnsd->find(e->name))) @@ -7328,7 +7325,7 @@ static void addEnumValuesToEnums(const Entry *root) if (fmd && fmd->isEnumValue() && fmd->getOuterScope()==md->getOuterScope()) // in same scope { //printf("found enum value with same name %s in scope %s\n", - // fmd->name().data(),fmd->getOuterScope()->name().data()); + // qPrint(fmd->name()),qPrint(fmd->getOuterScope()->name())); if (nd && !nd->isAnonymous()) { const NamespaceDef *fnd=fmd->getNamespaceDef(); @@ -7363,7 +7360,7 @@ static void addEnumValuesToEnums(const Entry *root) if (fcd==cd) // enum value is inside a class { //printf("Inserting enum field %s in enum scope %s\n", - // fmd->name().data(),md->name().data()); + // qPrint(fmd->name()),qPrint(md->name())); md->insertEnumField(fmd); // add field def to list fmd->setEnumScope(md); // cross ref with enum name } @@ -7406,7 +7403,7 @@ static void addEnumDocs(const Entry *root,MemberDefMutable *md) md->setBriefDescription(root->brief,root->briefFile,root->briefLine); } - if (!md->inbodyDocumentation() || !root->parent()->name.isEmpty()) + if (md->inbodyDocumentation().isEmpty() || !root->parent()->name.isEmpty()) { md->setInbodyDocumentation(root->inbodyDocs,root->inbodyFile,root->inbodyLine); } @@ -7444,7 +7441,7 @@ static void findEnumDocumentation(const Entry *root) { name=root->name.right(root->name.length()-i-2); // extract name scope=root->name.left(i); // extract scope - //printf("Scope='%s' Name='%s'\n",scope.data(),name.data()); + //printf("Scope='%s' Name='%s'\n",qPrint(scope),qPrint(name)); } else // just the name { @@ -7461,10 +7458,10 @@ static void findEnumDocumentation(const Entry *root) const NamespaceDef *nd=Doxygen::namespaceLinkedMap->find(scope); const FileDef *fd = root->fileDef(); Debug::print(Debug::FindMembers,0,"1. Found docs for enum with name '%s' and scope '%s' in context %s cd=%s, nd=%s fd=%s\n", - name.data(),scope.data(),root->parent()->name.data(), - cd?cd->name().data():"<none>", - nd?nd->name().data():"<none>", - fd?fd->name().data():"<none>"); + qPrint(name),qPrint(scope),qPrint(root->parent()->name), + cd?qPrint(cd->name()):"<none>", + nd?qPrint(nd->name()):"<none>", + fd?qPrint(fd->name()):"<none>"); if (!name.isEmpty()) { @@ -7516,7 +7513,7 @@ static void findEnumDocumentation(const Entry *root) { warn(root->fileName,root->startLine, "Documentation for undefined enum '%s' found.", - name.data() + qPrint(name) ); } } @@ -7649,8 +7646,8 @@ static void computeMemberRelations() { const ClassDef *bmcd = bmd->getClassDef(); //printf("Check relation between '%s'::'%s' (%p) and '%s'::'%s' (%p)\n", - // mcd->name().data(),md->name().data(),md.get(), - // bmcd->name().data(),bmd->name().data(),bmd.get() + // qPrint(mcd->name()),qPrint(md->name()),md.get(), + // qPrint(bmcd->name()),qPrint(bmd->name()),bmd.get() // ); if (bmcd && mcd && bmcd!=mcd && (bmd->virtualness()!=Normal || @@ -7666,8 +7663,8 @@ static void computeMemberRelations() const ArgumentList &bmdAl = bmd->argumentList(); const ArgumentList &mdAl = md->argumentList(); //printf(" Base argList='%s'\n Super argList='%s'\n", - // argListToString(bmdAl).data(), - // argListToString(mdAl).data() + // qPrint(argListToString(bmdAl)), + // qPrint(argListToString(mdAl)) // ); if ( matchArguments2(bmd->getOuterScope(),bmd->getFileDef(),&bmdAl, @@ -7683,7 +7680,7 @@ static void computeMemberRelations() //printf("setting (new) reimplements member\n"); md->setReimplements(bmd); } - //printf("%s: add reimplementedBy member %s\n",bmcd->name().data(),mcd->name().data()); + //printf("%s: add reimplementedBy member %s\n",qPrint(bmcd->name()),qPrint(mcd->name())); bmd->insertReimplementedBy(md); } else @@ -7733,7 +7730,7 @@ static void mergeCategories() if (baseClass) { //printf("*** merging members of category %s into %s\n", - // cd->name().data(),baseClass->name().data()); + // qPrint(cd->name()),qPrint(baseClass->name())); baseClass->mergeCategory(cd.get()); } } @@ -7754,7 +7751,7 @@ static void buildCompleteMemberLists() ClassDefMutable *cdm = toClassDefMutable(cd.get()); if (cdm) { - //printf("*** merging members for %s\n",cd->name().data()); + //printf("*** merging members for %s\n",qPrint(cd->name())); cdm->mergeMembers(); } } @@ -7805,7 +7802,7 @@ static void generateFileSources() auto clangParser = ClangParser::instance()->createTUParser(fd.get()); if (fd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { - msg("Generating code for file %s...\n",fd->docName().data()); + msg("Generating code for file %s...\n",qPrint(fd->docName())); clangParser->parse(); fd->writeSourceHeader(*g_outputList); fd->writeSourceBody(*g_outputList,clangParser.get()); @@ -7814,7 +7811,7 @@ static void generateFileSources() else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { - msg("Parsing code for file %s...\n",fd->docName().data()); + msg("Parsing code for file %s...\n",qPrint(fd->docName())); clangParser->parse(); fd->parseSource(clangParser.get()); } @@ -7822,7 +7819,7 @@ static void generateFileSources() for (auto incFile : clangParser->filesInSameTU()) { if (filesToProcess.find(incFile)!=filesToProcess.end() && // part of input - fd->absFilePath()!=incFile && // not same file + fd->absFilePath()!=QCString(incFile) && // not same file processedFiles.find(incFile)==processedFiles.end()) // not yet marked as processed { StringVector moreFiles; @@ -7832,7 +7829,7 @@ static void generateFileSources() { if (ifd->generateSourceFile() && !g_useOutputTemplate) // sources need to be shown in the output { - msg(" Generating code for file %s...\n",ifd->docName().data()); + msg(" Generating code for file %s...\n",qPrint(ifd->docName())); ifd->writeSourceHeader(*g_outputList); ifd->writeSourceBody(*g_outputList,clangParser.get()); ifd->writeSourceFooter(*g_outputList); @@ -7840,7 +7837,7 @@ static void generateFileSources() else if (!ifd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { - msg(" Parsing code for file %s...\n",ifd->docName().data()); + msg(" Parsing code for file %s...\n",qPrint(ifd->docName())); ifd->parseSource(clangParser.get()); } processedFiles.insert(incFile); @@ -7861,7 +7858,7 @@ static void generateFileSources() if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output { auto clangParser = ClangParser::instance()->createTUParser(fd.get()); - msg("Generating code for file %s...\n",fd->docName().data()); + msg("Generating code for file %s...\n",qPrint(fd->docName())); clangParser->parse(); fd->writeSourceHeader(*g_outputList); fd->writeSourceBody(*g_outputList,clangParser.get()); @@ -7871,7 +7868,7 @@ static void generateFileSources() // we needed to parse the sources even if we do not show them { auto clangParser = ClangParser::instance()->createTUParser(fd.get()); - msg("Parsing code for file %s...\n",fd->docName().data()); + msg("Parsing code for file %s...\n",qPrint(fd->docName())); clangParser->parse(); fd->writeSourceHeader(*g_outputList); fd->writeSourceBody(*g_outputList,clangParser.get()); @@ -7910,12 +7907,12 @@ static void generateFileSources() auto ctx = std::make_shared<SourceContext>(fd.get(),generateSourceFile,*g_outputList); if (generateSourceFile) { - msg("Generating code for file %s...\n",fd->docName().data()); + msg("Generating code for file %s...\n",qPrint(fd->docName())); fd->writeSourceHeader(ctx->ol); } else { - msg("Parsing code for file %s...\n",fd->docName().data()); + msg("Parsing code for file %s...\n",qPrint(fd->docName())); } auto processFile = [ctx]() { StringVector filesInSameTu; @@ -7951,7 +7948,7 @@ static void generateFileSources() fd->getAllIncludeFilesRecursively(filesInSameTu); if (fd->generateSourceFile() && !Htags::useHtags && !g_useOutputTemplate) // sources need to be shown in the output { - msg("Generating code for file %s...\n",fd->docName().data()); + msg("Generating code for file %s...\n",qPrint(fd->docName())); fd->writeSourceHeader(*g_outputList); fd->writeSourceBody(*g_outputList,nullptr); fd->writeSourceFooter(*g_outputList); @@ -7959,7 +7956,7 @@ static void generateFileSources() else if (!fd->isReference() && Doxygen::parseSourcesNeeded) // we needed to parse the sources even if we do not show them { - msg("Parsing code for file %s...\n",fd->docName().data()); + msg("Parsing code for file %s...\n",qPrint(fd->docName())); fd->parseSource(nullptr); } } @@ -7984,7 +7981,7 @@ static void generateFileDocs() bool doc = fd->isLinkableInProject(); if (doc) { - msg("Generating docs for file %s...\n",fd->docName().data()); + msg("Generating docs for file %s...\n",qPrint(fd->docName())); fd->writeDocumentation(*g_outputList); } } @@ -8030,8 +8027,8 @@ static void addSourceReferences() for (const auto &md : *mn) { //printf("class member %s: def=%s body=%d link?=%d\n", - // md->name().data(), - // md->getBodyDef()?md->getBodyDef()->name().data():"<none>", + // qPrint(md->name()), + // md->getBodyDef()?qPrint(md->getBodyDef()->name()):"<none>", // md->getStartBodyLine(),md->isLinkableInProject()); FileDef *fd=md->getBodyDef(); if (fd && @@ -8041,7 +8038,7 @@ static void addSourceReferences() ) { //printf("Found member '%s' in file '%s' at line '%d' def=%s\n", - // md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data()); + // qPrint(md->name()),qPrint(fd->name()),md->getStartBodyLine(),qPrint(md->getOuterScope()->name())); fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get()); } } @@ -8052,7 +8049,7 @@ static void addSourceReferences() { FileDef *fd=md->getBodyDef(); //printf("member %s body=[%d,%d] fd=%p link=%d parseSources=%d\n", - // md->name().data(), + // qPrint(md->name()), // md->getStartBodyLine(),md->getEndBodyLine(),fd, // md->isLinkableInProject(), // Doxygen::parseSourcesNeeded); @@ -8063,7 +8060,7 @@ static void addSourceReferences() ) { //printf("Found member '%s' in file '%s' at line '%d' def=%s\n", - // md->name().data(),fd->name().data(),md->getStartBodyLine(),md->getOuterScope()->name().data()); + // qPrint(md->name()),qPrint(fd->name()),md->getStartBodyLine(),qPrint(md->getOuterScope()->name())); fd->addSourceRef(md->getStartDefLine(),md->getOuterScope(),md.get()); } } @@ -8084,7 +8081,7 @@ static void buildDefineList() { std::unique_ptr<MemberDefMutable> md { createMemberDef( def.fileName,def.lineNr,def.columnNr, - "#define",def.name,def.args,0, + "#define",def.name,def.args,QCString(), Public,Normal,FALSE,Member,MemberType_Define, ArgumentList(),ArgumentList(),"") }; @@ -8228,7 +8225,7 @@ static void generateClassList(const ClassLinkedMap &classList) { ClassDefMutable *cd=toClassDefMutable(cdi.get()); - //printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope); + //printf("cd=%s getOuterScope=%p global=%p\n",qPrint(cd->name()),cd->getOuterScope(),Doxygen::globalScope); if (cd && (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file cd->getOuterScope()==Doxygen::globalScope // only look at global classes @@ -8239,7 +8236,7 @@ static void generateClassList(const ClassLinkedMap &classList) // template instances if ( cd->isLinkableInProject() && cd->templateMaster()==0) { - msg("Generating docs for compound %s...\n",cd->name().data()); + msg("Generating docs for compound %s...\n",qPrint(cd->name())); cd->writeDocumentation(*g_outputList); cd->writeMemberList(*g_outputList); @@ -8264,14 +8261,14 @@ static void generateConceptDocs() { ConceptDefMutable *cd=toConceptDefMutable(cdi.get()); - //printf("cd=%s getOuterScope=%p global=%p\n",cd->name().data(),cd->getOuterScope(),Doxygen::globalScope); + //printf("cd=%s getOuterScope=%p global=%p\n",qPrint(cd->name()),cd->getOuterScope(),Doxygen::globalScope); if (cd && (cd->getOuterScope()==0 || // <-- should not happen, but can if we read an old tag file cd->getOuterScope()==Doxygen::globalScope // only look at global concepts ) && !cd->isHidden() && cd->isLinkableInProject() ) { - msg("Generating docs for concept %s...\n",cd->name().data()); + msg("Generating docs for concept %s...\n",qPrint(cd->name())); cd->writeDocumentation(*g_outputList); } } @@ -8287,7 +8284,7 @@ static void inheritDocumentation() { MemberDefMutable *md = toMemberDefMutable(imd.get()); //static int count=0; - //printf("%04d Member '%s'\n",count++,md->qualifiedName().data()); + //printf("%04d Member '%s'\n",count++,qPrint(md->qualifiedName())); if (md && md->documentation().isEmpty() && md->briefDescription().isEmpty()) { // no documentation yet const MemberDef *bmd = md->reimplements(); @@ -8295,7 +8292,7 @@ static void inheritDocumentation() bmd->briefDescription().isEmpty() ) { // search up the inheritance tree for a documentation member - //printf("bmd=%s class=%s\n",bmd->name().data(),bmd->getClassDef()->name().data()); + //printf("bmd=%s class=%s\n",qPrint(bmd->name()),qPrint(bmd->getClassDef()->name())); bmd = bmd->reimplements(); } if (bmd) // copy the documentation from the reimplemented member @@ -8581,19 +8578,19 @@ static void findDefineDocumentation(Entry *root) ) { //printf("found define '%s' '%s' brief='%s' doc='%s'\n", - // root->name.data(),root->args.data(),root->brief.data(),root->doc.data()); + // qPrint(root->name),qPrint(root->args),qPrint(root->brief),qPrint(root->doc)); if (root->tagInfo() && !root->name.isEmpty()) // define read from a tag file { std::unique_ptr<MemberDefMutable> md { createMemberDef(root->tagInfo()->tagName,1,1, - "#define",root->name,root->args,0, + "#define",root->name,root->args,QCString(), Public,Normal,FALSE,Member,MemberType_Define, ArgumentList(),ArgumentList(),"") }; md->setTagInfo(root->tagInfo()); md->setLanguage(root->lang); - //printf("Searching for '%s' fd=%p\n",filePathName.data(),fd); + //printf("Searching for '%s' fd=%p\n",qPrint(filePathName),fd); md->setFileDef(root->parent()->fileDef()); - //printf("Adding member=%s\n",md->name().data()); + //printf("Adding member=%s\n",qPrint(md->name())); MemberName *mn = Doxygen::functionNameLinkedMap->add(root->name); mn->push_back(std::move(md)); } @@ -8664,10 +8661,10 @@ static void findDefineDocumentation(Entry *root) } } } - //warn("define %s found in the following files:\n",root->name.data()); + //warn("define %s found in the following files:\n",qPrint(root->name)); //warn("Cannot determine where to add the documentation found " // "at line %d of file %s. \n", - // root->startLine,root->fileName.data()); + // root->startLine,qPrint(root->fileName)); } } else if (!root->doc.isEmpty() || !root->brief.isEmpty()) // define not found @@ -8677,7 +8674,7 @@ static void findDefineDocumentation(Entry *root) { warn(root->fileName,root->startLine, "documentation for unknown define %s found.\n", - root->name.data() + qPrint(root->name) ); } else @@ -8685,7 +8682,7 @@ static void findDefineDocumentation(Entry *root) warn(root->fileName,root->startLine, "found documented #define %s but ignoring it because " "ENABLE_PREPROCESSING is NO.\n", - root->name.data() + qPrint(root->name) ); } } @@ -8702,7 +8699,7 @@ static void findDirDocumentation(const Entry *root) QCString normalizedName = root->name; normalizedName = substitute(normalizedName,"\\","/"); //printf("root->docFile=%s normalizedName=%s\n", - // root->docFile.data(),normalizedName.data()); + // qPrint(root->docFile),qPrint(normalizedName)); if (root->docFile==normalizedName) // current dir? { int lastSlashPos=normalizedName.findRev('/'); @@ -8718,7 +8715,7 @@ static void findDirDocumentation(const Entry *root) DirDef *matchingDir=0; for (const auto &dir : *Doxygen::dirLinkedMap) { - //printf("Dir: %s<->%s\n",dir->name().data(),normalizedName.data()); + //printf("Dir: %s<->%s\n",qPrint(dir->name()),qPrint(normalizedName)); if (dir->name().right(normalizedName.length())==normalizedName) { if (matchingDir) @@ -8727,7 +8724,7 @@ static void findDirDocumentation(const Entry *root) "\\dir command matches multiple directories.\n" " Applying the command for directory %s\n" " Ignoring the command for directory %s\n", - matchingDir->name().data(),dir->name().data() + qPrint(matchingDir->name()),qPrint(dir->name()) ); } else @@ -8738,7 +8735,7 @@ static void findDirDocumentation(const Entry *root) } if (matchingDir) { - //printf("Match for with dir %s\n",matchingDir->name().data()); + //printf("Match for with dir %s\n",qPrint(matchingDir->name())); matchingDir->setBriefDescription(root->brief,root->briefFile,root->briefLine); matchingDir->setDocumentation(root->doc,root->docFile,root->docLine); matchingDir->setRefItems(root->sli); @@ -8747,7 +8744,7 @@ static void findDirDocumentation(const Entry *root) else { warn(root->fileName,root->startLine,"No matching " - "directory found for command \\dir %s\n",normalizedName.data()); + "directory found for command \\dir %s\n",qPrint(normalizedName)); } } for (const auto &e : root->children()) findDirDocumentation(e.get()); @@ -8777,7 +8774,7 @@ static void buildPageList(Entry *root) "page", name, title, - 0,0 + QCString(),0 ); } for (const auto &e : root->children()) buildPageList(e.get()); @@ -8791,7 +8788,7 @@ static void findMainPage(Entry *root) if (Doxygen::mainPage==0 && root->tagInfo()==0) { //printf("mainpage: docLine=%d startLine=%d\n",root->docLine,root->startLine); - //printf("Found main page! \n======\n%s\n=======\n",root->doc.data()); + //printf("Found main page! \n======\n%s\n=======\n",qPrint(root->doc)); QCString title=root->args.stripWhiteSpace(); if (title.isEmpty()) title = Config_getString(PROJECT_NAME); //QCString indexName=Config_getBool(GENERATE_TREEVIEW)?"main":"index"; @@ -8811,12 +8808,12 @@ static void findMainPage(Entry *root) if (si->lineNr() != -1) { warn(root->fileName,root->startLine,"multiple use of section label '%s' for main page, (first occurrence: %s, line %d)", - Doxygen::mainPage->name().data(),si->fileName().data(),si->lineNr()); + qPrint(Doxygen::mainPage->name()),qPrint(si->fileName()),si->lineNr()); } else { warn(root->fileName,root->startLine,"multiple use of section label '%s' for main page, (first occurrence: %s)", - Doxygen::mainPage->name().data(),si->fileName().data()); + qPrint(Doxygen::mainPage->name()),qPrint(si->fileName())); } } else @@ -8836,7 +8833,7 @@ static void findMainPage(Entry *root) { warn(root->fileName,root->startLine, "found more than one \\mainpage comment block! (first occurrence: %s, line %d), Skipping current block!", - Doxygen::mainPage->docFile().data(),Doxygen::mainPage->getStartBodyLine()); + qPrint(Doxygen::mainPage->docFile()),Doxygen::mainPage->getStartBodyLine()); } } for (const auto &e : root->children()) findMainPage(e.get()); @@ -8875,13 +8872,13 @@ static void computePageRelations(Entry *root) { term("page defined at line %d of file %s with label %s is a direct " "subpage of itself! Please remove this cyclic dependency.\n", - pd->docLine(),pd->docFile().data(),pd->name().data()); + pd->docLine(),qPrint(pd->docFile()),qPrint(pd->name())); } else if (subPd) { pd->addInnerCompound(subPd); //printf("*** Added subpage relation: %s->%s\n", - // pd->name().data(),subPd->name().data()); + // qPrint(pd->name()),qPrint(subPd->name())); } } } @@ -8900,7 +8897,7 @@ static void checkPageRelations() { term("page defined at line %d of file %s with label %s is a subpage " "of itself! Please remove this cyclic dependency.\n", - pd->docLine(),pd->docFile().data(),pd->name().data()); + pd->docLine(),qPrint(pd->docFile()),qPrint(pd->name())); } ppd=ppd->getOuterScope(); } @@ -8914,8 +8911,8 @@ static void resolveUserReferences() for (const auto &si : SectionManager::instance()) { //printf("si->label='%s' si->definition=%s si->fileName='%s'\n", - // si->label.data(),si->definition?si->definition->name().data():"<none>", - // si->fileName.data()); + // qPrint(si->label),si->definition?qPrint(si->definition->name()):"<none>", + // qPrint(si->fileName)); PageDef *pd=0; // hack: the items of a todo/test/bug/deprecated list are all fragments from @@ -8934,7 +8931,7 @@ static void resolveUserReferences() } } - //printf("start: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data()); + //printf("start: si->label=%s si->fileName=%s\n",qPrint(si->label),qPrint(si->fileName)); if (!si->generated()) { // if this section is in a page and the page is in a group, then we @@ -8962,12 +8959,12 @@ static void resolveUserReferences() } else { - //si->fileName=si->definition->getOutputFileBase().copy(); - //printf("Setting si->fileName to %s\n",si->fileName.data()); + //si->fileName=si->definition->getOutputFileBase(); + //printf("Setting si->fileName to %s\n",qPrint(si->fileName)); } } } - //printf("end: si->label=%s si->fileName=%s\n",si->label.data(),si->fileName.data()); + //printf("end: si->label=%s si->fileName=%s\n",qPrint(si->label),qPrint(si->fileName)); } } @@ -8985,7 +8982,7 @@ static void generatePageDocs() { if (!pd->getGroupDef() && !pd->isReference()) { - msg("Generating docs for page %s...\n",pd->name().data()); + msg("Generating docs for page %s...\n",qPrint(pd->name())); Doxygen::insideMainPage=TRUE; pd->writeDocumentation(*g_outputList); Doxygen::insideMainPage=FALSE; @@ -9005,7 +9002,7 @@ static void buildExampleList(Entry *root) warn(root->fileName,root->startLine, "Example %s was already documented. Ignoring " "documentation found here.", - root->name.data() + qPrint(root->name) ); } else @@ -9035,8 +9032,8 @@ void printNavTree(Entry *root,int indent) QCString indentStr; indentStr.fill(' ',indent); msg("%s%s (sec=0x%x)\n", - indentStr.isEmpty()?"":indentStr.data(), - root->name.isEmpty()?"<empty>":root->name.data(), + indentStr.isEmpty()?"":qPrint(indentStr), + root->name.isEmpty()?"<empty>":qPrint(root->name), root->section); for (const auto &e : root->children()) { @@ -9053,14 +9050,14 @@ static void generateExampleDocs() g_outputList->disable(OutputGenerator::Man); for (const auto &pd : *Doxygen::exampleLinkedMap) { - msg("Generating docs for example %s...\n",pd->name().data()); + msg("Generating docs for example %s...\n",qPrint(pd->name())); auto intf = Doxygen::parserManager->getCodeParser(".c"); // TODO: do this on code type intf->resetCodeParserState(); QCString n=pd->getOutputFileBase(); startFile(*g_outputList,n,n,pd->name()); startTitle(*g_outputList,n); g_outputList->docify(pd->name()); - endTitle(*g_outputList,n,0); + endTitle(*g_outputList,n,QCString()); g_outputList->startContents(); QCString lineNoOptStr; if (pd->showLineNo()) @@ -9116,7 +9113,7 @@ static void generateNamespaceClassDocs(const ClassLinkedRefMap &classList) && !cd->isHidden() && !cd->isEmbeddedInOuterScope() ) { - msg("Generating docs for compound %s...\n",cd->name().data()); + msg("Generating docs for compound %s...\n",qPrint(cd->name())); cdm->writeDocumentation(*g_outputList); cdm->writeMemberList(*g_outputList); @@ -9134,7 +9131,7 @@ static void generateNamespaceConceptDocs(const ConceptLinkedRefMap &conceptList) ConceptDefMutable *cdm = toConceptDefMutable(cd); if ( cdm && cd->isLinkableInProject() && !cd->isHidden()) { - msg("Generating docs for concept %s...\n",cd->name().data()); + msg("Generating docs for concept %s...\n",qPrint(cd->name())); cdm->writeDocumentation(*g_outputList); } } @@ -9154,7 +9151,7 @@ static void generateNamespaceDocs() NamespaceDefMutable *ndm = toNamespaceDefMutable(nd.get()); if (ndm) { - msg("Generating docs for namespace %s\n",nd->name().data()); + msg("Generating docs for namespace %s\n",qPrint(nd->name())); ndm->writeDocumentation(*g_outputList); } } @@ -9198,12 +9195,12 @@ static QCString fixSlashes(QCString &s) * If the \a shortList parameter is TRUE a configuration file without * comments will be generated. */ -static void generateConfigFile(const char *configFile,bool shortList, +static void generateConfigFile(const QCString &configFile,bool shortList, bool updateOnly=FALSE) { std::ofstream f; bool fileOpened=openOutputFile(configFile,f); - bool writeToStdout=(configFile[0]=='-' && configFile[1]=='\0'); + bool writeToStdout=configFile=="-"; if (fileOpened) { TextStream t(&f); @@ -9212,33 +9209,30 @@ static void generateConfigFile(const char *configFile,bool shortList, { if (!updateOnly) { - msg("\n\nConfiguration file '%s' created.\n\n",configFile); + msg("\n\nConfiguration file '%s' created.\n\n",qPrint(configFile)); msg("Now edit the configuration file and enter\n\n"); - if (qstrcmp(configFile,"Doxyfile") || qstrcmp(configFile,"doxyfile")) - msg(" doxygen %s\n\n",configFile); + if (configFile!="Doxyfile" && configFile!="doxyfile") + msg(" doxygen %s\n\n",qPrint(configFile)); else msg(" doxygen\n\n"); msg("to generate the documentation for your project\n\n"); } else { - msg("\n\nConfiguration file '%s' updated.\n\n",configFile); + msg("\n\nConfiguration file '%s' updated.\n\n",qPrint(configFile)); } } } else { - term("Cannot open file %s for writing\n",configFile); + term("Cannot open file %s for writing\n",qPrint(configFile)); } } static void compareDoxyfile() { std::ofstream f; - char configFile[2]; - configFile[0] = '-'; - configFile[1] = '\0'; - bool fileOpened=openOutputFile(configFile,f); + bool fileOpened=openOutputFile("-",f); if (fileOpened) { TextStream t(&f); @@ -9246,16 +9240,15 @@ static void compareDoxyfile() } else { - term("Cannot open file %s for writing\n",configFile); + term("Cannot open stdout for writing\n"); } } //---------------------------------------------------------------------------- // read and parse a tag file -static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl) +static void readTagFile(const std::shared_ptr<Entry> &root,const QCString &tagLine) { - QCString tagLine = tl; QCString fileName; QCString destName; int eqPos = tagLine.find('='); @@ -9267,7 +9260,7 @@ static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl) FileInfo fi(fileName.str()); Doxygen::tagDestinationMap.insert( std::make_pair(fi.absFilePath(), destName.str())); - //printf("insert tagDestination %s->%s\n",fi.fileName().data(),destName.data()); + //printf("insert tagDestination %s->%s\n",qPrint(fi.fileName()),qPrint(destName)); } else { @@ -9278,14 +9271,14 @@ static void readTagFile(const std::shared_ptr<Entry> &root,const char *tl) if (!fi.exists() || !fi.isFile()) { err("Tag file '%s' does not exist or is not a file. Skipping it...\n", - fileName.data()); + qPrint(fileName)); return; } if (!destName.isEmpty()) - msg("Reading tag file '%s', location '%s'...\n",fileName.data(),destName.data()); + msg("Reading tag file '%s', location '%s'...\n",qPrint(fileName),qPrint(destName)); else - msg("Reading tag file '%s'...\n",fileName.data()); + msg("Reading tag file '%s'...\n",qPrint(fileName)); parseTagFile(root,fi.absFilePath().c_str()); } @@ -9302,7 +9295,7 @@ static void copyLatexStyleSheet() FileInfo fi(fileName); if (!fi.exists()) { - err("Style sheet '%s' specified by LATEX_EXTRA_STYLESHEET does not exist!\n",fileName.data()); + err("Style sheet '%s' specified by LATEX_EXTRA_STYLESHEET does not exist!\n",qPrint(fileName)); } else { @@ -9311,7 +9304,7 @@ static void copyLatexStyleSheet() { destFileName += LATEX_STYLE_EXTENSION; } - copyFile(fileName, destFileName); + copyFile(QCString(fileName), destFileName); } } } @@ -9326,7 +9319,7 @@ static void copyStyleSheet() FileInfo fi(htmlStyleSheet.str()); if (!fi.exists()) { - err("Style sheet '%s' specified by HTML_STYLESHEET does not exist!\n",htmlStyleSheet.data()); + err("Style sheet '%s' specified by HTML_STYLESHEET does not exist!\n",qPrint(htmlStyleSheet)); htmlStyleSheet = Config_updateString(HTML_STYLESHEET,""); // revert to the default } else @@ -9348,12 +9341,12 @@ static void copyStyleSheet() } else if (fi.fileName()=="doxygen.css" || fi.fileName()=="tabs.css" || fi.fileName()=="navtree.css") { - err("Style sheet %s specified by HTML_EXTRA_STYLESHEET is already a built-in stylesheet. Please use a different name\n",fi.fileName().data()); + err("Style sheet %s specified by HTML_EXTRA_STYLESHEET is already a built-in stylesheet. Please use a different name\n",qPrint(fi.fileName())); } else { QCString destFileName = Config_getString(HTML_OUTPUT)+"/"+fi.fileName(); - copyFile(fileName, destFileName); + copyFile(QCString(fileName), destFileName); } } } @@ -9367,7 +9360,7 @@ static void copyLogo(const QCString &outputOption) FileInfo fi(projectLogo.str()); if (!fi.exists()) { - err("Project logo '%s' specified by PROJECT_LOGO does not exist!\n",projectLogo.data()); + err("Project logo '%s' specified by PROJECT_LOGO does not exist!\n",qPrint(projectLogo)); projectLogo = Config_updateString(PROJECT_LOGO,""); // revert to the default } else @@ -9388,13 +9381,13 @@ static void copyExtraFiles(const StringVector &files,const QCString &filesOption FileInfo fi(fileName); if (!fi.exists()) { - err("Extra file '%s' specified in %s does not exist!\n", fileName.c_str(),filesOption.data()); + err("Extra file '%s' specified in %s does not exist!\n", fileName.c_str(),qPrint(filesOption)); } else { QCString destFileName = outputOption+"/"+fi.fileName(); Doxygen::indexList->addImageFile(fi.fileName().c_str()); - copyFile(fileName, destFileName); + copyFile(QCString(fileName), destFileName); } } } @@ -9436,7 +9429,7 @@ static void generateDiskNames() std::sort(fileEntries.begin(), fileEntries.end(), [](const FileEntry &fe1,const FileEntry &fe2) - { return qstrcmp(fe1.path.data(),fe2.path.data())<0; } + { return fe1.path < fe2.path; } ); // since the entries are sorted, the common prefix of the whole array is same @@ -9468,7 +9461,7 @@ static void generateDiskNames() { QCString prefix = fileEntry.path.right(fileEntry.path.length()-j-1); fileEntry.fileDef->setName(prefix+fn->fileName()); - //printf("!!!!!!!! non unique disk name=%s:%s\n",prefix.data(),fn->fileName()); + //printf("!!!!!!!! non unique disk name=%s:%s\n",qPrint(prefix),fn->fileName()); fileEntry.fileDef->setDiskName(prefix+fn->fileName()); } } @@ -9479,7 +9472,7 @@ static void generateDiskNames() //---------------------------------------------------------------------------- -static std::unique_ptr<OutlineParserInterface> getParserForFile(const char *fn) +static std::unique_ptr<OutlineParserInterface> getParserForFile(const QCString &fn) { QCString fileName=fn; QCString extension; @@ -9498,7 +9491,7 @@ static std::unique_ptr<OutlineParserInterface> getParserForFile(const char *fn) } static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser, - FileDef *fd,const char *fn, + FileDef *fd,const QCString &fn, ClangTUParser *clangParser,bool newTU) { QCString fileName=fn; @@ -9527,13 +9520,13 @@ static std::shared_ptr<Entry> parseFile(OutlineParserInterface &parser, preprocessor.addSearchDir(absPath.c_str()); } BufStr inBuf((uint)fi.size()+4096); - msg("Preprocessing %s...\n",fn); + msg("Preprocessing %s...\n",qPrint(fn)); readInputFile(fileName,inBuf); preprocessor.processFile(fileName,inBuf,preBuf); } else // no preprocessing { - msg("Reading %s...\n",fn); + msg("Reading %s...\n",qPrint(fn)); readInputFile(fileName,preBuf); } if (preBuf.data() && preBuf.curPos()>0 && *(preBuf.data()+preBuf.curPos()-1)!='\n') @@ -9783,13 +9776,13 @@ static void parseFilesSingleThreading(const std::shared_ptr<Entry> &root) // resolves a path that may include symlinks, if a recursive symlink is // found an empty string is returned. -static QCString resolveSymlink(QCString path) +static std::string resolveSymlink(const std::string &path) { int sepPos=0; int oldPos=0; StringSet nonSymlinks; StringSet known; - QCString result = path; + QCString result(path); QCString oldPrefix = "/"; do { @@ -9824,7 +9817,7 @@ static QCString resolveSymlink(QCString path) } result = Dir::cleanDirPath(target.str()); sepPos = 0; - if (known.find(result.str())!=known.end()) return QCString(); // recursive symlink! + if (known.find(result.str())!=known.end()) return std::string(); // recursive symlink! known.insert(result.str()); if (isRelative) { @@ -9885,7 +9878,7 @@ static void readDir(FileInfo *fi, g_pathsVisited.insert(dirName); } Dir dir(dirName); - msg("Searching for files in directory %s\n", fi->absFilePath().data()); + msg("Searching for files in directory %s\n", qPrint(fi->absFilePath())); //printf("killSet=%p count=%d\n",killSet,killSet ? (int)killSet->count() : -1); for (const auto &dirEntry : dir.iterator()) @@ -9893,7 +9886,7 @@ static void readDir(FileInfo *fi, FileInfo cfi(dirEntry.path()); if (exclSet==0 || exclSet->find(cfi.absFilePath())==exclSet->end()) { // file should not be excluded - //printf("killSet->find(%s)\n",cfi->absFilePath().data()); + //printf("killSet->find(%s)\n",qPrint(cfi->absFilePath())); if (!cfi.exists() || !cfi.isReadable()) { if (errorIfNotExist) @@ -9911,11 +9904,11 @@ static void readDir(FileInfo *fi, std::string name=cfi.fileName(); if (fnMap) { - std::unique_ptr<FileDef> fd { createFileDef(cfi.dirPath()+"/",name) }; + std::unique_ptr<FileDef> fd { createFileDef(QCString(cfi.dirPath()+"/"),QCString(name)) }; FileName *fn=0; if (!name.empty()) { - fn = fnMap->add(name.c_str(),cfi.absFilePath().c_str()); + fn = fnMap->add(QCString(name),QCString(cfi.absFilePath())); fn->push_back(std::move(fd)); } } @@ -9943,7 +9936,7 @@ static void readDir(FileInfo *fi, // read a file or all files in a directory and append their contents to the // input string. The names of the files are appended to the 'fiList' list. -void readFileOrDirectory(const char *s, +void readFileOrDirectory(const QCString &s, FileNameLinkedMap *fnMap, StringUnorderedSet *exclSet, const StringVector *patList, @@ -9958,9 +9951,9 @@ void readFileOrDirectory(const char *s, { //printf("killSet count=%d\n",killSet ? (int)killSet->size() : -1); // strip trailing slashes - if (s==0) return; + if (s.isEmpty()) return; - FileInfo fi(s); + FileInfo fi(s.str()); //printf("readFileOrDirectory(%s)\n",s); { if (exclSet==0 || exclSet->find(fi.absFilePath())==exclSet->end()) @@ -9969,7 +9962,7 @@ void readFileOrDirectory(const char *s, { if (errorIfNotExist) { - warn_uncond("source '%s' is not a readable file or directory... skipping.\n",s); + warn_uncond("source '%s' is not a readable file or directory... skipping.\n",qPrint(s)); } } else if (!Config_getBool(EXCLUDE_SYMLINKS) || !fi.isSymLink()) @@ -9982,16 +9975,16 @@ void readFileOrDirectory(const char *s, { paths->insert(dirPath); } - //printf("killSet.find(%s)=%d\n",fi.absFilePath().data(),killSet.find(fi.absFilePath())!=killSet.end()); + //printf("killSet.find(%s)=%d\n",qPrint(fi.absFilePath()),killSet.find(fi.absFilePath())!=killSet.end()); if (killSet==0 || killSet->find(filePath)==killSet->end()) { std::string name=fi.fileName(); if (fnMap) { - std::unique_ptr<FileDef> fd { createFileDef(dirPath+"/",name) }; + std::unique_ptr<FileDef> fd { createFileDef(QCString(dirPath+"/"),QCString(name)) }; if (!name.empty()) { - FileName *fn = fnMap->add(name.c_str(),filePath.c_str()); + FileName *fn = fnMap->add(QCString(name),QCString(filePath)); fn->push_back(std::move(fd)); } } @@ -10031,7 +10024,7 @@ static void escapeAliases() { for (auto &kv : Doxygen::aliasMap) { - QCString value=kv.second; + QCString value(kv.second); QCString newValue; int in,p=0; // for each \n in the alias command value @@ -10065,7 +10058,7 @@ static void escapeAliases() } newValue+=value.mid(p,value.length()-p); kv.second=newValue.str(); - //printf("Alias %s has value %s\n",adi.currentKey().data(),s->data()); + //printf("Alias %s has value %s\n",kv.first.c_str(),qPrint(newValue)); } } @@ -10077,13 +10070,13 @@ void readAliases() const StringVector &aliasList = Config_getList(ALIASES); for (const auto &al : aliasList) { - QCString alias = al; + QCString alias(al); int i=alias.find('='); if (i>0) { QCString name=alias.left(i).stripWhiteSpace(); QCString value=alias.right(alias.length()-i-1); - //printf("Alias: found name='%s' value='%s'\n",name.data(),value.data()); + //printf("Alias: found name='%s' value='%s'\n",qPrint(name),qPrint(value)); if (!name.isEmpty()) { auto it = Doxygen::aliasMap.find(name.str()); @@ -10157,7 +10150,7 @@ static void devUsage() static void version(const bool extended) { QCString versionString = getFullVersion(); - msg("%s\n",versionString.data()); + msg("%s\n",qPrint(versionString)); if (extended) { QCString extVers; @@ -10179,7 +10172,7 @@ static void version(const bool extended) { int lastComma = extVers.findRev(','); if (lastComma != -1) extVers = extVers.replace(lastComma,1," and"); - msg(" with %s.\n",extVers.data()); + msg(" with %s.\n",qPrint(extVers)); } } } @@ -10187,33 +10180,33 @@ static void version(const bool extended) //---------------------------------------------------------------------------- // print the usage of doxygen -static void usage(const char *name,const char *versionString) +static void usage(const QCString &name,const QCString &versionString) { - msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2021\n\n",versionString); + msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2021\n\n",qPrint(versionString)); msg("You can use doxygen in a number of ways:\n\n"); msg("1) Use doxygen to generate a template configuration file:\n"); - msg(" %s [-s] -g [configName]\n\n",name); + msg(" %s [-s] -g [configName]\n\n",qPrint(name)); msg("2) Use doxygen to update an old configuration file:\n"); - msg(" %s [-s] -u [configName]\n\n",name); + msg(" %s [-s] -u [configName]\n\n",qPrint(name)); msg("3) Use doxygen to generate documentation using an existing "); msg("configuration file:\n"); - msg(" %s [configName]\n\n",name); + msg(" %s [configName]\n\n",qPrint(name)); msg("4) Use doxygen to generate a template file controlling the layout of the\n"); msg(" generated documentation:\n"); - msg(" %s -l [layoutFileName]\n\n",name); + msg(" %s -l [layoutFileName]\n\n",qPrint(name)); msg(" In case layoutFileName is omitted layoutFileName.xml will be used as filename.\n"); msg(" If - is used for layoutFileName doxygen will write to standard output.\n\n"); msg("5) Use doxygen to generate a template style sheet file for RTF, HTML or Latex.\n"); - msg(" RTF: %s -w rtf styleSheetFile\n",name); - msg(" HTML: %s -w html headerFile footerFile styleSheetFile [configFile]\n",name); - msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",name); + msg(" RTF: %s -w rtf styleSheetFile\n",qPrint(name)); + msg(" HTML: %s -w html headerFile footerFile styleSheetFile [configFile]\n",qPrint(name)); + msg(" LaTeX: %s -w latex headerFile footerFile styleSheetFile [configFile]\n\n",qPrint(name)); msg("6) Use doxygen to generate a rtf extensions file\n"); - msg(" RTF: %s -e rtf extensionsFile\n\n",name); + msg(" RTF: %s -e rtf extensionsFile\n\n",qPrint(name)); msg(" If - is used for extensionsFile doxygen will write to standard output.\n\n"); msg("7) Use doxygen to compare the used configuration file with the template configuration file\n"); - msg(" %s -x [configFile]\n\n",name); + msg(" %s -x [configFile]\n\n",qPrint(name)); msg("8) Use doxygen to show a list of built-in emojis.\n"); - msg(" %s -f emoji outputFileName\n\n",name); + msg(" %s -f emoji outputFileName\n\n",qPrint(name)); msg(" If - is used for outputFileName doxygen will write to standard output.\n\n"); msg("If -s is specified the comments of the configuration items in the config file will be omitted.\n"); msg("If configName is omitted 'Doxyfile' will be used as a default.\n"); @@ -10241,9 +10234,9 @@ static const char *getArg(int argc,char **argv,int &optind) class NullOutlineParser : public OutlineParserInterface { public: - void parseInput(const char *, const char *,const std::shared_ptr<Entry> &, ClangTUParser*) {} + void parseInput(const QCString &file, const char *buf,const std::shared_ptr<Entry> &, ClangTUParser*) {} bool needsPreprocessing(const QCString &) const { return FALSE; } - void parsePrototype(const char *) {} + void parsePrototype(const QCString &) {} }; @@ -10255,8 +10248,8 @@ template<class T> std::function< std::unique_ptr<T>() > make_parser_factory() void initDoxygen() { initResources(); - const char *lang = Portable::getenv("LC_ALL"); - if (lang) Portable::setenv("LANG",lang); + QCString lang = Portable::getenv("LC_ALL"); + if (!lang.isEmpty()) Portable::setenv("LANG",lang); std::setlocale(LC_ALL,""); std::setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8 std::setlocale(LC_NUMERIC,"C"); @@ -10386,11 +10379,11 @@ void readConfiguration(int argc, char **argv) **************************************************************************/ int optind=1; - const char *configName=0; - const char *layoutName=0; - const char *debugLabel; - const char *formatName; - const char *listName; + QCString configName; + QCString layoutName; + QCString debugLabel; + QCString formatName; + QCString listName; bool genConfig=FALSE; bool shortList=FALSE; bool diffList=FALSE; @@ -10421,7 +10414,7 @@ void readConfiguration(int argc, char **argv) break; case 'd': debugLabel=getArg(argc,argv,optind); - if (!debugLabel) + if (debugLabel.isEmpty()) { devUsage(); cleanUpDoxygen(); @@ -10430,7 +10423,7 @@ void readConfiguration(int argc, char **argv) retVal = Debug::setFlag(debugLabel); if (!retVal) { - err("option \"-d\" has unknown debug specifier: \"%s\".\n",debugLabel); + err("option \"-d\" has unknown debug specifier: \"%s\".\n",qPrint(debugLabel)); devUsage(); cleanUpDoxygen(); exit(1); @@ -10447,13 +10440,13 @@ void readConfiguration(int argc, char **argv) break; case 'e': formatName=getArg(argc,argv,optind); - if (!formatName) + if (formatName.isEmpty()) { err("option \"-e\" is missing format specifier rtf.\n"); cleanUpDoxygen(); exit(1); } - if (qstricmp(formatName,"rtf")==0) + if (qstricmp(formatName.data(),"rtf")==0) { if (optind+1>=argc) { @@ -10476,13 +10469,13 @@ void readConfiguration(int argc, char **argv) break; case 'f': listName=getArg(argc,argv,optind); - if (!listName) + if (listName.isEmpty()) { err("option \"-f\" is missing list specifier.\n"); cleanUpDoxygen(); exit(1); } - if (qstricmp(listName,"emoji")==0) + if (qstricmp(listName.data(),"emoji")==0) { if (optind+1>=argc) { @@ -10505,13 +10498,13 @@ void readConfiguration(int argc, char **argv) break; case 'w': formatName=getArg(argc,argv,optind); - if (!formatName) + if (formatName.isEmpty()) { err("option \"-w\" is missing format specifier rtf, html or latex\n"); cleanUpDoxygen(); exit(1); } - if (qstricmp(formatName,"rtf")==0) + if (qstricmp(formatName.data(),"rtf")==0) { if (optind+1>=argc) { @@ -10528,7 +10521,7 @@ void readConfiguration(int argc, char **argv) cleanUpDoxygen(); exit(1); } - else if (qstricmp(formatName,"html")==0) + else if (qstricmp(formatName.data(),"html")==0) { Config::init(); if (optind+4<argc || FileInfo("Doxyfile").exists()) @@ -10554,7 +10547,7 @@ void readConfiguration(int argc, char **argv) QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE); if (!setTranslator(outputLanguage)) { - warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data()); + warn_uncond("Output language %s not supported! Using English instead.\n", qPrint(outputLanguage)); } std::ofstream f; @@ -10578,7 +10571,7 @@ void readConfiguration(int argc, char **argv) cleanUpDoxygen(); exit(0); } - else if (qstricmp(formatName,"latex")==0) + else if (qstricmp(formatName.data(),"latex")==0) { Config::init(); if (optind+4<argc || FileInfo("Doxyfile").exists()) @@ -10603,7 +10596,7 @@ void readConfiguration(int argc, char **argv) QCString outputLanguage=Config_getEnum(OUTPUT_LANGUAGE); if (!setTranslator(outputLanguage)) { - warn_uncond("Output language %s not supported! Using English instead.\n", outputLanguage.data()); + warn_uncond("Output language %s not supported! Using English instead.\n", qPrint(outputLanguage)); } std::ofstream f; @@ -10629,7 +10622,7 @@ void readConfiguration(int argc, char **argv) } else { - err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",formatName); + err("Illegal format specifier \"%s\": should be one of rtf, html or latex\n",qPrint(formatName)); cleanUpDoxygen(); exit(1); } @@ -10755,7 +10748,7 @@ void readConfiguration(int argc, char **argv) if (!Config::parse(configName,updateConfig)) { - err("could not open or read configuration file %s!\n",configName); + err("could not open or read configuration file %s!\n",qPrint(configName)); cleanUpDoxygen(); exit(1); } @@ -10775,8 +10768,8 @@ void readConfiguration(int argc, char **argv) } /* Perlmod wants to know the path to the config file.*/ - FileInfo configFileInfo(configName); - setPerlModDoxyfile(configFileInfo.absFilePath().data()); + FileInfo configFileInfo(configName.str()); + setPerlModDoxyfile(configFileInfo.absFilePath()); } @@ -10805,7 +10798,7 @@ void adjustConfiguration() if (!setTranslator(outputLanguage)) { warn_uncond("Output language %s not supported! Using English instead.\n", - outputLanguage.data()); + qPrint(outputLanguage)); } /* Set the global html file extension. */ @@ -10843,12 +10836,12 @@ void adjustConfiguration() { err("Failed to map file extension '%s' to unsupported language '%s'.\n" "Check the EXTENSION_MAPPING setting in the config file.\n", - ext.data(),language.data()); + qPrint(ext),qPrint(language)); } else { msg("Adding custom extension mapping: '%s' will be treated as language '%s'\n", - ext.data(),language.data()); + qPrint(ext),qPrint(language)); } } } @@ -10893,7 +10886,7 @@ static void writeTagFile() if (!f.is_open()) { err("cannot open tag file %s for writing\n", - generateTagFile.data() + qPrint(generateTagFile) ); return; } @@ -10980,12 +10973,12 @@ static QCString createOutputDirectory(const QCString &baseDirName, } else if (formatDirName[0]!='/' && (formatDirName.length()==1 || formatDirName[1]!=':')) { - result.prepend(baseDirName+'/'); + result.prepend(baseDirName+"/"); } Dir formatDir(result.str()); if (!formatDir.exists() && !formatDir.mkdir(result.str())) { - err("Could not create output directory %s\n", result.data()); + err("Could not create output directory %s\n", qPrint(result)); cleanUpDoxygen(); exit(1); } @@ -11199,7 +11192,7 @@ void parseInput() // we would like to show the versionString earlier, but we first have to handle the configuration file // to know the value of the QUIET setting. QCString versionString = getFullVersion(); - msg("Doxygen version used: %s\n",versionString.data()); + msg("Doxygen version used: %s\n",qPrint(versionString)); /************************************************************************** * Make sure the output directory exists @@ -11218,14 +11211,14 @@ void parseInput() if (!dir.mkdir(outputDirectory.str())) { err("tag OUTPUT_DIRECTORY: Output directory '%s' does not " - "exist and cannot be created\n",outputDirectory.data()); + "exist and cannot be created\n",qPrint(outputDirectory)); cleanUpDoxygen(); exit(1); } else { msg("Notice: Output directory '%s' does not exist. " - "I have created it for you.\n", outputDirectory.data()); + "I have created it for you.\n", qPrint(outputDirectory)); } dir.setPath(outputDirectory.str()); } @@ -11325,11 +11318,11 @@ void parseInput() newFontPath+=Portable::pathListSeparator(); newFontPath+=curFontPath; } - Portable::setenv("DOTFONTPATH",newFontPath); + Portable::setenv("DOTFONTPATH",qPrint(newFontPath)); } else { - Portable::setenv("DOTFONTPATH",curFontPath); + Portable::setenv("DOTFONTPATH",qPrint(curFontPath)); } } @@ -11351,12 +11344,12 @@ void parseInput() FileInfo fi(layoutFileName.str()); if (fi.exists()) { - msg("Parsing layout file %s...\n",layoutFileName.data()); + msg("Parsing layout file %s...\n",qPrint(layoutFileName)); LayoutDocManager::instance().parse(layoutFileName); } else if (!defaultLayoutUsed) { - warn_uncond("failed to open layout file '%s' for reading!\n",layoutFileName.data()); + warn_uncond("failed to open layout file '%s' for reading!\n",qPrint(layoutFileName)); } /************************************************************************** @@ -11365,12 +11358,12 @@ void parseInput() // prevent search in the output directories StringVector exclPatterns = Config_getList(EXCLUDE_PATTERNS); - if (generateHtml) exclPatterns.push_back(htmlOutput.data()); - if (generateDocbook) exclPatterns.push_back(docbookOutput.data()); - if (generateXml) exclPatterns.push_back(xmlOutput.data()); - if (generateLatex) exclPatterns.push_back(latexOutput.data()); - if (generateRtf) exclPatterns.push_back(rtfOutput.data()); - if (generateMan) exclPatterns.push_back(manOutput.data()); + if (generateHtml) exclPatterns.push_back(htmlOutput.str()); + if (generateDocbook) exclPatterns.push_back(docbookOutput.str()); + if (generateXml) exclPatterns.push_back(xmlOutput.str()); + if (generateLatex) exclPatterns.push_back(latexOutput.str()); + if (generateRtf) exclPatterns.push_back(rtfOutput.str()); + if (generateMan) exclPatterns.push_back(manOutput.str()); Config_updateList(EXCLUDE_PATTERNS,exclPatterns); searchInputFiles(); @@ -11614,8 +11607,8 @@ void parseInput() auto memberNameComp = [](const MemberNameLinkedMap::Ptr &n1,const MemberNameLinkedMap::Ptr &n2) { - return qstricmp(n1->memberName()+getPrefixIndex(n1->memberName()), - n2->memberName()+getPrefixIndex(n2->memberName()) + return qstricmp(n1->memberName().data()+getPrefixIndex(n1->memberName()), + n2->memberName().data()+getPrefixIndex(n2->memberName()) )<0; }; @@ -11773,7 +11766,7 @@ void parseInput() std::sort(Doxygen::groupLinkedMap->begin(), Doxygen::groupLinkedMap->end(), [](const auto &g1,const auto &g2) - { return qstrcmp(g1->groupTitle(),g2->groupTitle())<0; }); + { return g1->groupTitle() < g2->groupTitle(); }); for (const auto &gd : *Doxygen::groupLinkedMap) { @@ -11886,7 +11879,7 @@ void generateOutput() if (!searchDir.exists() && !searchDir.mkdir(searchDirName.str())) { term("Could not create search results directory '%s' $PWD='%s'\n", - searchDirName.data(),Dir::currentDirPath().c_str()); + qPrint(searchDirName),Dir::currentDirPath().c_str()); } HtmlGenerator::writeSearchData(searchDirName); if (!serverBasedSearch) // client side search index @@ -12022,7 +12015,7 @@ void generateOutput() { searchDataFile="searchdata.xml"; } - if (!Portable::isAbsolutePath(searchDataFile)) + if (!Portable::isAbsolutePath(searchDataFile.data())) { searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/"); } @@ -12092,7 +12085,7 @@ void generateOutput() Dir::setCurrent(Config_getString(HTML_OUTPUT).str()); Portable::setShortDir(); Portable::sysTimerStart(); - if (Portable::system(Config_getString(HHC_LOCATION), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1) + if (Portable::system(Config_getString(HHC_LOCATION).data(), "index.hhp", Debug::isFlagSet(Debug::ExtCmd))!=1) { err("failed to run html help compiler on index.hhp\n"); } @@ -12111,11 +12104,11 @@ void generateOutput() QCString qhpFileName = Qhp::getQhpFileName(); QCString qchFileName = getQchFileName(); - QCString args = QCString().sprintf("%s -o \"%s\"", qhpFileName.data(), qchFileName.data()); + QCString args = QCString().sprintf("%s -o \"%s\"", qPrint(qhpFileName), qPrint(qchFileName)); std::string oldDir = Dir::currentDirPath(); Dir::setCurrent(Config_getString(HTML_OUTPUT).str()); Portable::sysTimerStart(); - if (Portable::system(Config_getString(QHG_LOCATION), args.data(), FALSE)) + if (Portable::system(Config_getString(QHG_LOCATION).data(), args.data(), FALSE)) { err("failed to run qhelpgenerator on index.qhp\n"); } |