24 #ifndef PXR_USD_USD_ZIP_FILE_H
25 #define PXR_USD_USD_ZIP_FILE_H
28 #include "pxr/usd/usd/api.h"
35 PXR_NAMESPACE_OPEN_SCOPE
81 explicit operator bool()
const {
return static_cast<bool>(_impl); }
123 explicit _ArrowProxy(
const std::string& s) : _s(s) { }
124 const std::string*
operator->()
const {
return &_s; }
129 using difference_type = std::ptrdiff_t;
130 using value_type = std::string;
131 using pointer = _ArrowProxy;
132 using reference = std::string;
133 using iterator_category = std::forward_iterator_tag;
136 Iterator& operator++();
138 Iterator operator++(
int);
141 bool operator==(
const Iterator& rhs)
const;
143 bool operator!=(
const Iterator& rhs)
const;
168 friend class UsdZipFile;
169 Iterator(
const _Impl* impl);
184 Iterator
end()
const;
192 Iterator
Find(
const std::string& path)
const;
202 std::shared_ptr<_Impl> _impl;
233 UsdZipFileWriter& operator=(
const UsdZipFileWriter&) =
delete;
238 UsdZipFileWriter& operator=(UsdZipFileWriter&& rhs);
242 explicit operator bool()
const {
return static_cast<bool>(_impl); }
254 std::string
AddFile(
const std::string& filePath,
255 const std::string& filePathInArchive = std::string());
273 std::unique_ptr<_Impl> _impl;
276 PXR_NAMESPACE_CLOSE_SCOPE
278 #endif // PXR_USD_USD_ZIP_FILE_H
USD_API bool Save()
Finalizes the zip archive and saves it to the destination file path.
USD_API UsdZipFile()
Create an invalid UsdZipFile object.
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 wri...
size_t size
Size of this file as stored in the zip archive.
USD_API const char * GetFile() const
Returns pointer to the beginning of the current file in the zip archive.
Class for reading a zip file.
USD_API pointer operator->() const
Returns filename of the current file in the zip archive.
Iterator for traversing and inspecting the contents of the zip archive.
USD_API Iterator begin() const
Returns iterator pointing to the first file in the zip archive.
Interface for accessing the contents of an asset.
USD_API void DumpContents() const
Print out listing of contents of this zip archive to stdout.
Iterator cend() const
Returns end iterator for this zip archive.
static USD_API UsdZipFile Open(const std::string &filePath)
Opens the zip archive at filePath.
USD_API reference operator*() const
Returns filename of the current file in the zip archive.
USD_API FileInfo GetFileInfo() const
Returns FileInfo object containing information about the current file.
USD_API Iterator Find(const std::string &path) const
Returns iterator to the file with the given path in this zip archive, or end() if no such file exists...
Information for a file in the zip archive.
USD_API UsdZipFileWriter()
Create an invalid UsdZipFileWriter object.
bool encrypted
Whether or not this file is encrypted.
USD_API Iterator end() const
Returns end iterator for this zip archive.
Iterator cbegin() const
Returns iterator pointing to the first file in the zip archive.
size_t uncompressedSize
Uncompressed size of this file.
size_t dataOffset
Offset of the beginning of this file's data from the start of the zip archive.
uint16_t compressionMethod
Compression method for this file.
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.
Class for writing a zip file.
USD_API void Discard()
Discards the zip archive so that it is not saved to the destination file path.
USD_API ~UsdZipFileWriter()
Calls Save()