Paul WickingandTopi Reinio 575e9c7fad QDoc: Add \compareswith command
This patch introduces a new block command, `\compareswith` and
`\endcompareswith`, to QDoc.

The `\compareswith` command takes two arguments: a comparison category
and a space-delimited list of types for which the comparison category
applies. The comparison category argument must be one of the following:

  `strong`
  `weak`
  `partial`
  `equality`

The comparison category statement is generated as part of class
documentation, immediately preceding the admonition about thread
safety, and outputs e.g:

    `This class is equality-comparable with Foo, Bar, and Baz.`

Any text that follows the `\compareswith` command prior to the closing
`\endcomparewith` command is generated immediately following the
comparison category statement.

This patch makes the following changes to QDoc:
- The command is added to the command hierarchy in `DocParser`,
  as is code for processing the command.
- `DocPrivate` is modified to keep a map of comparison categories, a
  list of types, and the detailed description.
- `Doc` is modified such that the above map can be retrieved.
- A new method is added to the `Generator` base class for generators.
  The `HTMLGenerator` and `DocBookGenerator` subclasses are modified
  to generate the comparison category listing for comparable types.
- Documentation of the new command is added to the QDoc manual.
- The `generatedOutput` test documentation project for the related
  \compares command is extended to exercise the new command.
- Two new atom types, `ComparesLeft`, `ComparesRight`, are introduced.
- `Text` sees the addition of a new private constructor,
  `Text(Atom*, Atom*)`, as well as the public method
  `splitAtFirst(Atom::AtomType)`.
- The generated output test for QDoc is extended to exercise the new
  block command in various ways.

In passing, ensure that DocParser::getRestOfLine() (which the
\compareswith command uses) correctly removes trailing backslashes
from a multi-line argument string.

Fixes: QTBUG-117913
Task-number: QTBUG-104110
Task-number: QTBUG-119610
Change-Id: Ie0c78443d2cc8b159594e725102eec5fab2f7598
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
2023-11-30 21:06:01 +00:00
2023-10-04 14:38:21 +03:00
2020-11-27 13:55:40 +00:00
2022-05-19 12:32:28 +00:00
2023-11-30 21:06:01 +00:00
2023-11-28 12:39:41 +01:00
2023-01-30 18:02:44 +01:00
2012-09-03 19:54:35 +02:00
2023-11-28 12:39:41 +01:00
S
Description
No description provided
39 MiB