add documentation and minor design changes

This commit is contained in:
Respirant
2020-12-30 15:31:23 +03:00
parent c64182a762
commit 47ffe28504
3 changed files with 3 additions and 4 deletions
@@ -27,7 +27,6 @@ URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::CreateDownlo
URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& URL, FString SavePath) URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile(const FString& URL, FString SavePath)
{ {
URuntimeFilesDownloaderBPLibrary* Downloader = NewObject<URuntimeFilesDownloaderBPLibrary>();
FileUrl = URL; FileUrl = URL;
FileSavePath = SavePath; FileSavePath = SavePath;
@@ -45,7 +44,7 @@ URuntimeFilesDownloaderBPLibrary* URuntimeFilesDownloaderBPLibrary::DownloadFile
return this; return this;
} }
void URuntimeFilesDownloaderBPLibrary::OnReady(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful) void URuntimeFilesDownloaderBPLibrary::OnReady_Internal(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{ {
RemoveFromRoot(); RemoveFromRoot();
Request->OnProcessRequestComplete().Unbind(); Request->OnProcessRequestComplete().Unbind();
@@ -72,11 +72,11 @@ public:
* @return Returns itself. * @return Returns itself.
*/ */
UFUNCTION(BlueprintCallable, Category = "RuntimeFilesDownloader") UFUNCTION(BlueprintCallable, Category = "RuntimeFilesDownloader")
URuntimeFilesDownloaderBPLibrary* DownloadFile(const FString & URL, FString SavePath); URuntimeFilesDownloaderBPLibrary* DownloadFile_Internal(const FString & URL, FString SavePath);
private: private:
void OnReady(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful); void OnReady_Internal(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
void OnProgress_Internal(FHttpRequestPtr Request, int32 BytesSent, int32 BytesReceived); void OnProgress_Internal(FHttpRequestPtr Request, int32 BytesSent, int32 BytesReceived);
}; };
Binary file not shown.