Dali 3D User Interface Engine
Functions
Dali::TizenPlatform::Network Namespace Reference

Functions

bool DownloadRemoteFileIntoMemory (const std::string &url, Dali::Vector< uint8_t > &dataBuffer, size_t &dataSize, size_t maximumAllowedSizeBytes)
 Download a requested file into a memory buffer. More...
 
bool IsHttpUrl (const std::string &path)
 Tests if a string starts with either http:// or https://. More...
 

Function Documentation

bool Dali::TizenPlatform::Network::DownloadRemoteFileIntoMemory ( const std::string &  url,
Dali::Vector< uint8_t > &  dataBuffer,
size_t &  dataSize,
size_t  maximumAllowedSizeBytes 
)

Download a requested file into a memory buffer.

Threading notes: This function can be called from multiple threads, however l we must explicitly call curl_global_init() from a single thread before using curl as the global function calls are not thread safe.

Parameters
[in]urlThe requested file url
[out]dataBufferA memory buffer object to be written with downloaded file data.
[out]dataSizeThe size of the memory buffer.
[in]maximumAllowedSizeThe maxmimum allowed file size in bytes to download. E.g. for an Image file this may be 50 MB
Returns
true on success, false on failure

Definition at line 145 of file file-download.cpp.

References DALI_LOG_WARNING, and Dali::TizenPlatform::anonymous_namespace{file-download.cpp}::DownloadFile().

Referenced by Dali::TizenPlatform::ResourceThreadImage::DownloadRemoteImageIntoMemory().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::TizenPlatform::Network::IsHttpUrl ( const std::string &  path)

Tests if a string starts with either http:// or https://.

Parameters
[in]pathstring
Returns
true if the path is a http url

Definition at line 37 of file http-utils.cpp.

References Dali::TizenPlatform::anonymous_namespace{http-utils.cpp}::HTTP_URL, Dali::TizenPlatform::anonymous_namespace{http-utils.cpp}::HTTPS_URL, and Dali::TizenPlatform::anonymous_namespace{http-utils.cpp}::MIN_HTTP_URL_LENGTH.

Referenced by Dali::TizenPlatform::ResourceBitmapRequester::LoadResource().

Here is the caller graph for this function:

Dali Docs Home
Read more about Dali