Fix svace issue - uninitialized class member
[platform/core/uifw/dali-adaptor.git] / platform-abstractions / tizen / resource-loader / network / file-download.h
1 #ifndef __DALI_TIZEN_PLATFORM_NETWORK_FILE_DOWNLOAD_H__
2 #define __DALI_TIZEN_PLATFORM_NETWORK_FILE_DOWNLOAD_H__
3
4 /*
5  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/common/dali-vector.h>
23 #include <string>
24 #include <stdint.h> // uint8
25
26 namespace Dali
27 {
28
29 namespace TizenPlatform
30 {
31
32 namespace Network
33 {
34
35 /**
36  * Download a requested file into a memory buffer.
37  * Threading notes: This function can be called from multiple threads, however l
38  * we must explicitly call curl_global_init() from a single thread before using curl
39  * as the global function calls are not thread safe.
40  *
41  * @param[in] url The requested file url
42  * @param[out] dataBuffer  A memory buffer object to be written with downloaded file data.
43  * @param[out] dataSize  The size of the memory buffer.
44  * @param[in] maximumAllowedSize The maxmimum allowed file size in bytes to download. E.g. for an Image file this may be 50 MB
45  * @return true on success, false on failure
46  *
47  */
48 bool DownloadRemoteFileIntoMemory( const std::string& url,
49                                    Dali::Vector<uint8_t>& dataBuffer,
50                                    size_t& dataSize,
51                                    size_t maximumAllowedSizeBytes );
52
53 } // namespace Network
54
55 } // namespace TizenPlatform
56
57 } // namespace Dali
58
59 #endif // __DALI_TIZEN_PLATFORM_RESOURCE_THREAD_IMAGE_H__