KiCad PCB EDA Suite
Loading...
Searching...
No Matches
PROJECT_ARCHIVER Class Reference

#include <project_archiver.h>

Public Member Functions

 PROJECT_ARCHIVER ()
 
 ~PROJECT_ARCHIVER ()=default
 

Static Public Member Functions

static bool AreZipArchivesIdentical (const wxString &aZipFileA, const wxString &aZipFileB, REPORTER &aReporter)
 Compare the CRCs of all the files in zip archive to determine whether the archives are identical.
 
static bool Archive (const wxString &aSrcDir, const wxString &aDestFile, REPORTER &aReporter, bool aVerbose=true, bool aIncludeExtraFiles=false)
 Create an archive of the project.
 
static bool Unarchive (const wxString &aSrcFile, const wxString &aDestDir, REPORTER &aReporter)
 Extract an archive of the current project over existing files.
 

Detailed Description

Definition at line 32 of file project_archiver.h.

Constructor & Destructor Documentation

◆ PROJECT_ARCHIVER()

PROJECT_ARCHIVER::PROJECT_ARCHIVER ( )

Definition at line 159 of file project_archiver.cpp.

◆ ~PROJECT_ARCHIVER()

PROJECT_ARCHIVER::~PROJECT_ARCHIVER ( )
default

Member Function Documentation

◆ Archive()

bool PROJECT_ARCHIVER::Archive ( const wxString &  aSrcDir,
const wxString &  aDestFile,
REPORTER aReporter,
bool  aVerbose = true,
bool  aIncludeExtraFiles = false 
)
static

Create an archive of the project.

Parameters
aSrcFileis the full path to the project to be archived.
aDestFileis the full path to the zip file to be created.
aReporteris used to report status.
aVerbosecontrols the verbosity of reported status messages.
aIncludeExtraFilesif true will archive legacy and output files.
Returns
true if the archive was created successfully.

Definition at line 264 of file project_archiver.cpp.

References _, FILEEXT::DesignBlockLibraryTableFileName, FILEEXT::DesignRulesFileExtension, FILEEXT::DrawingSheetFileExtension, FILEEXT::DrillFileExtension, EXT, EXT_NO_PIPE, FILEEXT::FootprintAssignmentFileExtension, FILEEXT::FootprintLibraryTableFileName, FILEEXT::FootprintPlaceFileExtension, FILEEXT::GerberFileExtensionsRegex, FILEEXT::GerberJobFileExtension, PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER::GetErrorOccurred(), PROJECT_ARCHIVER_DIR_ZIP_TRAVERSER::GetUncompressedBytes(), FILEEXT::IbisFileExtension, FILEEXT::IpcD356FileExtension, FILEEXT::JsonFileExtension, FILEEXT::KiCadFootprintFileExtension, FILEEXT::KiCadJobSetFileExtension, FILEEXT::KiCadPcbFileExtension, FILEEXT::KiCadSchematicFileExtension, FILEEXT::KiCadSymbolLibFileExtension, FILEEXT::LegacyFootprintLibPathExtension, FILEEXT::LegacyPcbFileExtension, FILEEXT::LegacyProjectFileExtension, FILEEXT::LegacySchematicFileExtension, FILEEXT::LegacySymbolDocumentFileExtension, FILEEXT::LegacySymbolLibFileExtension, KIPLATFORM::IO::LongPathAdjustment(), NAME, NAME_NO_PIPE, FILEEXT::NetlistFileExtension, FILEEXT::PdfFileExtension, FILEEXT::ProjectFileExtension, FILEEXT::ProjectLocalSettingsFileExtension, FILEEXT::PythonFileExtension, REPORTER::Report(), FILEEXT::ReportFileExtension, RPT_SEVERITY_ERROR, RPT_SEVERITY_INFO, FILEEXT::SpiceFileExtension, FILEEXT::SpiceModelFileExtension, FILEEXT::SpiceSubcircuitFileExtension, FILEEXT::StepFileAbrvExtension, FILEEXT::StepFileExtension, FILEEXT::SymbolLibraryTableFileName, FILEEXT::TextFileExtension, FILEEXT::VrmlFileExtension, and FILEEXT::WorkbookFileExtension.

Referenced by SETTINGS_MANAGER::BackupProject(), and KICAD_MANAGER_FRAME::OnArchiveFiles().

◆ AreZipArchivesIdentical()

bool PROJECT_ARCHIVER::AreZipArchivesIdentical ( const wxString &  aZipFileA,
const wxString &  aZipFileB,
REPORTER aReporter 
)
static

Compare the CRCs of all the files in zip archive to determine whether the archives are identical.

Parameters
aZipFileAis the full path to the first zip.
aZipFileBis the full path to the second zip.
aReporteris used to report status.
Returns
true if the archives are identical.

Definition at line 164 of file project_archiver.cpp.

References _, REPORTER::Report(), and RPT_SEVERITY_ERROR.

Referenced by SETTINGS_MANAGER::TriggerBackupIfNeeded().

◆ Unarchive()

bool PROJECT_ARCHIVER::Unarchive ( const wxString &  aSrcFile,
const wxString &  aDestDir,
REPORTER aReporter 
)
static

Extract an archive of the current project over existing files.

Warning
This will overwrite files in the project directory. Use with care. The caller is responsible for doing any reloading of state after taking this action.
Parameters
aSrcFileis the full path to the archive to extract.
aDestDiris the target directory to unarchive to.
aReporteris used to report status.
Returns
true if the archive was created successfully.

Definition at line 198 of file project_archiver.cpp.

References _, CopyStreamData(), REPORTER::Report(), RPT_SEVERITY_ERROR, and RPT_SEVERITY_INFO.

Referenced by KICAD_MANAGER_FRAME::OnUnarchiveFiles().


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