#define DALI_TIZEN_PLATFORM_NETWORK_FILE_DOWNLOAD_H
/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
// EXTERNAL INCLUDES
#include <dali/public-api/common/dali-vector.h>
-#include <string>
-#include <mutex> //c++11
#include <stdint.h> // uint8
-#include <openssl/crypto.h>
+#include <mutex> //c++11
+#include <string>
namespace Dali
{
-
namespace TizenPlatform
{
-
namespace Network
{
-
/**
* Set up the cURL environment - this will ensure curl_global_init is called on startup
* and curl_global_cleanup is called on shutdown.
// Moveable but not copyable
- CurlEnvironment( const CurlEnvironment& ) = delete;
- CurlEnvironment& operator=( const CurlEnvironment& ) = delete;
- CurlEnvironment( CurlEnvironment&& ) = default;
- CurlEnvironment& operator=( CurlEnvironment&& ) = default;
-
- /**
- * Locking function for libcurl with openssl
- */
- static void OnOpenSSLLocking( int mode, int n, const char* file, int line );
-
- /**
- * Gets thread id for libcurl with openssl
- */
- static void GetThreadId( CRYPTO_THREADID* tid );
-
-private:
-
- void SetLockingFunction();
-
- void UnsetLockingFunction();
-
- static std::mutex* mMutexs;
+ CurlEnvironment(const CurlEnvironment&) = delete;
+ CurlEnvironment& operator=(const CurlEnvironment&) = delete;
+ CurlEnvironment(CurlEnvironment&&) = default;
+ CurlEnvironment& operator=(CurlEnvironment&&) = default;
};
-
/**
* Download a requested file into a memory buffer.
*
* @return true on success, false on failure
*
*/
-bool DownloadRemoteFileIntoMemory( const std::string& url,
- Dali::Vector<uint8_t>& dataBuffer,
- size_t& dataSize,
- size_t maximumAllowedSizeBytes );
+bool DownloadRemoteFileIntoMemory(const std::string& url,
+ Dali::Vector<uint8_t>& dataBuffer,
+ size_t& dataSize,
+ size_t maximumAllowedSizeBytes);
} // namespace Network