Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
OutputConfiguration Struct Reference

Adds publication destinations to a resolved output selection. More...

#include <outputconfiguration.h>

Collaboration diagram for OutputConfiguration:

Classes

struct  FormatPlan
 \typealias OutputConfiguration::Mode More...

Public Types

using Mode = OutputSelection::Mode
using Diagnostic = OutputSelection::Diagnostic

Public Member Functions

bool hasErrors () const
 Returns true if a selection or layout diagnostic blocks publication.
const FormatPlan * findFormat (const QString &formatformat) const
 Returns the plan for the case-sensitive identity format, or {nullptr} if absent.
QString destination (const FormatPlan &plan) const
 Returns the normalized root, format directory, and module directory for plan.

Static Public Member Functions

static OutputConfiguration resolve (const Config &configconfig, const OutputConfigurationInput &inputinput={})
 \variable OutputConfiguration::FormatPlan::formatDir

Public Attributes

Mode mode = Mode::Compatibility
QVector< Pipeline > pipelines
QString root
QVector< FormatPlan > formats
QVector< Diagnostic > diagnostics

Detailed Description

Adds publication destinations to a resolved output selection.

\inmodule QDoc

Resolution consumes OutputSelection without constructing generators, parsing source, creating output, or emitting diagnostics. Compatibility mode remains a marker for the unchanged legacy interpretation, not a new layout plan.

The first configured format defaults to the publication root. Later configured formats and CLI-only formats default to lower-case format names. Explicit {<Format>.outputsubdir} values apply literally, including empty and {../} values. Replacing requested formats or moving the first format does not promote another configured format into the root.

Layout precedence is {<Format>.publicationlayout}, {publicationlayout}, the explicit deprecated {<Format>.nosubdirs} alias, then Flat. The alias maps true to Flat and false, including an empty declaration, to PerModule. Invalid or empty new layout values are errors, not a request to use an inherited alias. PerModule requires a safe module directory component.

Equal normalized destinations for requested formats are errors; nested trees are allowed. Before writing, consumers must also validate filesystem aliases and case, reserved subtrees, and actual artifact ownership. Lexical planning neither performs those checks nor authorizes filesystem writes.

Definition at line 72 of file outputconfiguration.h.

Member Typedef Documentation

◆ Diagnostic

◆ Mode

Member Function Documentation

◆ destination()

QString OutputConfiguration::destination ( const FormatPlan & plan) const
nodiscard

Returns the normalized root, format directory, and module directory for plan.

Use an entry from this configuration after checking hasErrors().

A root-only path is normalized too; {.} denotes the current directory. This query does not create directories, require their existence, resolve filesystem aliases, or check whether the entry is requested.

Definition at line 806 of file outputconfiguration.cpp.

◆ findFormat()

const OutputConfiguration::FormatPlan * OutputConfiguration::findFormat ( const QString & format) const
nodiscard

Returns the plan for the case-sensitive identity format, or {nullptr} if absent.

A configured entry can be present without being requested.

The pointer borrows storage from this configuration and remains valid only while that storage is alive and unchanged. It does not certify plan validity.

Definition at line 789 of file outputconfiguration.cpp.

◆ hasErrors()

bool OutputConfiguration::hasErrors ( ) const
nodiscard

Returns true if a selection or layout diagnostic blocks publication.

Migration notices alone do not invalidate the configuration.

Definition at line 773 of file outputconfiguration.cpp.

◆ resolve()

OutputConfiguration OutputConfiguration::resolve ( const Config & config,
const OutputConfigurationInput & input = {} )
staticnodiscard

\variable OutputConfiguration::FormatPlan::formatDir

The literal or default format directory relative to the publication root.

Empty means the root. Parent components are deliberate, not an instruction to rewrite the destination to remain under the root.

\variable OutputConfiguration::FormatPlan::formatDirLocation

The directory declaration, or the format-list origin for a default directory.

CLI-only defaults and programmatic declarations can have an empty location.

\variable OutputConfiguration::FormatPlan::layout

The resolved policy for adding a module directory.

\variable OutputConfiguration::FormatPlan::layoutLocation

The effective layout or deprecated-alias declaration, if one applies.

This is empty for the implicit Flat default or absent source provenance.

\variable OutputConfiguration::FormatPlan::moduleDir

The lower-case project directory for PerModule, or empty for Flat.

An invalid PerModule identity leaves this empty and produces an error for a requested format. It must not be interpreted as a valid Flat fallback.

\variable OutputConfiguration::mode

The interpretation mode inherited from output selection.

\variable OutputConfiguration::pipelines

The available enabled pipelines inherited from output selection.

\variable OutputConfiguration::root

The publication root before complete-path normalization.

The invocation's output-directory override wins over configured {outputdir}. Empty means the current directory. The override replaces only the root, not the format or module layout.

\variable OutputConfiguration::formats

The configured and CLI-only format plans in selection order.

Only entries whose inherited {requested} value is true claim destinations.

\variable OutputConfiguration::diagnostics

The combined, deduplicated selection and layout diagnostics.

These records have no emission or warning-budget side effects.

Resolves selection and destination layout from config and input.

Also reads the invocation's output-directory override from Config. Returns a compatibility marker without destinations when the new model is not selected. Errors remain data; the caller must reject an invalid plan before any publication writes.

Definition at line 679 of file outputconfiguration.cpp.

References OutputSelection::Compatibility, OutputSelection::Diagnostic::Error, Flat, OutputConfiguration::FormatPlan::layout, mode, OutputSelection::Diagnostic::Notice, PerModule, and OutputSelection::resolve().

Here is the call graph for this function:

Member Data Documentation

◆ diagnostics

QVector<Diagnostic> OutputConfiguration::diagnostics

Definition at line 90 of file outputconfiguration.h.

◆ formats

QVector<FormatPlan> OutputConfiguration::formats

Definition at line 89 of file outputconfiguration.h.

◆ mode

Mode OutputConfiguration::mode = Mode::Compatibility

Definition at line 86 of file outputconfiguration.h.

Referenced by resolve().

◆ pipelines

QVector<Pipeline> OutputConfiguration::pipelines

Definition at line 87 of file outputconfiguration.h.

◆ root

QString OutputConfiguration::root

Definition at line 88 of file outputconfiguration.h.


The documentation for this struct was generated from the following files: