|
PEBL 2.2
Psychology Experiment Building Language - Cross-platform psychological experiment development system
|
#include <ZipExtractor.h>
Classes | |
| struct | Result |
Static Public Member Functions | |
| static Result | ExtractAll (const std::string &zipPath, const std::string &destPath) |
| static Result | ExtractFile (const std::string &zipPath, const std::string &fileInZip, const std::string &destPath) |
| static Result | ReadFile (const std::string &zipPath, const std::string &fileInZip, std::string &outContents) |
| static Result | ListContents (const std::string &zipPath, std::vector< std::string > &outFiles) |
| static bool | ContainsFile (const std::string &zipPath, const std::string &fileInZip) |
| static Result | Validate (const std::string &zipPath) |
| static Result | ValidateSnapshot (const std::string &zipPath) |
ZipExtractor - Cross-platform ZIP file extraction utility
Uses libzip to extract PEBL snapshot packages and validate their contents. Supports reading files without full extraction for validation dialogs.
Definition at line 13 of file ZipExtractor.h.
|
static |
Check if ZIP contains a specific file
| zipPath | Path to ZIP file |
| fileInZip | Path of file to check for |
Definition at line 247 of file ZipExtractor.cpp.
Referenced by ValidateSnapshot().
|
static |
Extract entire ZIP archive to destination directory Creates destination directory if it doesn't exist
| zipPath | Path to ZIP file |
| destPath | Destination directory (will be created) |
Definition at line 18 of file ZipExtractor.cpp.
References PATH_SEPARATOR.
|
static |
Extract single file from ZIP to destination path
| zipPath | Path to ZIP file |
| fileInZip | Path of file within ZIP (e.g., "study-info.json") |
| destPath | Destination file path |
Definition at line 109 of file ZipExtractor.cpp.
|
static |
List all files and directories in ZIP
| zipPath | Path to ZIP file |
| outFiles | Vector to receive list of file paths |
Definition at line 219 of file ZipExtractor.cpp.
Referenced by ValidateSnapshot().
|
static |
Read file contents from ZIP without extracting Useful for validation and preview before extraction
| zipPath | Path to ZIP file |
| fileInZip | Path of file within ZIP |
| outContents | String to receive file contents |
Definition at line 171 of file ZipExtractor.cpp.
|
static |
Validate ZIP file integrity Checks if file is a valid ZIP and not corrupted
| zipPath | Path to ZIP file |
Definition at line 263 of file ZipExtractor.cpp.
Referenced by ValidateSnapshot().
|
static |
Validate that ZIP is a PEBL snapshot package Checks for required files: study-info.json, tests/ directory
| zipPath | Path to ZIP file |
Definition at line 280 of file ZipExtractor.cpp.
References ContainsFile(), ListContents(), ZipExtractor::Result::success, and Validate().