12 #ifndef __UT_ARCHIVE_H__
13 #define __UT_ARCHIVE_H__
52 int64_t ino64()
const;
53 mode_t fileType()
const;
61 void setGid(int64_t gid);
62 void setUid(int64_t uid);
63 void setSize(int64_t size);
64 void setIno64(int64_t ino);
66 void setGName(
const char* gname);
67 void setHardlink(
const char* hardlink);
68 void setPathname(
const char* pathname);
69 void setSymlink(
const char* symlink);
70 void setUName(
const char* uname);
71 void setMTime(time_t
t, int64_t
v);
75 return myEntry == entry.myEntry;
79 return !(*
this == entry);
81 explicit operator bool()
const
83 return myEntry !=
nullptr;
103 myArchive(std::move(
a.myArchive))
107 myArchive = std::move(
a.myArchive);
147 void operator()(archive*
a);
154 : myReader(reader), myEntry(entry)
160 return myEntry == other.myEntry;
164 return !(*
this == other);
171 myEntry = myReader->nextEntry();
189 template <format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
200 template <format FORMAT = format::_ALL, filter FILTER = filter::_ALL>
218 explicit operator bool()
const {
return isValid(); }
240 for (
auto&& e : reader)
242 if (e.pathname() != pathname)
245 int r = reader.read(e, data);
254 template <format FORMAT>
256 template <filter FILTER>
263 int openFileW(
const wchar_t*
filename,
size_t block_size);
264 int openFile(
const char*
filename,
size_t block_size);
271 #endif // __UT_ARCHIVE_H__
bool operator==(const UT_ArchiveEntry &entry) const
GT_API const UT_StringHolder filename
static bool readFile(const char *filename, const UT_StringHolder &pathname, UT_WorkBuffer &data)
Helper to read a specific file from an archive file.
GLboolean GLboolean GLboolean GLboolean a
Deleter for smart pointers.
int openFileW(const wchar_t *filename, size_t block_size)
static const int EXTRACT_ACL
static const int EXTRACT_TIME
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
OIIO_FORCEINLINE bool extract(const vbool4 &a)
static const int EXTRACT_MAC_METADATA
UT_ArchiveEntry operator*()
std::shared_ptr< T > UT_SharedPtr
Wrapper around std::shared_ptr.
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
bool operator==(const iterator &other) const
#define SYS_NO_DISCARD_RESULT
static const int EXTRACT_CLEAR_NOCHANGE_FFLAGS
static const int EXTRACT_XATTR
int openFile(const char *filename, size_t block_size)
bool operator!=(const iterator &other) const
UT_ArchiveReader & operator=(UT_ArchiveReader &&a)
static SYS_NO_DISCARD_RESULT UT_ArchiveReader createW(const wchar_t *filename, size_t block_size)
iterator(UT_ArchiveReader *reader, const UT_ArchiveEntry &entry)
bool operator!=(const UT_ArchiveEntry &entry) const
static SYS_NO_DISCARD_RESULT UT_ArchiveReader create(const char *filename, size_t block_size)