9 #ifndef _RMS_LIB_CUSTOMPROTECTEDSTREAM_H_
10 #define _RMS_LIB_CUSTOMPROTECTEDSTREAM_H_
12 #include "UserPolicy.h"
14 #include "ModernAPIExport.h"
75 static std::shared_ptr<CustomProtectedStream> Create(
76 std::shared_ptr<UserPolicy> policy,
77 rmscrypto::api::SharedStream stream,
78 uint64_t contentStartPosition,
79 uint64_t contentSize);
88 static uint64_t GetEncryptedContentLength(
89 std::shared_ptr<UserPolicy>policy,
90 uint64_t contentLength);
107 virtual std::shared_future<int64_t>ReadAsync(uint8_t *pbBuffer,
110 std::launch launchType)
128 virtual std::shared_future<int64_t>WriteAsync(
const uint8_t *cpbBuffer,
131 std::launch launchType)
145 virtual std::future<bool> FlushAsync(std::launch launchType)
155 virtual int64_t Read(uint8_t *pbBuffer,
156 int64_t cbBuffer)
override;
165 virtual int64_t Write(
const uint8_t *cpbBuffer,
166 int64_t cbBuffer)
override;
173 virtual bool Flush()
override;
180 virtual rmscrypto::api::SharedStream Clone()
override;
186 virtual void Seek(uint64_t u64Position)
override;
192 virtual bool CanRead()
const override;
198 virtual bool CanWrite()
const override;
204 virtual uint64_t Position()
override;
210 virtual uint64_t Size()
override;
216 virtual void Size(uint64_t u64Value)
override;
223 std::shared_ptr<IStream>GetImpl();
227 std::shared_ptr<IStream> m_pImpl;
231 #endif // _RMS_LIB_CUSTOMPROTECTEDSTREAM_H_
Base interface for protected streams.
Definition: IStream.h:34
Definition: AuthenticationCallbackImpl.h:16
Used to access files that use a custom protection format.
Definition: CustomProtectedStream.h:27