9 #ifndef _CRYPTO_STREAMS_LIB_SIMPLEPROTECTEDSTREAM_H_
10 #define _CRYPTO_STREAMS_LIB_SIMPLEPROTECTEDSTREAM_H_
13 #include "ICryptoProvider.h"
18 public std::enable_shared_from_this
19 <SimpleProtectedStream>{
25 std::shared_ptr<IStream> pBackingStream,
26 uint64_t u64ContentStart,
27 uint64_t u64ContentSize);
30 virtual std::shared_future<int64_t>ReadAsync(uint8_t *pbBuffer,
33 std::launch launchType)
35 virtual std::shared_future<int64_t>WriteAsync(
const uint8_t *cpbBuffer,
38 std::launch launchType)
40 virtual std::future<bool>FlushAsync(std::launch launchType)
43 virtual int64_t Read(uint8_t *pbBuffer,
44 int64_t cbBuffer)
override;
45 virtual int64_t Write(
const uint8_t *cpbBuffer,
46 int64_t cbBuffer)
override;
47 virtual bool Flush()
override;
49 virtual SharedStream Clone()
override;
51 virtual void Seek(uint64_t u64Position)
override;
52 virtual bool CanRead()
const override;
53 virtual bool CanWrite()
const override;
54 virtual uint64_t Position()
override;
55 virtual uint64_t Size()
override;
56 virtual void Size(uint64_t u64Value)
override;
60 std::shared_future<int64_t>ReadInternalAsync(uint8_t *pbBuffer,
63 std::launch launchType,
64 uint32_t u32StartingBlockNumber,
66 std::shared_future<int64_t>WriteInternalAsync(
const uint8_t *cpbBuffer,
69 std::launch launchType,
70 uint32_t u32StartingBlockNumber,
75 uint64_t SizeInternal();
76 void SeekInternal(uint64_t u64Position);
83 void AppendZeros(uint64_t u64Count);
87 std::shared_ptr<std::mutex> m_locker;
89 std::shared_ptr<ICryptoProvider> m_pCryptoProvider;
90 std::shared_ptr<IStream> m_pBackingStream;
92 uint64_t m_u64ContentStart;
93 uint64_t m_u64ContentSize;
98 #endif // _CRYPTO_STREAMS_LIB_SIMPLEPROTECTEDSTREAM_H_
Definition: BlockBasedProtectedStream.cpp:13
Base interface for protected streams.
Definition: IStream.h:34
Definition: SimpleProtectedStream.h:17
Definition: CachedBlock.h:19