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/definition.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/definition.h')
-rw-r--r-- | src/definition.h | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/definition.h b/src/definition.h index 66d7628..6a1edfa 100644 --- a/src/definition.h +++ b/src/definition.h @@ -264,7 +264,7 @@ class Definition virtual const RefItemVector &xrefListItems() const = 0; - virtual const Definition *findInnerCompound(const char *name) const = 0; + virtual const Definition *findInnerCompound(const QCString &name) const = 0; virtual Definition *getOuterScope() const = 0; virtual std::vector<const MemberDef *> getReferencesMembers() const = 0; @@ -317,30 +317,30 @@ class DefinitionMutable //----------------------------------------------------------------------------------- /*! Sets a new \a name for the definition */ - virtual void setName(const char *name) = 0; + virtual void setName(const QCString &name) = 0; /*! Sets a unique id for the symbol. Used for libclang integration. */ - virtual void setId(const char *name) = 0; + virtual void setId(const QCString &name) = 0; /*! Set a new file name and position */ virtual void setDefFile(const QCString& df,int defLine,int defColumn) = 0; /*! Sets the documentation of this definition to \a d. */ - virtual void setDocumentation(const char *d,const char *docFile,int docLine,bool stripWhiteSpace=TRUE) = 0; + virtual void setDocumentation(const QCString &d,const QCString &docFile,int docLine,bool stripWhiteSpace=TRUE) = 0; /*! Sets the brief description of this definition to \a b. * A dot is added to the sentence if not available. */ - virtual void setBriefDescription(const char *b,const char *briefFile,int briefLine) = 0; + virtual void setBriefDescription(const QCString &b,const QCString &briefFile,int briefLine) = 0; /*! Set the documentation that was found inside the body of an item. * If there was already some documentation set, the new documentation * will be appended. */ - virtual void setInbodyDocumentation(const char *d,const char *docFile,int docLine) = 0; + virtual void setInbodyDocumentation(const QCString &d,const QCString &docFile,int docLine) = 0; /*! Sets the tag file id via which this definition was imported. */ - virtual void setReference(const char *r) = 0; + virtual void setReference(const QCString &r) = 0; // source references virtual void setBodySegment(int defLine, int bls,int ble) = 0; @@ -353,7 +353,7 @@ class DefinitionMutable virtual void setArtificial(bool b) = 0; virtual void setLanguage(SrcLangExt lang) = 0; - virtual void setLocalName(const QCString name) = 0; + virtual void setLocalName(const QCString &name) = 0; //----------------------------------------------------------------------------------- // --- actions ---- @@ -377,10 +377,10 @@ class DefinitionMutable //----------------------------------------------------------------------------------- // --- writing output ---- //----------------------------------------------------------------------------------- - virtual void writeSourceDef(OutputList &ol,const char *scopeName) const = 0; - virtual void writeInlineCode(OutputList &ol,const char *scopeName) const = 0; - virtual void writeSourceRefs(OutputList &ol,const char *scopeName) const = 0; - virtual void writeSourceReffedBy(OutputList &ol,const char *scopeName) const = 0; + virtual void writeSourceDef(OutputList &ol,const QCString &scopeName) const = 0; + virtual void writeInlineCode(OutputList &ol,const QCString &scopeName) const = 0; + virtual void writeSourceRefs(OutputList &ol,const QCString &scopeName) const = 0; + virtual void writeSourceReffedBy(OutputList &ol,const QCString &scopeName) const = 0; virtual void writeNavigationPath(OutputList &ol) const = 0; virtual void writeQuickMemberLinks(OutputList &,const MemberDef *) const = 0; virtual void writeSummaryLinks(OutputList &) const = 0; @@ -404,7 +404,7 @@ DefinitionMutable *toDefinitionMutable(const Definition *d); * via \a result. The function returns TRUE if successful and FALSE * in case of an error. */ -bool readCodeFragment(const char *fileName, +bool readCodeFragment(const QCString &fileName, int &startLine,int &endLine, QCString &result); #endif |