diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-04-11 19:22:59 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-04-22 17:34:13 (GMT) |
commit | 592aaa4f17d73ec8c475df0f44efaea8cc4d575c (patch) | |
tree | 3cfd68cec756661045ee25c906a8d8f4bddf7a6a /src/pagedef.cpp | |
parent | 98c67549bc3cd855873e0ef5eeab7c6410699d78 (diff) | |
download | Doxygen-592aaa4f17d73ec8c475df0f44efaea8cc4d575c.zip Doxygen-592aaa4f17d73ec8c475df0f44efaea8cc4d575c.tar.gz Doxygen-592aaa4f17d73ec8c475df0f44efaea8cc4d575c.tar.bz2 |
Refactoring: remove implicit conversion from QCString to const char *
This commit changes the following in relation to string use
- The implicit convert from 'QCString' to 'const char *' is removed
- Strings parameters use 'const QCString &' as much as possible in favor
over 'const char *'
- 'if (s)' where s is a QCString has been replaced by 'if(!s.isEmpty())'
- data() now always returns a valid C-string and not a 0-pointer.
- when passing a string 's' to printf and related functions 'qPrint(s)' is
used instead of 's.data()'
- for empty string arguments 'QCString()' is used instead of '0'
- The copy() operation has been removed
- Where possible 'qstrcmp(a,b)==0' has been replaces by 'a==b' and
'qstrcmp(a,b)<0' has been replaced by 'a<b'
- Parameters of string type that were default initialized with '= 0' are
no initialized with '= QCString()'
Diffstat (limited to 'src/pagedef.cpp')
-rw-r--r-- | src/pagedef.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/pagedef.cpp b/src/pagedef.cpp index ef5c4eb..07a1f9e 100644 --- a/src/pagedef.cpp +++ b/src/pagedef.cpp @@ -30,10 +30,10 @@ class PageDefImpl : public DefinitionMixin<PageDef> { public: - PageDefImpl(const char *f,int l,const char *n,const char *d,const char *t); + PageDefImpl(const QCString &f,int l,const QCString &n,const QCString &d,const QCString &t); virtual ~PageDefImpl(); - virtual void setFileName(const char *name); + virtual void setFileName(const QCString &name); virtual void setLocalToc(const LocalToc &tl); virtual void setShowLineNo(bool); virtual DefType definitionType() const { return TypePage; } @@ -71,16 +71,16 @@ class PageDefImpl : public DefinitionMixin<PageDef> bool m_showLineNo; }; -PageDef *createPageDef(const char *f,int l,const char *n,const char *d,const char *t) +PageDef *createPageDef(const QCString &f,int l,const QCString &n,const QCString &d,const QCString &t) { return new PageDefImpl(f,l,n,d,t); } //------------------------------------------------------------------------------------------ -PageDefImpl::PageDefImpl(const char *f,int l,const char *n, - const char *d,const char *t) - : DefinitionMixin(f,l,1,n), m_title(t?t:n) +PageDefImpl::PageDefImpl(const QCString &f,int l,const QCString &n, + const QCString &d,const QCString &t) + : DefinitionMixin(f,l,1,n), m_title(!t.isEmpty() ? t : n) { setDocumentation(d,f,l); m_pageScope = 0; @@ -112,7 +112,7 @@ QCString PageDefImpl::getOutputFileBase() const return m_fileName; } -void PageDefImpl::setFileName(const char *name) +void PageDefImpl::setFileName(const QCString &name) { m_fileName = name; } @@ -232,7 +232,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol) if (si->title() != manPageName) { ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE, - 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); + QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); ol.endSection(si->label(),si->type()); } } @@ -252,7 +252,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol) //ol.startSection(si->label,si->title,si->type); startTitle(ol,getOutputFileBase(),this); ol.generateDoc(docFile(),getStartBodyLine(),this,0,si->title(),TRUE,FALSE, - 0,TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); + QCString(),TRUE,FALSE,Config_getBool(MARKDOWN_SUPPORT)); //stringToSearchIndex(getOutputFileBase(), // theTranslator->trPage(TRUE,TRUE)+" "+si->title, // si->title); @@ -286,7 +286,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol) ol.popGeneratorState(); //1.} - Doxygen::indexList->addIndexItem(this,0,0,filterTitle(title().str())); + Doxygen::indexList->addIndexItem(this,0,QCString(),filterTitle(title().str())); } void PageDefImpl::writePageDocumentation(OutputList &ol) const @@ -308,7 +308,7 @@ void PageDefImpl::writePageDocumentation(OutputList &ol) const docStr, // docStr TRUE, // index words FALSE, // not an example - 0, // exampleName + QCString(), // exampleName FALSE, // singleLine FALSE, // linkFromIndex TRUE // markdown support |