All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UsdZipFileWriter Class Reference

Class for writing a zip file. More...

Public Member Functions

USD_API UsdZipFileWriter ()
 Create an invalid UsdZipFileWriter object. More...
 
USD_API ~UsdZipFileWriter ()
 Calls Save() More...
 
 UsdZipFileWriter (const UsdZipFileWriter &)=delete
 
UsdZipFileWriteroperator= (const UsdZipFileWriter &)=delete
 
USD_API UsdZipFileWriter (UsdZipFileWriter &&rhs)
 
USD_API UsdZipFileWriteroperator= (UsdZipFileWriter &&rhs)
 
USD_API operator bool () const
 Returns true if this is a valid object, false otherwise. More...
 
USD_API std::string AddFile (const std::string &filePath, const std::string &filePathInArchive=std::string())
 Adds the file at filePath to the zip archive with no compression applied. More...
 
USD_API bool Save ()
 Finalizes the zip archive and saves it to the destination file path. More...
 
USD_API void Discard ()
 Discards the zip archive so that it is not saved to the destination file path. More...
 

Static Public Member Functions

static USD_API UsdZipFileWriter CreateNew (const std::string &filePath)
 Create a new file writer with filePath as the destination file path where the zip archive will be written. More...
 

Detailed Description

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.

Definition at line 213 of file zipFile.h.

Constructor & Destructor Documentation

USD_API UsdZipFileWriter ( )

Create an invalid UsdZipFileWriter object.

USD_API ~UsdZipFileWriter ( )

Calls Save()

Member Function Documentation

USD_API std::string 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 USD_API UsdZipFileWriter CreateNew ( const std::string &  filePath)
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.

USD_API void Discard ( )

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.

USD_API operator bool ( ) const
inlineexplicit

Returns true if this is a valid object, false otherwise.

Definition at line 242 of file zipFile.h.

USD_API bool 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.


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