|
HDK
|
#include <zipFile.h>
Public Member Functions | |
| SDF_API | SdfZipFileWriter () |
| Create an invalid SdfZipFileWriter object. More... | |
| SDF_API | ~SdfZipFileWriter () |
| Calls Save() More... | |
| SdfZipFileWriter (const SdfZipFileWriter &)=delete | |
| SdfZipFileWriter & | operator= (const SdfZipFileWriter &)=delete |
| SDF_API | SdfZipFileWriter (SdfZipFileWriter &&rhs) |
| SDF_API SdfZipFileWriter & | operator= (SdfZipFileWriter &&rhs) |
| SDF_API | operator bool () const |
| Returns true if this is a valid object, false otherwise. More... | |
| SDF_API std::string | AddFile (const std::string &filePath, const std::string &filePathInArchive=std::string()) |
| SDF_API bool | Save () |
| SDF_API void | Discard () |
Static Public Member Functions | |
| static SDF_API SdfZipFileWriter | CreateNew (const std::string &filePath) |
Class for writing a zip file. This class is primarily intended to support the .usdz file format. It is not a general-purpose zip writer, as it does not implement the full zip file specification. However, all files written by this class should be valid zip files and readable by external zip libraries and utilities.
| SDF_API SdfZipFileWriter::SdfZipFileWriter | ( | ) |
Create an invalid SdfZipFileWriter object.
|
delete |
| SDF_API SdfZipFileWriter::SdfZipFileWriter | ( | SdfZipFileWriter && | rhs | ) |
| SDF_API std::string SdfZipFileWriter::AddFile | ( | const std::string & | filePath, |
| const std::string & | filePathInArchive = std::string() |
||
| ) |
Adds the file at filePath to the zip archive with no compression applied. If filePathInArchive is non-empty, the file will be added at that path in the archive. Otherwise, it will be added at filePath.
Returns the file path used to identify the file in the zip archive on success. This path conforms to the zip file specification and may not be the same as filePath or filePathInArchive. Returns an empty string on failure.
|
static |
Create a new file writer with filePath as the destination file path where the zip archive will be written. The zip file will not be written to filePath until the writer is destroyed or Save() is called.
Returns an invalid object on error.
Discards the zip archive so that it is not saved to the destination file path. Once discarded, the file writer is invalid and may not be reused.
|
inlineexplicit |
|
delete |
| SDF_API SdfZipFileWriter& SdfZipFileWriter::operator= | ( | SdfZipFileWriter && | rhs | ) |
| SDF_API bool SdfZipFileWriter::Save | ( | ) |
Finalizes the zip archive and saves it to the destination file path. Once saved, the file writer is invalid and may not be reused. Returns true on success, false otherwise.