Make QCString behavior more similar to std::string
- Replace resize(0) by clear()
- Replace resize(n+1) by resize(n)
- Replace truncate(n) by resize(n)
Based on the example from #5454 (comments had to be rewriten due to #10104):
- empty comment blocks (also after removing the `@cond` parts) should not be taken into account at all (otherwise subsequent comments can land in the wrong place).
- the white space before the vhdl comment (`--!`) should also be removed (otherwise it can lead to code blocs)
- Split of IndexIntf and IndexList into indexlist.h
- Used a vector of std::variant to store the indices to avoid virtual
dispatch (should allow for better compiler optimisation)
- Used dispatch_call helper to implement efficient foreach construct on the index list
(optimized version std::visit that uses switch on the
variant's index() instead of a jump table).
- replaced raw FTVNode pointer by std::shared_ptr.
- improve encapsulation of EclipseHelp object by moving details to the
implementation file
- also used the dispatch_call helper for searchindex which had a
hardcoded switch per method
In the past the `Config...` functions did a string lookup and the `static` usage was for speed optimization purposes but nowadays this is not necessary anymore as the "lookup" is done through direct lookup in a `struct`. The `static` is counterproductive as this gives extra thread safe locks.
On Windows 64-bit compilation we get warnings like:
```
pre.l(3563): warning C4267: 'initializing': conversion from 'size_t' to 'uint', possible loss of data
```
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()'
Explicit counting of the removed newlines at the beginning of a documenation block (markdown.cpp) so this number can be added to get a better line number in case of warnings.