#include <projectsaveoutputs.h>
|
| QList< PreparedOutput > | preparedOutputs () const |
| | Snapshot final paths, current staging paths and roles in preparation order.
|
| |
| void | protect (const QString &path, int allowedRole) |
| | Register an input identity that outputs with other roles must preserve.
|
| |
| void | protectDirectory (const QString &path) |
| | Exclude a directory and all descendants from publication.
|
| |
| const QString & | error () const |
| | Access the most recently recorded transaction diagnostic.
|
| |
| bool | publicationStarted () const |
| | Inspect whether this transaction attempted any final-file replacement.
|
| |
| bool | recoveryRequired () const |
| | Inspect the stored publication/rollback state.
|
| |
| QString | stage (const QString &path, Role role, bool reuse=false, const DestinationState *expected=nullptr) |
| | Reserve an owned temporary file for a checked final destination.
|
| |
| bool | publish () |
| | Validate and publish the complete staged set with a checked rollback journal.
|
| |
|
| static bool | captureDestination (const QString &path, DestinationState *state, QString *error=nullptr) |
| | Snapshot a destination's physical identity and SHA-256 content, without creating directories.
|
| |
| static bool | recover (const QString &model, QString *error, QString *notice=nullptr) |
| | Acquire the project save lock and repair or finish an existing checked recovery journal.
|
| |
◆ Role
| Enumerator |
|---|
| Model | |
| Mesh | |
| Component | |
| Settings | |
| Auxiliary | |
◆ captureDestination()
| static bool ProjectSaveOutputs::captureDestination |
( |
const QString & |
path, |
|
|
DestinationState * |
state, |
|
|
QString * |
error = nullptr |
|
) |
| |
|
inlinestatic |
Snapshot a destination's physical identity and SHA-256 content, without creating directories.
- Parameters
-
| [in] | path | Nonempty destination; a currently absent file is valid. |
| [out] | state | Required result, reset before validation; filled only on success. |
| [out] | error | Optional diagnostic, cleared before inspection. |
- Returns
- False for invalid inputs, unreadable content, resolution failure or identity changing during inspection.
◆ error()
| const QString & ProjectSaveOutputs::error |
( |
| ) |
const |
|
inline |
Access the most recently recorded transaction diagnostic.
- Returns
- Transaction-owned text; successful operations do not uniformly clear an earlier error.
◆ preparedOutputs()
Snapshot final paths, current staging paths and roles in preparation order.
- Returns
- Value list; the transaction retains staging-file ownership and removes them on destruction.
◆ protect()
| void ProjectSaveOutputs::protect |
( |
const QString & |
path, |
|
|
int |
allowedRole |
|
) |
| |
|
inline |
Register an input identity that outputs with other roles must preserve.
- Parameters
-
| [in] | path | Protected file path; empty is ignored. |
| [in] | allowedRole | Role allowed to replace it, or -1 to disallow every output role. |
◆ protectDirectory()
| void ProjectSaveOutputs::protectDirectory |
( |
const QString & |
path | ) |
|
|
inline |
Exclude a directory and all descendants from publication.
- Parameters
-
| [in] | path | Directory namespace, including an absent directory; empty is ignored. Both logical and physical identities are checked. |
◆ publicationStarted()
| bool ProjectSaveOutputs::publicationStarted |
( |
| ) |
const |
|
inline |
Inspect whether this transaction attempted any final-file replacement.
- Returns
- True once publication enters its first write; it can remain true after rollback or commit.
◆ publish()
| bool ProjectSaveOutputs::publish |
( |
| ) |
|
|
inline |
Validate and publish the complete staged set with a checked rollback journal.
- Returns
- True after committing the new set; false sets error() and attempts restoration once a journal exists.
- Note
- Requires a staged Model. Publishes Component, Mesh, Auxiliary, Settings then Model; hash/identity checks precede and follow writes. Cleanup after a committed journal may be retried on open. Use once per transaction and serialize calls; the lock coordinates cooperating project savers, not arbitrary external writers.
◆ recover()
| static bool ProjectSaveOutputs::recover |
( |
const QString & |
model, |
|
|
QString * |
error, |
|
|
QString * |
notice = nullptr |
|
) |
| |
|
inlinestatic |
Acquire the project save lock and repair or finish an existing checked recovery journal.
- Parameters
-
| [in] | model | Model path identifying the adjacent journal/lock. |
| [out] | error | Optional failure diagnostic; unchanged on success. |
| [out] | notice | Optional recovery explanation, set only when a journal was processed. |
- Returns
- True when no recovery is needed or recovery completes. False retains recovery evidence when validation/repair fails.
- Note
- Uncommitted journals restore old bytes and permissions; committed journals verify new bytes and clean up. Unknown changed files are never silently overwritten.
◆ recoveryRequired()
| bool ProjectSaveOutputs::recoveryRequired |
( |
| ) |
const |
|
inline |
Inspect the stored publication/rollback state.
- Returns
- publicationStarted() and no recorded successful rollback; this also remains true after a successful commit, so it does not prove a journal exists.
◆ stage()
| QString ProjectSaveOutputs::stage |
( |
const QString & |
path, |
|
|
Role |
role, |
|
|
bool |
reuse = false, |
|
|
const DestinationState * |
expected = nullptr |
|
) |
| |
|
inline |
Reserve an owned temporary file for a checked final destination.
- Parameters
-
| [in] | path | Nonempty final path. Model/settings parents must already exist; other roles stage in the nearest existing ancestor. |
| [in] | role | Publication role; Model acquires the project lock and anchors recovery metadata. |
| [in] | reuse | Permit returning an existing stage only for the same exact final spelling and role. |
| [in] | expected | Optional previously captured destination identity/hash that must still match. |
- Returns
- Writable staging path, or empty with error() on protection, alias, permission, lock or IO failure.
- Note
- No final directories/files are created here. Partial reservations remain owned by the transaction on a later failure.
◆ ProjectSaveOutputsTestAccess
| friend class ProjectSaveOutputsTestAccess |
|
friend |
The documentation for this class was generated from the following file: