CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
crypto_stream.h
1
2#ifndef _aspose_system_security_crypto_stream_h_
3#define _aspose_system_security_crypto_stream_h_
4
5#include "system/io/stream.h"
6#include "system/collections/list.h"
7#include "i_crypto_transform.h"
8#include "crypto_stream_mode.h"
9
10namespace System{ namespace Security{ namespace Cryptography{
11
16class ASPOSECPP_SHARED_CLASS CryptoStream : public System::IO::Stream
17{
18public:
23 ASPOSECPP_SHARED_API CryptoStream(const SharedPtr<System::IO::Stream>& stream, const SharedPtr<ICryptoTransform>& transform, CryptoStreamMode mode);
24
30 ASPOSECPP_SHARED_API int32_t Read(const ArrayPtr<uint8_t>& buffer, int32_t offset, int32_t count) override;
36 ASPOSECPP_SHARED_API int32_t Read(const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count) override;
41 ASPOSECPP_SHARED_API void Write(const ArrayPtr<uint8_t>& buffer, int32_t offset, int32_t count) override;
46 ASPOSECPP_SHARED_API void Write(const System::Details::ArrayView<uint8_t>& buffer, int32_t offset, int32_t count) override;
48 ASPOSECPP_SHARED_API void Close() override;
51 ASPOSECPP_SHARED_API int64_t Seek(int64_t offset, IO::SeekOrigin origin) override;
54 ASPOSECPP_SHARED_API void SetLength(int64_t value) override;
56 ASPOSECPP_SHARED_API void Flush() override;
58 ASPOSECPP_SHARED_API void FlushFinalBlock();
61 ASPOSECPP_SHARED_API void set_Position(int64_t value) override;
64 ASPOSECPP_SHARED_API int64_t get_Position() const override;
67 ASPOSECPP_SHARED_API int64_t get_Length() const override;
70 ASPOSECPP_SHARED_API bool get_CanRead() const override;
73 ASPOSECPP_SHARED_API bool get_CanSeek() const override;
76 ASPOSECPP_SHARED_API bool get_CanWrite() const override;
77
78private:
80 void WriteAll();
81
83 CryptoStreamMode m_mode;
89 bool m_can_read;
91 bool m_can_write;
94};
95
96}}} //namespace System{ namespace Security{ namespace Cryptography{
97
98#endif // _aspose_system_security_crypto_stream_h_
99
A base class for a variety of stream implementations. Objects of this class should only be allocated ...
Definition: stream.h:24
Stream implementation that wraps existing stream with a cryptographic function. Objects of this class...
Definition: crypto_stream.h:17
void Write(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes data to stream.
bool get_CanWrite() const override
Checks if stream is writable.
void FlushFinalBlock()
Writes the data which is still in the buffer to stream.
void SetLength(int64_t value) override
Seeks size of stream. Not supported.
int64_t Seek(int64_t offset, IO::SeekOrigin origin) override
Seeks position in stream. Not supported.
void Close() override
Closes connection.
int64_t get_Position() const override
Gets current position in stream. Not supported.
CryptoStream(const SharedPtr< System::IO::Stream > &stream, const SharedPtr< ICryptoTransform > &transform, CryptoStreamMode mode)
Constructor.
bool get_CanRead() const override
Checks if stream is readable.
void Write(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Writes data to stream.
void set_Position(int64_t value) override
Seeks position in stream. Not supported.
int32_t Read(const System::Details::ArrayView< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads data from stream.
bool get_CanSeek() const override
Checks if stream is seekable.
int32_t Read(const ArrayPtr< uint8_t > &buffer, int32_t offset, int32_t count) override
Reads data from stream.
void Flush() override
Empties buffer into wrapped stream. Does nothing as transform algorithm can be still waiting for more...
int64_t get_Length() const override
Gets length of stream. Not supported.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
SeekOrigin
Specifies the reference position in the stream relative to which the position to seek to is specified...
Definition: seekorigin.h:11
CryptoStreamMode
CryptoStream direction.
Definition: crypto_stream_mode.h:8
Definition: db_command.h:9