1
0

Refactoring and added common utils

This commit is contained in:
Scott E. Graves
2017-02-17 18:58:06 -06:00
parent 6b425fc5ca
commit 9b44d435f8
9 changed files with 101 additions and 30 deletions

View File

@@ -42,7 +42,7 @@ private:
tempPath.resize(MAX_PATH + 1);
if (GetTempPath(MAX_PATH + 1, &tempPath[0]))
{
ret = API_SUCCESS(SiaApiError, _siaApi->GetRenter()->DownloadFile(siaPath, tempPath));
ret = ApiSuccess(_siaApi->GetRenter()->DownloadFile(siaPath, tempPath));
if (ret)
{
@@ -158,7 +158,7 @@ private:
else
{
bool exists;
if (API_SUCCESS(SiaApiError, _siaApi->GetRenter()->FileExists(siaPath, exists)))
if (ApiSuccess(_siaApi->GetRenter()->FileExists(siaPath, exists)))
{
// Operations on existing files that are requested to be truncated, overwritten or re-created
// will first be deleted and then replaced if, after the file operation is done, the resulting file
@@ -227,7 +227,7 @@ private:
// If file isn't cached, delete from Sia only
if (!PathFileExists(cacheFilePath.c_str()) || ::DeleteFile(cacheFilePath.c_str()))
{
if (!API_SUCCESS(SiaApiError, _siaApi->GetRenter()->DeleteFile(siaPath)))
if (!ApiSuccess(_siaApi->GetRenter()->DeleteFile(siaPath)))
{
ret = STATUS_INVALID_SERVER_STATE;
}