65 double dProgressPercentage,
double dDownloadRateBytesPerSec,
67 : m_llBytesReceived(llBytesReceived),
68 m_llTotalBytesToReceive(llTotalBytesToReceive),
69 m_dProgressPercentage(dProgressPercentage),
70 m_dDownloadRateBytesPerSec(dDownloadRateBytesPerSec),
85 long long m_llBytesReceived;
86 long long m_llTotalBytesToReceive;
87 double m_dProgressPercentage;
88 double m_dDownloadRateBytesPerSec;
101 : m_bSuccess(bSuccess),
102 m_bCancelled(bCancelled),
Defines common cross-platform macros, export decorators, and fundamental types.
#define DOTNETDUPE_API
Platform-specific linkage decoration for exporting or importing library symbols.
Represents the base class for classes that contain event data.
Represents the method that will handle an event when the event provides data.
Provides a base class for sending HTTP requests and receiving HTTP responses mirroring ....
Represents an HTTP request message adhering to RFC 9110 and RFC 9112.
Represents an HTTP response message adhering to RFC 9110 and RFC 9112.
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.
Represents a collection of keys and values.
EventArgs()
Initializes a new instance of the EventArgs class.
Represents the method that will handle an event when the event provides data.
Provides a Stream for a file, supporting both synchronous read and write operations.
bool IsCancelled() const
Indicates whether the download was intentionally cancelled.
bool IsSuccess() const
Indicates whether the file was successfully downloaded.
String GetError() const
Gets error information if an exception occurred during transfer.
DownloadCompletedEventArgs(bool bSuccess, bool bCancelled, const String &sError)
Initializes completion event arguments.
double GetProgressPercentage() const
Gets progress percentage between 0.0 and 100.0.
long long GetTotalBytesToReceive() const
Gets the total size in bytes expected to receive.
double GetDownloadRateBytesPerSec() const
Gets the current download rate in bytes per second.
DownloadProgressChangedEventArgs(long long llBytesReceived, long long llTotalBytesToReceive, double dProgressPercentage, double dDownloadRateBytesPerSec, DownloadStatus status)
Initializes a new instance with current metrics snapshot.
long long GetBytesReceived() const
Gets the total bytes received so far.
DownloadStatus GetStatus() const
Gets the current download status.
bool Resume()
Resumes a paused download using HTTP Range headers if supported.
void SetUserAgent(const String &sUserAgent)
Overrides the default User-Agent request header string.
FileDownloader(const String &sUrl, const String &sDestinationPath)
Initializes a new instance of FileDownloader with source URL and destination path.
DownloadProgress GetProgress() const
Queries instantaneous download telemetry metrics.
void Pause()
Suspends byte streaming without deleting partially received data.
EventHandler< DownloadCompletedEventArgs > & DownloadCompleted
Multicast event triggered when transfer completes or terminates.
DownloadStatus GetStatus() const
Queries current operational status.
EventHandler< DownloadProgressChangedEventArgs > & DownloadProgressChanged
Multicast event triggered when chunk progress occurs.
void AddHeaders(const Collections::Generic::Dictionary< String, String > &headers)
Appends custom HTTP request headers to outgoing requests.
bool Start()
Begins the asynchronous download on a background worker thread.
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.
DownloadStatus
State machine values representing the lifecycle of an ongoing file download.
@ Completed
Transfer finished successfully and file was verified.
@ Downloading
Transfer is actively receiving bytes over the network.
@ Failed
Transfer encountered an unrecoverable network or disk I/O failure.
@ Paused
Transfer is temporarily suspended.
@ NotStarted
Transfer has not been initiated.
Snapshot of download telemetry metrics including transferred bytes and bandwidth speed.
long long DownloadedBytes
Number of bytes written to local destination file.
double DownloadRateBytesPerSec
Instantaneous transfer speed in bytes per second.
DownloadStatus Status
Current lifecycle state of the download task.
long long TotalBytes
Total expected length in bytes from HTTP Content-Length header, or 0 if chunked.
long long RemainingBytes
Estimated remaining bytes.