1
0

Dokan changes

This commit is contained in:
Scott E. Graves
2017-02-11 15:07:51 -06:00
parent 0a865eb73e
commit a70d22b568
6 changed files with 194 additions and 11 deletions

View File

@@ -26,6 +26,22 @@ public:
Japanese
};
class AFX_EXT_CLASS _CSiaFileTree
{
friend CSiaApi;
private:
_CSiaFileTree(CSiaCurl& siaCurl);
public:
~_CSiaFileTree();
private:
CSiaCurl& _siaCurl;
public:
void BuildTree(const json& result);
};
class AFX_EXT_CLASS _CSiaWallet
{
friend CSiaApi;
@@ -69,6 +85,8 @@ public:
_SiaApiError FileExists(const String& siaPath, bool& exists) const;
_SiaApiError DeleteFile(const String& siaPath);
_SiaApiError DownloadFile(const String& siaPath, const String& location) const;
_SiaApiError QueueUploadFile(const String& siaPath, const String& filePath);
_SiaApiError GetFileTree(std::shared_ptr<_CSiaFileTree>& siaFileTree) const;
};
public:
@@ -94,5 +112,7 @@ typedef CSiaApi::_CSiaWallet CSiaWallet;
typedef CSiaApi::_CSiaRenter CSiaRenter;
typedef std::shared_ptr<CSiaWallet> CSiaWalletPtr;
typedef std::shared_ptr<CSiaRenter> CSiaRenterPtr;
typedef CSiaApi::_CSiaFileTree CSiaFileTree;
typedef std::shared_ptr<CSiaFileTree> CSiaFileTreePtr;
NS_END(2)

View File

@@ -196,6 +196,7 @@
<ClCompile Include="SiaCurl.cpp" />
<ClCompile Include="SiaDrive.Api.cpp" />
<ClCompile Include="SiaDriveConfig.cpp" />
<ClCompile Include="SiaFileTree.cpp" />
<ClCompile Include="SiaRenter.cpp" />
<ClCompile Include="SiaWallet.cpp" />
<ClCompile Include="stdafx.cpp">

View File

@@ -42,6 +42,9 @@
<ClCompile Include="SiaRenter.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="SiaFileTree.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="SiaDrive.Api.h">

View File

@@ -0,0 +1,20 @@
#include "StdAfx.h"
#include "SiaApi.h"
using namespace Sia::Api;
CSiaApi::_CSiaFileTree::_CSiaFileTree(CSiaCurl& siaCurl) :
_siaCurl(siaCurl)
{
}
CSiaApi::_CSiaFileTree::~_CSiaFileTree()
{
}
void CSiaApi::_CSiaFileTree::BuildTree(const json& result)
{
}

View File

@@ -26,4 +26,23 @@ SiaApiError CSiaApi::_CSiaRenter::DeleteFile(const String& siaPath)
SiaApiError CSiaApi::_CSiaRenter::DownloadFile(const String& siaPath, const String& location) const
{
return SiaApiError::NotImplemented;
}
SiaApiError CSiaApi::_CSiaRenter::QueueUploadFile(const String& siaPath, const String& filePath)
{
return SiaApiError::NotImplemented;
}
SiaApiError CSiaApi::_CSiaRenter::GetFileTree(CSiaFileTreePtr& siaFileTree) const
{
SiaApiError ret = SiaApiError::RequestError;
siaFileTree.reset(new CSiaFileTree(_siaCurl));
json result;
if (API_SUCCESS(SiaCurlError, _siaCurl.Get(L"/renter/files", result)))
{
siaFileTree->BuildTree(result);
ret = SiaApiError::Success;
}
return ret;
}