X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fdevel-api%2Fadaptor-framework%2Ffile-loader.cpp;h=c5674563867aa1125106be152aed8c4407e7ef01;hb=refs%2Fchanges%2F27%2F221427%2F2;hp=b63b5c7c4ad83f1fdf95a93c5fc696a4c72d1b4e;hpb=e34085952b385dfebf5a66eda553216f32aa7153;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/devel-api/adaptor-framework/file-loader.cpp b/dali/devel-api/adaptor-framework/file-loader.cpp index b63b5c7..c567456 100644 --- a/dali/devel-api/adaptor-framework/file-loader.cpp +++ b/dali/devel-api/adaptor-framework/file-loader.cpp @@ -23,10 +23,19 @@ // INTERNAL INCLUDES #include +#include namespace Dali { +namespace +{ + +// limit maximum image down load size to 50 MB +const size_t MAXIMUM_DOWNLOAD_IMAGE_SIZE = 50 * 1024 * 1024 ; + +} + namespace FileLoader { @@ -45,6 +54,12 @@ std::streampos GetFileSize(const std::string& filename) return Dali::Internal::Adaptor::GetFileSize(filename); } +bool DownloadFileSynchronously(const std::string& filename, Dali::Vector &dataBuffer) +{ + size_t dataSize; + return TizenPlatform::Network::DownloadRemoteFileIntoMemory( filename, dataBuffer, dataSize, MAXIMUM_DOWNLOAD_IMAGE_SIZE ); +} + } //FileLoader } //Dali