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/index.h | |
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/index.h')
-rw-r--r-- | src/index.h | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/index.h b/src/index.h index a595ec2..a10cbc9 100644 --- a/src/index.h +++ b/src/index.h @@ -36,14 +36,14 @@ class IndexIntf virtual void finalize() = 0; virtual void incContentsDepth() = 0; virtual void decContentsDepth() = 0; - virtual void addContentsItem(bool isDir, const char *name, const char *ref, - const char *file, const char *anchor, bool separateIndex, + virtual void addContentsItem(bool isDir, const QCString &name, const QCString &ref, + const QCString &file, const QCString &anchor, bool separateIndex, bool addToNavIndex,const Definition *def) = 0; virtual void addIndexItem(const Definition *context,const MemberDef *md, - const char *sectionAnchor,const char *title) = 0; - virtual void addIndexFile(const char *name) = 0; - virtual void addImageFile(const char *name) = 0; - virtual void addStyleSheetFile(const char *name) = 0; + const QCString §ionAnchor,const QCString &title) = 0; + virtual void addIndexFile(const QCString &name) = 0; + virtual void addImageFile(const QCString &name) = 0; + virtual void addStyleSheetFile(const QCString &name) = 0; }; /** \brief A list of index interfaces. @@ -93,17 +93,17 @@ class IndexList : public IndexIntf { if (m_enabled) foreach(&IndexIntf::incContentsDepth); } void decContentsDepth() { if (m_enabled) foreach(&IndexIntf::decContentsDepth); } - void addContentsItem(bool isDir, const char *name, const char *ref, - const char *file, const char *anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE, + void addContentsItem(bool isDir, const QCString &name, const QCString &ref, + const QCString &file, const QCString &anchor,bool separateIndex=FALSE,bool addToNavIndex=FALSE, const Definition *def=0) { if (m_enabled) foreach(&IndexIntf::addContentsItem,isDir,name,ref,file,anchor,separateIndex,addToNavIndex,def); } - void addIndexItem(const Definition *context,const MemberDef *md,const char *sectionAnchor=0,const char *title=0) + void addIndexItem(const Definition *context,const MemberDef *md,const QCString §ionAnchor=QCString(),const QCString &title=QCString()) { if (m_enabled) foreach(&IndexIntf::addIndexItem,context,md,sectionAnchor,title); } - void addIndexFile(const char *name) + void addIndexFile(const QCString &name) { if (m_enabled) foreach(&IndexIntf::addIndexFile,name); } - void addImageFile(const char *name) + void addImageFile(const QCString &name) { if (m_enabled) foreach(&IndexIntf::addImageFile,name); } - void addStyleSheetFile(const char *name) + void addStyleSheetFile(const QCString &name) { if (m_enabled) foreach(&IndexIntf::addStyleSheetFile,name); } private: @@ -251,11 +251,11 @@ extern int documentedDirs; extern int documentedHtmlFiles; extern int documentedPages; -void startTitle(OutputList &ol,const char *fileName,const DefinitionMutable *def=0); -void endTitle(OutputList &ol,const char *fileName,const char *name); -void startFile(OutputList &ol,const char *name,const char *manName, - const char *title,HighlightedItem hli=HLI_None, - bool additionalIndices=FALSE,const char *altSidebarName=0); +void startTitle(OutputList &ol,const QCString &fileName,const DefinitionMutable *def=0); +void endTitle(OutputList &ol,const QCString &fileName,const QCString &name); +void startFile(OutputList &ol,const QCString &name,const QCString &manName, + const QCString &title,HighlightedItem hli=HLI_None, + bool additionalIndices=FALSE,const QCString &altSidebarName=QCString()); void endFile(OutputList &ol,bool skipNavIndex=FALSE,bool skipEndContents=FALSE, const QCString &navPath=QCString()); void endFileWithNavPath(const Definition *d,OutputList &ol); |