Merge pull request #12036 from LillyJadeKatrin/deep-copy-volume

Added CopyReader to BlobReader and all subclasses
This commit is contained in:
JMC47 2023-10-01 11:39:37 -04:00 committed by GitHub
commit cd366c4f46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 306 additions and 216 deletions

View file

@ -101,6 +101,15 @@ bool IOFile::Close()
return m_good;
}
IOFile IOFile::Duplicate(const char openmode[]) const
{
#ifdef _WIN32
return IOFile(_fdopen(_dup(_fileno(m_file)), openmode));
#else // _WIN32
return IOFile(fdopen(dup(fileno(m_file)), openmode));
#endif // _WIN32
}
void IOFile::SetHandle(std::FILE* file)
{
Close();

View file

@ -51,6 +51,8 @@ public:
SharedAccess sh = SharedAccess::Default);
bool Close();
IOFile Duplicate(const char openmode[]) const;
template <typename T>
bool ReadArray(T* elements, size_t count, size_t* num_read = nullptr)
{