16 #ifndef ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_ATTACHMENTREADER_H_ 17 #define ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_ATTACHMENTREADER_H_ 28 namespace attachment {
63 AFTER_DRAINING_CURRENT_BUFFER
81 virtual std::size_t
read(
85 std::chrono::milliseconds timeoutMs = std::chrono::milliseconds(0)) = 0;
94 virtual bool seek(uint64_t offset) = 0;
125 stream <<
"OK_WOULDBLOCK";
128 stream <<
"OK_TIMEDOUT";
131 stream <<
"OK_OVERRUN_RESET";
137 stream <<
"ERROR_BYTES_LESS_THAN_WORD_SIZE";
140 stream <<
"ERROR_OVERRUN";
143 stream <<
"ERROR_INTERNAL";
154 #endif // ALEXA_CLIENT_SDK_AVSCOMMON_AVS_INCLUDE_AVSCOMMON_AVS_ATTACHMENT_ATTACHMENTREADER_H_
virtual uint64_t getNumUnreadBytes()=0
virtual bool seek(uint64_t offset)=0
On a request for n bytes, less than n bytes were available on a blocking read.
virtual ~AttachmentReader()=default
Definition: AttachmentReader.h:33
Stop returning data when all of the data in the buffer at the time close() was called has been read...
virtual void close(ClosePoint closePoint=ClosePoint::AFTER_DRAINING_CURRENT_BUFFER)=0
ReadStatus
Definition: AttachmentReader.h:38
virtual std::size_t read(void *buf, std::size_t numBytes, ReadStatus *readStatus, std::chrono::milliseconds timeoutMs=std::chrono::milliseconds(0))=0
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
On a request for n bytes, less than n bytes were available on a non-blocking read.
std::ostream & operator<<(std::ostream &stream, const AttachmentReader::ReadStatus &status)
Definition: AttachmentReader.h:119
The underlying data representation is no longer readable.
The number of bytes in the request is smaller than the word-size of the underlying data representatio...
A non-specified error occurred.
The writer has corrupted the reader data. The attachment is no longer valid.
ClosePoint
An enum class to indicate when the read() function should stop returning data after a call to close()...
Definition: AttachmentReader.h:59