Commit 5a4516c3 authored by David Diederich's avatar David Diederich 🌴
Browse files

Merge remote-tracking branch 'upstream/master' into ci-pipeline

parents 02fb4736 a857b866
......@@ -2,6 +2,7 @@
Builds
Dist
CMakeSettings.json
CMakeLists.txt.user
python/.eggs
python/_skbuild
python/**/*.pyd
......
......@@ -5,3 +5,4 @@ zlib*
fmt*
cpprestapi*
azure-storage-cpp*
CMakeArtifacts*
macro(Fetch3rdParty_Package name version url url_hash)
set(SRC_DIR ${PROJECT_SOURCE_DIR}/3rdparty/${name}-${version})
set(${name}_SOURCE_DIR ${SRC_DIR} PARENT_SCOPE)
set(${name}_VERSION ${version} PARENT_SCOPE)
FetchContent_Declare(${name}
URL ${url}
URL_HASH ${url_hash}
SOURCE_DIR ${SRC_DIR})
if (NOT (EXISTS ${SRC_DIR}))
FetchContent_Populate(${name})
endif()
endmacro()
function(Fetch3rdParty)
include(CMake/FetchContentLocal.cmake)
set(FETCHCONTENT_QUIET OFF)
Fetch3rdParty_Package(aws-cpp-sdk 1.7.213 https://codeload.github.com/aws/aws-sdk-cpp/tar.gz/1.7.213 SHA256=dd0485837ee2b3b46a98f439fb6799e2bb63d9a0038b0de1c2173181630b775c)
Fetch3rdParty_Package(gtest 1.9.0 https://codeload.github.com/google/googletest/legacy.tar.gz/33a0d4f6d76a0ed6061e612848532cba82d42870 MD5=5226644d616f5a00b436b487bf0a1dde)
Fetch3rdParty_Package(jsoncpp 1.8.4 https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz MD5=fa47a3ab6b381869b6a5f20811198662)
Fetch3rdParty_Package(fmt 6.0.0 https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz SHA256=f1907a58d5e86e6c382e51441d92ad9e23aea63827ba47fd647eacc0d3a16c78)
Fetch3rdParty_Package(cpprestapi 2.10.14 https://github.com/microsoft/cpprestsdk/archive/v2.10.14.tar.gz SHA256=f2628b248f714d7bbd6a536553bc3782602c68ca1b129017985dd70cc3515278)
Fetch3rdParty_Package(azure-storage-cpp 7.0.0 https://github.com/Azure/azure-storage-cpp/archive/v7.0.0.tar.gz SHA256=2129511dcf40383de5ac643abf68cad4907b5cdbfe471c75ba264a83e3078dc7)
if (BUILD_ZLIB)
Fetch3rdParty_Package(zlib 1.2.11 http://zlib.net/zlib-1.2.11.tar.gz SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
endif()
endfunction()
include(CMake/Fetch3rdPartyInBuild.cmake)
set(BUILD_ZLIB ON)
Fetch3rdParty()
#This file depends on being in open-vds/CMake directory
set(Fetch3rdPartyDir ${CMAKE_CURRENT_LIST_DIR})
macro(Fetch3rdParty_Package name version url url_hash)
get_filename_component(thirdParty "${Fetch3rdPartyDir}/../3rdparty" ABSOLUTE)
set(SRC_DIR ${thirdParty}/${name}-${version})
set(${name}_SOURCE_DIR ${SRC_DIR} PARENT_SCOPE)
set(${name}_VERSION ${version} PARENT_SCOPE)
if (NOT (EXISTS ${SRC_DIR}))
FetchContent_Populate(${name}
URL ${url}
URL_HASH ${url_hash}
SOURCE_DIR ${SRC_DIR}
SUBBUILD_DIR ${thirdParty}/CMakeArtifacts/${name}-sub-${version}
BINARY_DIR ${thirdParty}/CMakeArtifacts/${name}-${version})
endif()
endmacro()
function(Fetch3rdParty)
include(CMake/FetchContentLocal.cmake)
set(FETCHCONTENT_QUIET OFF)
Fetch3rdParty_Package(aws-cpp-sdk 1.7.213 https://codeload.github.com/aws/aws-sdk-cpp/tar.gz/1.7.213 SHA256=dd0485837ee2b3b46a98f439fb6799e2bb63d9a0038b0de1c2173181630b775c)
Fetch3rdParty_Package(gtest 1.9.0 https://codeload.github.com/google/googletest/legacy.tar.gz/33a0d4f6d76a0ed6061e612848532cba82d42870 MD5=5226644d616f5a00b436b487bf0a1dde)
Fetch3rdParty_Package(jsoncpp 1.8.4 https://github.com/open-source-parsers/jsoncpp/archive/1.8.4.tar.gz MD5=fa47a3ab6b381869b6a5f20811198662)
Fetch3rdParty_Package(fmt 6.0.0 https://github.com/fmtlib/fmt/archive/6.0.0.tar.gz SHA256=f1907a58d5e86e6c382e51441d92ad9e23aea63827ba47fd647eacc0d3a16c78)
Fetch3rdParty_Package(cpprestapi 2.10.14 https://github.com/microsoft/cpprestsdk/archive/v2.10.14.tar.gz SHA256=f2628b248f714d7bbd6a536553bc3782602c68ca1b129017985dd70cc3515278)
Fetch3rdParty_Package(azure-storage-cpp 7.0.0 https://github.com/Azure/azure-storage-cpp/archive/v7.0.0.tar.gz SHA256=2129511dcf40383de5ac643abf68cad4907b5cdbfe471c75ba264a83e3078dc7)
if (BUILD_ZLIB)
Fetch3rdParty_Package(zlib 1.2.11 http://zlib.net/zlib-1.2.11.tar.gz SHA256=c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1)
endif()
endfunction()
......@@ -65,7 +65,7 @@ endif()
option(BUILD_ZLIB "Build zlib" ${DEFAULT_BUILD_ZLIB})
include(CMake/Fetch3rdParty.cmake)
include(CMake/Fetch3rdPartyInBuild.cmake)
Fetch3rdParty()
include(CMake/Build3rdParty.cmake)
......
......@@ -46,6 +46,15 @@ To generate a Visual Studio solution make a build directory in the OpenVDS folde
OpenVDS also supports using the cmake integration in Visual Studio. Open Visual Studio and use the "Open a local folder" to open the OpenVDS folder.
This works with default settings with Visual Studio 2019, but there are some
limitations using Visual Studio 2017. Before opening the project for the first
time in Visual Studio 2017 do the following commands in the root OpenVDS project
folder:
`$ git checkout 0d7825df9c981f624b6e1197a1b90c74ddae6aa9 -- CMakeSettings.json`
`$ cmake -P CMake/Fetch3rdParty.cmake`
Then start like other cmake projects in Visual Studio
#### Build options
- BUILD_PYTHON (ON|OFF)
- ENABLE_OPENMP (ON|OFF)
......
......@@ -26,6 +26,6 @@ PYBIND11_MODULE(core, m) {
py::class_< OpenVDS::VolumeDataAxisDescriptor >(m, "Axis")
.def(py::init<>())
.def(py::init<int, const char*, const char*, float, float>())
.def_property_readonly("name", &OpenVDS::VolumeDataAxisDescriptor::getName)
.def_property_readonly("name", &OpenVDS::VolumeDataAxisDescriptor::GetName)
;
}
......@@ -22,7 +22,7 @@
namespace OpenVDS
{
FileView * FileView::addReference(FileView *pcFileView)
FileView * FileView::AddReference(FileView *pcFileView)
{
assert(pcFileView);
......@@ -32,7 +32,7 @@ FileView * FileView::addReference(FileView *pcFileView)
return pcFileView;
}
bool FileView::removeReference(FileView *pcFileView)
bool FileView::RemoveReference(FileView *pcFileView)
{
assert(pcFileView);
assert(pcFileView->m_nReferenceCount > 0);
......@@ -55,29 +55,29 @@ File::File()
File::~File()
{
if (isOpen())
if (IsOpen())
{
close();
Close();
}
}
bool File::isWriteable() const
bool File::IsWriteable() const
{
return _isWriteable;
}
bool File::isOpen() const
bool File::IsOpen() const
{
assert(!!_pxPlatformHandle == !_cFileName.empty());
return _pxPlatformHandle;
}
std::string File::fileName() const
std::string File::FileName() const
{
return _cFileName;
}
void *File::handle() const
void *File::Handle() const
{
return _pxPlatformHandle;
}
......
......@@ -56,36 +56,36 @@ public:
class SystemFileMappingObject
{
public:
static bool open(SystemFileMappingObject** ppcFileMappingObject, File &file, IOError &error);
static void close(SystemFileMappingObject** pcFileMappingObject);
static bool Open(SystemFileMappingObject** ppcFileMappingObject, File &file, IOError &error);
static void Close(SystemFileMappingObject** pcFileMappingObject);
};
OPENVDS_EXPORT
const void * pointer() const
const void * Pointer() const
{
return m_pData;
}
OPENVDS_EXPORT
int64_t pos() const
int64_t Pos() const
{
return m_nPos;
}
OPENVDS_EXPORT
int64_t size() const
int64_t Size() const
{
return m_nSize;
}
OPENVDS_EXPORT
virtual bool prefetch(const void *pData, int64_t nSize, IOError &error) const = 0;
virtual bool Prefetch(const void *pData, int64_t nSize, IOError &error) const = 0;
OPENVDS_EXPORT
static FileView* addReference(FileView* pcFileView);
static FileView* AddReference(FileView* pcFileView);
OPENVDS_EXPORT
static bool removeReference(FileView* pcFileView);
static bool RemoveReference(FileView* pcFileView);
};
// This class is thread-safe except for the following methods:
......@@ -97,23 +97,23 @@ public:
OPENVDS_EXPORT File();
OPENVDS_EXPORT ~File();
OPENVDS_EXPORT static bool exists(const std::string& filename);
OPENVDS_EXPORT bool open(const std::string& filename, bool isCreate, bool isDestroyExisting, bool isWriteAccess, IOError& error);
OPENVDS_EXPORT void close();
OPENVDS_EXPORT static bool Exists(const std::string& filename);
OPENVDS_EXPORT bool Open(const std::string& filename, bool isCreate, bool isDestroyExisting, bool isWriteAccess, IOError& error);
OPENVDS_EXPORT void Close();
OPENVDS_EXPORT int64_t size(IOError& error) const;
OPENVDS_EXPORT int64_t Size(IOError& error) const;
OPENVDS_EXPORT bool read(void* pxData, int64_t nOffset, int32_t nLength, IOError& error) const;
OPENVDS_EXPORT bool write(const void* pxData, int64_t nOffset, int32_t nLength, IOError& error);
OPENVDS_EXPORT bool Read(void* pxData, int64_t nOffset, int32_t nLength, IOError& error) const;
OPENVDS_EXPORT bool Write(const void* pxData, int64_t nOffset, int32_t nLength, IOError& error);
OPENVDS_EXPORT bool flush();
OPENVDS_EXPORT bool isWriteable() const;
OPENVDS_EXPORT bool isOpen() const;
OPENVDS_EXPORT std::string fileName() const;
OPENVDS_EXPORT bool Flush();
OPENVDS_EXPORT bool IsWriteable() const;
OPENVDS_EXPORT bool IsOpen() const;
OPENVDS_EXPORT std::string FileName() const;
OPENVDS_EXPORT FileView *createFileView(int64_t iPos, int64_t nSize, bool isPopulate, IOError &error);
OPENVDS_EXPORT FileView *CreateFileView(int64_t iPos, int64_t nSize, bool isPopulate, IOError &error);
OPENVDS_EXPORT void *handle() const;
OPENVDS_EXPORT void *Handle() const;
private:
void* _pxPlatformHandle;
bool _isWriteable;
......
......@@ -31,21 +31,21 @@ Request::~Request()
TransferDownloadHandler::~TransferDownloadHandler()
{
}
void TransferDownloadHandler::handleMetadata(const std::string& key, const std::string& header)
void TransferDownloadHandler::HandleMetadata(const std::string& key, const std::string& header)
{
}
IOManager::~IOManager()
{}
IOManager* IOManager::createIOManager(const OpenOptions& options, Error &error)
IOManager* IOManager::CreateIOManager(const OpenOptions& options, Error &error)
{
switch(options.connectionType)
{
case OpenOptions::AWS:
return new IOManagerAWS(static_cast<const AWSOpenOptions &>(options), error);
default:
error.code = -1;
error.string = "Unknwon type for OpenOptions";
error.Code = -1;
error.String = "Unknwon type for OpenOptions";
return nullptr;
}
}
......
......@@ -30,9 +30,9 @@ namespace OpenVDS
{
public:
virtual ~TransferDownloadHandler();
virtual void handleMetadata(const std::string &key, const std::string &header);
virtual void handleData(std::vector<uint8_t> &&data) = 0;
virtual void completed(const Request &request, const Error &error) = 0;
virtual void HandleMetadata(const std::string &key, const std::string &header);
virtual void HandleData(std::vector<uint8_t> &&data) = 0;
virtual void Completed(const Request &request, const Error &error) = 0;
};
class Request
......@@ -40,11 +40,11 @@ namespace OpenVDS
public:
Request(const std::string &objectName);
virtual ~Request();
virtual void waitForFinish() = 0;
virtual bool isDone() const = 0;
virtual bool isSuccess(Error &error) const = 0;
virtual void cancel() = 0;
const std::string &getObjectName() const { return m_objectName; }
virtual void WaitForFinish() = 0;
virtual bool IsDone() const = 0;
virtual bool IsSuccess(Error &error) const = 0;
virtual void Cancel() = 0;
const std::string &GetObjectName() const { return m_objectName; }
private:
std::string m_objectName;
......@@ -60,19 +60,19 @@ namespace OpenVDS
{
public:
virtual ~IOManager();
virtual std::shared_ptr<Request> download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange &range = IORange()) = 0;
virtual std::shared_ptr<Request> upload(const std::string objectName, const std::string &contentDispostionFilename, const std::string &contentType, const std::vector<std::pair<std::string, std::string>> &metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr) = 0;
std::shared_ptr<Request> uploadBinary(const std::string objectName, const std::string &contentDispositionFilename, const std::vector<std::pair<std::string, std::string>> &metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr)
virtual std::shared_ptr<Request> Download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange &range = IORange()) = 0;
virtual std::shared_ptr<Request> Upload(const std::string objectName, const std::string &contentDispostionFilename, const std::string &contentType, const std::vector<std::pair<std::string, std::string>> &metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr) = 0;
std::shared_ptr<Request> UploadBinary(const std::string objectName, const std::string &contentDispositionFilename, const std::vector<std::pair<std::string, std::string>> &metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr)
{
return upload(objectName, contentDispositionFilename, "application/octet-stream", metadataHeader, data, completedCallback);
return Upload(objectName, contentDispositionFilename, "application/octet-stream", metadataHeader, data, completedCallback);
}
std::shared_ptr<Request> uploadJson(const std::string objectName, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr)
std::shared_ptr<Request> UploadJson(const std::string objectName, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request &request, const Error &error)> completedCallback = nullptr)
{
return upload(objectName, "", "application/json", std::vector<std::pair<std::string, std::string>>(), data, completedCallback);
return Upload(objectName, "", "application/json", std::vector<std::pair<std::string, std::string>>(), data, completedCallback);
}
static IOManager *createIOManager(const OpenOptions &options, Error &error);
static IOManager *CreateIOManager(const OpenOptions &options, Error &error);
};
}
......
......@@ -112,7 +112,7 @@ namespace OpenVDS
Aws::S3::Model::GetObjectResult result = const_cast<Aws::S3::Model::GetObjectOutcome&>(getObjectOutcome).GetResultWithOwnership();
for (auto it : result.GetMetadata())
{
objReq->m_handler->handleMetadata(convertAwsString(it.first), convertAwsString(it.second));
objReq->m_handler->HandleMetadata(convertAwsString(it.first), convertAwsString(it.second));
}
auto& retrieved_object = result.GetBody();
auto content_length = result.GetContentLength();
......@@ -122,7 +122,7 @@ namespace OpenVDS
{
data.resize(content_length);
retrieved_object.read((char*)&data[0], content_length);
objReq->m_handler->handleData(std::move(data));
objReq->m_handler->HandleData(std::move(data));
}
lock.lock();
}
......@@ -130,14 +130,14 @@ namespace OpenVDS
{
lock.lock();
auto s3error = getObjectOutcome.GetError();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
objReq->m_waitForFinish.notify_all();
lock.unlock();
objReq->m_handler->completed(*objReq, objReq->m_error);
objReq->m_handler->Completed(*objReq, objReq->m_error);
}
DownloadRequestAWS::DownloadRequestAWS(const std::string& id, const std::shared_ptr<TransferDownloadHandler>& handler)
......@@ -150,14 +150,14 @@ namespace OpenVDS
DownloadRequestAWS::~DownloadRequestAWS()
{
DownloadRequestAWS::cancel();
DownloadRequestAWS::Cancel();
}
void DownloadRequestAWS::run(Aws::S3::S3Client& client, const std::string& bucket, const IORange& range, std::weak_ptr<DownloadRequestAWS> downloadRequest)
{
Aws::S3::Model::GetObjectRequest object_request;
object_request.SetBucket(convertStdString(bucket));
object_request.SetKey(convertStdString(getObjectName()));
object_request.SetKey(convertStdString(GetObjectName()));
if (range.end)
{
object_request.SetRange(convertStdString(fmt::format("bytes={}-{}", range.start, range.end)));
......@@ -169,31 +169,31 @@ namespace OpenVDS
client.GetObjectAsync(object_request, bounded_callback);
}
void DownloadRequestAWS::waitForFinish()
void DownloadRequestAWS::WaitForFinish()
{
std::unique_lock<std::mutex> lock(m_mutex);
m_waitForFinish.wait(lock, [this]{ return m_done; });
}
bool DownloadRequestAWS::isDone() const
bool DownloadRequestAWS::IsDone() const
{
std::unique_lock<std::mutex> lock(m_mutex);
return m_done;
}
bool DownloadRequestAWS::isSuccess(Error& error) const
bool DownloadRequestAWS::IsSuccess(Error& error) const
{
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.code = -1;
error.string = "Download not done.";
error.Code = -1;
error.String = "Download not done.";
return false;
}
error = m_error;
return m_error.code == 0;
return m_error.Code == 0;
}
void DownloadRequestAWS::cancel()
void DownloadRequestAWS::Cancel()
{
m_cancelled = true;
}
......@@ -208,8 +208,8 @@ namespace OpenVDS
if (!outcome.IsSuccess())
{
auto s3error = outcome.GetError();
objReq->m_error.code = int(s3error.GetResponseCode());
objReq->m_error.string = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
objReq->m_error.Code = int(s3error.GetResponseCode());
objReq->m_error.String = (s3error.GetExceptionName() + " : " + s3error.GetMessage()).c_str();
}
objReq->m_done = true;
......@@ -234,7 +234,7 @@ namespace OpenVDS
Aws::S3::Model::PutObjectRequest put;
put.SetBucket(convertStdString(bucket));
put.SetKey(convertStdString(getObjectName()));
put.SetKey(convertStdString(GetObjectName()));
put.SetBody(m_stream);
put.SetContentType(convertStdString(contentType));
put.SetContentLength(data->size());
......@@ -250,42 +250,42 @@ namespace OpenVDS
}
void UploadRequestAWS::waitForFinish()
void UploadRequestAWS::WaitForFinish()
{
std::unique_lock<std::mutex> lock(m_mutex);
m_waitForFinish.wait(lock, [this]{ return this->m_done; });
}
bool UploadRequestAWS::isDone() const
bool UploadRequestAWS::IsDone() const
{
std::unique_lock<std::mutex> lock(m_mutex);
return m_done;
}
bool UploadRequestAWS::isSuccess(Error& error) const
bool UploadRequestAWS::IsSuccess(Error& error) const
{
std::unique_lock<std::mutex> lock(m_mutex);
if (!m_done)
{
error.code = -1;
error.string = "Download not done.";
error.Code = -1;
error.String = "Download not done.";
return false;
}
error = m_error;
return m_error.code == 0;
return m_error.Code == 0;
}
void UploadRequestAWS::cancel()
void UploadRequestAWS::Cancel()
{
m_cancelled = true;
}
IOManagerAWS::IOManagerAWS(const AWSOpenOptions& openOptions, Error &error)
: m_region(openOptions.region)
, m_bucket(openOptions.bucket)
, m_objectId(openOptions.key)
: m_region(openOptions.Region)
, m_bucket(openOptions.Bucket)
, m_objectId(openOptions.Key)
{
if (m_region.empty() || m_bucket.empty())
{
error.code = -1;
error.string = "AWS Config error. Empty bucket or region";
error.Code = -1;
error.String = "AWS Config error. Empty bucket or region";
return;
}
......@@ -307,7 +307,7 @@ namespace OpenVDS
deinitizlieAWSSDK();
}
std::shared_ptr<Request> IOManagerAWS::download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange &range)
std::shared_ptr<Request> IOManagerAWS::Download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange &range)
{
std::string id = objectName.empty()? m_objectId : m_objectId + "/" + objectName;
auto ret = std::make_shared<DownloadRequestAWS>(id, handler);
......@@ -315,7 +315,7 @@ namespace OpenVDS
return ret;
}
std::shared_ptr<Request> IOManagerAWS::upload(const std::string objectName, const std::string& contentDispositionFilename, const std::string& contentType, const std::vector<std::pair<std::string, std::string>>& metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request & request, const Error & error)> completedCallback)
std::shared_ptr<Request> IOManagerAWS::Upload(const std::string objectName, const std::string& contentDispositionFilename, const std::string& contentType, const std::vector<std::pair<std::string, std::string>>& metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request & request, const Error & error)> completedCallback)
{
std::string id = objectName.empty()? m_objectId : m_objectId + "/" + objectName;
auto ret = std::make_shared<UploadRequestAWS>(id, completedCallback);
......
......@@ -39,10 +39,10 @@ namespace OpenVDS
void run(Aws::S3::S3Client& client, const std::string& bucket, const IORange& range, std::weak_ptr<DownloadRequestAWS> request);
void waitForFinish() override;
bool isDone() const override;
bool isSuccess(Error &error) const override;
void cancel() override;
void WaitForFinish() override;
bool IsDone() const override;
bool IsSuccess(Error &error) const override;
void Cancel() override;
std::shared_ptr<TransferDownloadHandler> m_handler;
std::atomic_bool m_cancelled;
......@@ -78,10 +78,10 @@ namespace OpenVDS
public:
UploadRequestAWS(const std::string &id, std::function<void(const Request & request, const Error & error)> completedCallback);
void run(Aws::S3::S3Client& client, const std::string& bucket, const std::string& contentDispostionFilename, const std::string& contentType, const std::vector<std::pair<std::string, std::string>>& metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::weak_ptr<UploadRequestAWS> uploadRequest);
void waitForFinish() override;
bool isDone() const override;
bool isSuccess(Error &error) const override;
void cancel() override;
void WaitForFinish() override;
bool IsDone() const override;
bool IsSuccess(Error &error) const override;
void Cancel() override;
std::function<void(const Request &request, const Error &error)> m_completedCallback;
std::shared_ptr<IOStream> m_stream;
......@@ -98,8 +98,8 @@ namespace OpenVDS
IOManagerAWS(const AWSOpenOptions &openOptions, Error &error);
~IOManagerAWS() override;
std::shared_ptr<Request> download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange& range = IORange()) override;
std::shared_ptr<Request> upload(const std::string objectName, const std::string& contentDispostionFilename, const std::string& contentType, const std::vector<std::pair<std::string, std::string>>& metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request & request, const Error & error)> completedCallback = nullptr) override;
std::shared_ptr<Request> Download(const std::string objectName, std::shared_ptr<TransferDownloadHandler> handler, const IORange& range = IORange()) override;
std::shared_ptr<Request> Upload(const std::string objectName, const std::string& contentDispostionFilename, const std::string& contentType, const std::vector<std::pair<std::string, std::string>>& metadataHeader, std::shared_ptr<std::vector<uint8_t>> data, std::function<void(const Request & request, const Error & error)> completedCallback = nullptr) override;
private:
std::string m_region;
std::string m_bucket;
......
......@@ -23,7 +23,7 @@
#include <fmt/format.h>
void downloadObject()
void DownloadObject()
{
azure::storage::cloud_storage_account storage_account = azure::storage::cloud_storage_account::parse(_XPLATSTR("DefaultEndpointsProtocol=https;AccountName=myaccountname;AccountKey=myaccountkey"));
azure::storage::cloud_blob_client blob_client = storage_account.create_cloud_blob_client();
......
......@@ -18,6 +18,6 @@
#ifndef IOMANAGERAZURE_H
#define IOMANAGERAZURE_H
void downloadObject();
void DownloadObject();
#endif //IOMANAGERAZURE_H
......@@ -35,32 +35,32 @@
namespace OpenVDS
{
static std::string error_to_string(int error)
static std::string ErrorToString(int error)
{