Overview
This document serves as a guide to the 7-Zip Plugin for managing archives. It includes descriptions of the plugin's purpose, installation instructions, usage examples, and details about the available functions and classes.
1. Introduction
The 7-Zip Plugin is designed to enable the compression and extraction of files in a specified format using the 7-Zip file archiver. This plugin extends 7-Zip's functionality to support additional file formats or features.
2. Installation
To install the 7-Zip Plugin:
- Download the plugin files.
- Copy the plugin
.dll
file to the7-Zip\Plugins
directory. - Restart 7-Zip to load the new plugin.
3. Usage
To use the plugin:
- Adding Files: Right-click on a file or folder in Windows Explorer, choose "Add to archive," and select the plugin format.
- Extracting Files: Open an archive with 7-Zip, and the plugin will be used automatically if the archive format is supported.
4. Plugin Structure
The plugin is structured into several components:
- Classes: Core classes implementing the interface for handling archives.
- Methods: Functions for performing specific actions like opening, closing, extracting, and retrieving properties of the archive.
- Error Handling: Consistent handling of errors and return codes for robustness.
5. Classes and Methods
CHandler
- Description: Main handler class for managing archive operations.
- Methods:
- Open: Opens the archive for reading.
HRESULT
Open
(IInStream
* stream,const UInt64
* offset,IArchiveOpenCallback
* callback)
HRESULT
Extract
(const UInt32
* indices,UInt32
numItems,Int32
testMode,IArchiveExtractCallback
* extractCallback)
HRESULT
GetStream
(UInt32
index,ISequentialInStream
** stream)
CMyComPtr
- Description: A smart pointer class for managing COM object lifetimes.
NCOM::CPropVariant
- Description: A class for handling property variants used in the 7-Zip interface.
6. Error Handling
The plugin uses HRESULT codes to indicate success or failure of operations:
- Operation succed.
S_OK
E_FAIL
E_POINTER
S_FALSE
7. Contributing
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Write tests for your changes.
- Submit a pull request.
8. License
This project is licensed under the MIT License. See the LICENSE file for details.
9. Acknowledgements
Thanks to the 7-Zip community for their support and resources.
Special thanks to developers who contributed to the codebase.