Make written bytes observable
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#include "ArchiveBase.hpp"
|
||||
#include "ArchiveConfiguration.hpp"
|
||||
#include "IArchiveWriter.hpp"
|
||||
#include "Base/Observable.hpp"
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
@@ -20,7 +21,7 @@ namespace OpenVulkano
|
||||
friend ArchiveStreamBufferWriter;
|
||||
|
||||
ArchiveConfiguration m_archiveConfig;
|
||||
size_t m_bytesWritten = 0;
|
||||
Observable<size_t> m_bytesWritten { 0 };
|
||||
ArchiveOStream::ASBufferPtr m_asBuffer = nullptr;
|
||||
bool m_lastCompressed = true;
|
||||
std::function<bool(const FileDescription&)> m_shouldCompress;
|
||||
@@ -49,6 +50,8 @@ namespace OpenVulkano
|
||||
|
||||
void SetShouldCompressFunction(const std::function<bool(const FileDescription&)>& shouldComp) override { m_shouldCompress = shouldComp; }
|
||||
|
||||
decltype(m_bytesWritten)& GetBytesWrittenObservable() { return m_bytesWritten; }
|
||||
|
||||
private:
|
||||
void WriteHeader(const FileDescription& fileDescription);
|
||||
|
||||
@@ -56,4 +59,4 @@ namespace OpenVulkano
|
||||
|
||||
void SetCompressed();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user