Provides methods for creating, manipulating, searching, and sorting arrays.
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Base object class for DotNetDupe mirroring .NET System.Object.
Provides reference-counted and weak pointer memory management primitives ensuring zero raw ownership.
High-performance UTF-8 / UTF-16 string manipulation class mirroring .NET System.String.
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Represents a collection of keys and values.
void CopyTo(const SmartPointer< IO::Stream > &stream) override
Copies the byte buffer into the target stream.
long GetLength() const override
Returns the byte count of the buffer slice.
String ReadAsString() override
Reads the byte buffer decoded as a string.
SmartPointer< IO::Stream > ReadAsStream() override
Reads the content as a MemoryStream.
ByteArrayContent(const Array< char > &content)
Initializes a new instance of ByteArrayContent with full byte buffer.
Array< char > ReadAsByteArray() override
Reads the content byte buffer.
virtual ~HttpContent()=default
Virtual destructor for polymorphic cleanup.
virtual SmartPointer< IO::Stream > ReadAsStream()=0
Serializes the HTTP content and returns a stream that represents the content.
virtual void CopyTo(const SmartPointer< IO::Stream > &stream)
Serializes the HTTP content to a stream.
virtual long GetLength() const
Gets the length in bytes of the HHTP content, or -1 if indeterminate.
HttpContent()=default
Protected default constructor for derived content types.
virtual Array< char > ReadAsByteArray()=0
Serializes the HTTP content to a byte array.
const Collections::Generic::Dictionary< String, String > & GetHeaders() const
Gets the HTTP content headers as read-only.
Collections::Generic::Dictionary< String, String > & GetHeaders()
Gets the HTTP content headers defined in RFC 9110.
virtual String ReadAsString()=0
Serializes the HTTP content to a string as an operation.
StreamContent(const SmartPointer< IO::Stream > &stream)
Initializes a new instance of StreamContent wrapping an existing Stream.
SmartPointer< IO::Stream > ReadAsStream() override
Returns the underlying stream.
Array< char > ReadAsByteArray() override
Reads the remaining bytes in the stream into a byte array.
long GetLength() const override
Gets the length of the underlying stream if seekable, or -1.
void CopyTo(const SmartPointer< IO::Stream > &stream) override
Copies the underlying stream into the destination stream.
String ReadAsString() override
Reads the remaining bytes in the stream into a string.
Array< char > ReadAsByteArray() override
Reads the content payload as a byte array.
SmartPointer< IO::Stream > ReadAsStream() override
Reads the content payload as a readable MemoryStream.
String ReadAsString() override
Reads the content payload as a string.
void CopyTo(const SmartPointer< IO::Stream > &stream) override
Writes the content string directly to the destination stream.
long GetLength() const override
Gets the length in bytes of the UTF-8 content string.
StringContent(const String &content)
Creates a new instance of StringContent with text/plain default media type.
Supports all classes in the DotNetDupe class hierarchy.
A unified smart pointer that supports both unique and shared ownership semantics.
Represents text as a sequence of UTF-8 code units with culture-invariant operations.
SmartPointer< HttpContent > HttpContentPtr
Type alias for reference-counted SmartPointer to HttpContent.