InMemoryOpcPackage

InMemoryOpcPackage

Overview

InMemoryOpcPackage is a class in Aspose.Slides FOSS for C++.

In-memory OPC package with ZIP file I/O support. Manages an Open Packaging Conventions package as an in-memory map of part names to byte arrays. Supports loading from and saving to ZIP archives (file paths or streams), preserving unknown parts for round-trip fidelity.

This class provides 14 methods for working with InMemoryOpcPackage objects in C++ programs. Available methods include: InMemoryOpcPackage, close, create_new, delete_part, get_part, get_part_names, has_part, open, save, set_part, source_path. All public members are accessible to any C++ application after installing the Aspose.Slides FOSS for C++ package.

Methods

SignatureDescription
InMemoryOpcPackage()
open(path: std::filesystem::path)InMemoryOpcPackageOpen an OPC package from a file path.
open(stream: std::istream)InMemoryOpcPackageOpen an OPC package from a file path.
create_new()InMemoryOpcPackageCreate a new empty OPC package.
save(path: std::filesystem::path)Save the package to a file path as a ZIP archive.
save(stream: std::ostream)Save the package to a file path as a ZIP archive.
get_part(part_name: std::string_view)std::optional<std::vector<uint8_t>>Retrieve a part’s content by name. Returns nullopt if the part does not exist.
set_part(part_name: std::string_view, content: std::vector<uint8_t>)Store (or overwrite) a part with the given content.
set_part(part_name: std::string_view, content: std::string_view)Store (or overwrite) a part with the given content.
has_part(part_name: std::string_view)boolCheck whether a part exists in the package.
delete_part(part_name: std::string_view)boolDelete a part from the package.
get_part_names()std::vector<std::string>Get a list of all part names in the package.
source_path()std::optional<std::string>Get the original file path if the package was loaded from a file.
close()Close the package and release resources. Clears all in-memory part data. The package should not be used after closing.

See Also

 English