|
KiCad PCB EDA Suite
|
Stage related design and library files together, retaining originals until every write is ready. More...
#include <downgrade_scan.h>
Classes | |
| struct | ENTRY |
Public Member Functions | |
| DOWNGRADE_FILE_TRANSACTION ()=default | |
| DOWNGRADE_FILE_TRANSACTION (const DOWNGRADE_FILE_TRANSACTION &)=delete | |
| DOWNGRADE_FILE_TRANSACTION & | operator= (const DOWNGRADE_FILE_TRANSACTION &)=delete |
| ~DOWNGRADE_FILE_TRANSACTION () | |
| wxString | Stage (const wxString &aDestination) |
| Return an exclusively-created sibling staging file, or empty if it cannot be created. | |
| void | Discard (const wxString &aTemporary) |
| Forget a skipped conversion without exposing its empty staging file as an output. | |
| wxString | Commit () |
| Replace all destinations, rolling back earlier replacements if a rename fails. | |
| const wxString & | GetRecoveryError () const |
| Recovery details are nonempty only if restoring an original or removing a new output failed. | |
Private Member Functions | |
| void | rollback () |
Static Private Member Functions | |
| static void | removeOwnedFile (const wxString &aPath) |
| static bool | ownedFileExists (const wxString &aPath) |
| static std::filesystem::path | nativePath (const wxString &aPath) |
Private Attributes | |
| std::vector< ENTRY > | m_entries |
| bool | m_finished = false |
| wxString | m_recoveryError |
Stage related design and library files together, retaining originals until every write is ready.
Definition at line 248 of file downgrade_scan.h.
|
default |
Referenced by DOWNGRADE_FILE_TRANSACTION(), and operator=().
|
delete |
References DOWNGRADE_FILE_TRANSACTION().
|
inline |
Definition at line 255 of file downgrade_scan.h.
References m_entries, and removeOwnedFile().
|
inline |
Replace all destinations, rolling back earlier replacements if a rename fails.
Returns the failed destination, or empty after a successful commit.
Definition at line 311 of file downgrade_scan.h.
References m_entries, m_finished, nativePath(), and rollback().
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DowngradeLibraryFilesInPlace(), EESCHEMA_JOBS_HANDLER::JobDowngrade(), and PCBNEW_JOBS_HANDLER::JobDowngrade().
|
inline |
Forget a skipped conversion without exposing its empty staging file as an output.
Definition at line 296 of file downgrade_scan.h.
References m_entries, and removeOwnedFile().
Referenced by BOOST_AUTO_TEST_CASE(), and DowngradeLibraryFilesInPlace().
|
inline |
Recovery details are nonempty only if restoring an original or removing a new output failed.
Definition at line 393 of file downgrade_scan.h.
References m_recoveryError.
Referenced by BOOST_AUTO_TEST_CASE(), DowngradeLibraryFilesInPlace(), EESCHEMA_JOBS_HANDLER::JobDowngrade(), and PCBNEW_JOBS_HANDLER::JobDowngrade().
|
inlinestaticprivate |
Definition at line 421 of file downgrade_scan.h.
Referenced by Commit(), and ownedFileExists().
|
delete |
References DOWNGRADE_FILE_TRANSACTION().
|
inlinestaticprivate |
Definition at line 412 of file downgrade_scan.h.
References nativePath().
Referenced by removeOwnedFile(), and rollback().
|
inlinestaticprivate |
Definition at line 406 of file downgrade_scan.h.
References ownedFileExists().
Referenced by Discard(), and ~DOWNGRADE_FILE_TRANSACTION().
|
inlineprivate |
Definition at line 430 of file downgrade_scan.h.
References _, DOWNGRADE_FILE_TRANSACTION::ENTRY::m_attemptedReplacement, DOWNGRADE_FILE_TRANSACTION::ENTRY::m_backup, DOWNGRADE_FILE_TRANSACTION::ENTRY::m_destination, m_entries, DOWNGRADE_FILE_TRANSACTION::ENTRY::m_hadOriginal, DOWNGRADE_FILE_TRANSACTION::ENTRY::m_keepBackup, m_recoveryError, and ownedFileExists().
Referenced by Commit().
|
inline |
Return an exclusively-created sibling staging file, or empty if it cannot be created.
Definition at line 267 of file downgrade_scan.h.
References DOWNGRADE_FILE_TRANSACTION::ENTRY::m_destination, m_entries, m_finished, and DOWNGRADE_FILE_TRANSACTION::ENTRY::m_temp.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), DowngradeLibraryFilesInPlace(), EESCHEMA_JOBS_HANDLER::JobDowngrade(), and PCBNEW_JOBS_HANDLER::JobDowngrade().
|
private |
Definition at line 462 of file downgrade_scan.h.
Referenced by Commit(), Discard(), rollback(), Stage(), and ~DOWNGRADE_FILE_TRANSACTION().
|
private |
Definition at line 463 of file downgrade_scan.h.
|
private |
Definition at line 464 of file downgrade_scan.h.
Referenced by GetRecoveryError(), and rollback().