1
0

More stuffs

This commit is contained in:
Scott E. Graves
2017-02-23 17:38:04 -06:00
parent 7815d41227
commit ba5c089b43
4 changed files with 38 additions and 9 deletions

View File

@@ -15,4 +15,5 @@ CDebugConsumer::~CDebugConsumer()
void CDebugConsumer::ProcessEvent(const CEvent& eventData)
{
OutputDebugString(eventData.GetSingleLineMessage().c_str());
OutputDebugString(L"\n");
}

View File

@@ -343,6 +343,7 @@ UploadError CUploadManager::AddOrUpdate(const String& siaPath, String filePath)
}
else
{
CEventSystem::EventSystem.NotifyEvent(CreateSystemEvent(SourceFileNotFound(siaPath, filePath)));
ret = UploadError::SourceFileNotFound;
}

View File

@@ -99,7 +99,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"CreatingTemporarySiaDriveFile\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tTSP|" + _tempSourcePath;
return L"CreatingTemporarySiaDriveFile|SP|" + _siaPath + L"|FP|" + _filePath + L"|TSP|" + _tempSourcePath;
}
};
@@ -128,7 +128,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"CreatingTemporarySiaDriveFileFailed\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tTSP|" + _tempSourcePath;
return L"CreatingTemporarySiaDriveFileFailed|SP|" + _siaPath + L"|FP|" + _filePath + L"|TSP|" + _tempSourcePath;
}
};
@@ -157,7 +157,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"DeleteSiaDriveFileFailed\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tSDP|" + _siaDriveFilePath;
return L"DeleteSiaDriveFileFailed|SP|" + _siaPath + L"|FP|" + _filePath + L"|SDP|" + _siaDriveFilePath;
}
};
@@ -186,7 +186,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"DeleteTemporarySiaDriveFileFailed\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tTSP|" + _tempSourcePath;
return L"DeleteTemporarySiaDriveFileFailed|SP|" + _siaPath + L"|FP|" + _filePath + L"|TSP|" + _tempSourcePath;
}
};
@@ -217,7 +217,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"RenamingTemporarySiaDriveFile\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tTSP|" + _tempSourcePath + L"\n\tSDP|" + _siaDriveFilePath;
return L"RenamingTemporarySiaDriveFile|SP|" + _siaPath + L"|FP|" + _filePath + L"|TSP|" + _tempSourcePath + L"|SDP|" + _siaDriveFilePath;
}
};
@@ -248,7 +248,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"RenamingTemporarySiaDriveFileFailed\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tTSP|" + _tempSourcePath + L"\n\tSDP|" + _siaDriveFilePath;
return L"RenamingTemporarySiaDriveFileFailed|SP|" + _siaPath + L"|FP|" + _filePath + L"|TSP|" + _tempSourcePath + L"|SDP|" + _siaDriveFilePath;
}
};
@@ -277,7 +277,7 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"ExistingUploadFound\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tST|" + CUploadManager::UploadStatusToString(_uploadStatus);
return L"ExistingUploadFound|SP|" + _siaPath + L"|FP|" + _filePath + L"|ST|" + CUploadManager::UploadStatusToString(_uploadStatus);
}
};
@@ -306,7 +306,34 @@ private:
public:
virtual String GetSingleLineMessage() const override
{
return L"NewUploadAdded\n\tSP|" + _siaPath + L"\n\tFP|" + _filePath + L"\n\tSDP|" + _siaDriveFilePath;
return L"NewUploadAdded|SP|" + _siaPath + L"|FP|" + _filePath + L"|SDP|" + _siaDriveFilePath;
}
};
class SourceFileNotFound :
public CEvent
{
public:
SourceFileNotFound(const String& siaPath, const String& filePath) :
_siaPath(siaPath),
_filePath(filePath)
{
}
public:
virtual ~SourceFileNotFound()
{
}
private:
const String _siaPath;
const String _filePath;
public:
virtual String GetSingleLineMessage() const override
{
return L"SourceFileNotFound|SP|" + _siaPath + L"|FP|" + _filePath;
}
};

View File

@@ -56,7 +56,7 @@ namespace UnitTests
CUploadManager uploadManager(siaCurl, &driveConfig);
uploadManager.AddOrUpdate(L"/test1/test.rtf", L"./TestCacheFolder/test1/test.rtf");
Sleep(-1);
Sleep(5000);
}
catch (SQLite::Exception e)
{