SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
ProjectSaveOutputs Class Reference

#include <projectsaveoutputs.h>

Collaboration diagram for ProjectSaveOutputs:

Classes

struct  DestinationState
 
struct  PreparedOutput
 

Public Types

enum  Role {
  Model = 0 ,
  Mesh = 1 ,
  Component = 2 ,
  Settings = 3 ,
  Auxiliary = 4
}
 

Public Member Functions

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 Public Member Functions

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.
 

Friends

class ProjectSaveOutputsTestAccess
 

Member Enumeration Documentation

◆ Role

Enumerator
Model 
Mesh 
Component 
Settings 
Auxiliary 

Member Function Documentation

◆ 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]pathNonempty destination; a currently absent file is valid.
[out]stateRequired result, reset before validation; filled only on success.
[out]errorOptional diagnostic, cleared before inspection.
Returns
False for invalid inputs, unreadable content, resolution failure or identity changing during inspection.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ preparedOutputs()

QList< PreparedOutput > ProjectSaveOutputs::preparedOutputs ( ) const
inline

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.
Here is the caller graph for this function:

◆ protect()

void ProjectSaveOutputs::protect ( const QString &  path,
int  allowedRole 
)
inline

Register an input identity that outputs with other roles must preserve.

Parameters
[in]pathProtected file path; empty is ignored.
[in]allowedRoleRole allowed to replace it, or -1 to disallow every output role.
Here is the caller graph for this function:

◆ protectDirectory()

void ProjectSaveOutputs::protectDirectory ( const QString &  path)
inline

Exclude a directory and all descendants from publication.

Parameters
[in]pathDirectory namespace, including an absent directory; empty is ignored. Both logical and physical identities are checked.
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ 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]modelModel path identifying the adjacent journal/lock.
[out]errorOptional failure diagnostic; unchanged on success.
[out]noticeOptional 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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ 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]pathNonempty final path. Model/settings parents must already exist; other roles stage in the nearest existing ancestor.
[in]rolePublication role; Model acquires the project lock and anchors recovery metadata.
[in]reusePermit returning an existing stage only for the same exact final spelling and role.
[in]expectedOptional 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.
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ ProjectSaveOutputsTestAccess

friend class ProjectSaveOutputsTestAccess
friend

The documentation for this class was generated from the following file: