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/markdown.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/markdown.h')
-rw-r--r-- | src/markdown.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/markdown.h b/src/markdown.h index 6744149..afed003 100644 --- a/src/markdown.h +++ b/src/markdown.h @@ -32,7 +32,7 @@ QCString markdownFileNameToId(const QCString &fileName); class Markdown { public: - Markdown(const char *fileName,int lineNr,int indentLevel=0); + Markdown(const QCString &fileName,int lineNr,int indentLevel=0); QCString process(const QCString &input, int &startNewlines); QCString extractPageTitle(QCString &docs,QCString &id,int &prepend); void setIndentLevel(int level) { m_indentLevel = level; } @@ -73,7 +73,7 @@ class Markdown private: struct LinkRef { - LinkRef(const char *l,const char *t) : link(l), title(t) {} + LinkRef(const QCString &l,const QCString &t) : link(l), title(t) {} QCString link; QCString title; }; @@ -93,12 +93,12 @@ class MarkdownOutlineParser : public OutlineParserInterface public: MarkdownOutlineParser(); virtual ~MarkdownOutlineParser(); - void parseInput(const char *fileName, + void parseInput(const QCString &fileName, const char *fileBuf, const std::shared_ptr<Entry> &root, ClangTUParser *clangParser); bool needsPreprocessing(const QCString &) const { return FALSE; } - void parsePrototype(const char *text); + void parsePrototype(const QCString &text); private: struct Private; std::unique_ptr<Private> p; |