diff options
author | Anton Obzhirov <a.obzhirov@samsung.com> | 2019-07-03 15:01:53 +0100 |
---|---|---|
committer | Anton Obzhirov <a.obzhirov@samsung.com> | 2019-07-05 11:00:01 +0000 |
commit | e73c5dea0fd58569c54a3384098e343d9449e2bd (patch) | |
tree | 59d9c851509fbe766be60ea65c0bfb2e2beed1ad /builder | |
parent | 3293b5b24087b52a84b5ed7fe5598a5291bf29e3 (diff) | |
download | dali-demo-e73c5dea0fd58569c54a3384098e343d9449e2bd.tar.gz dali-demo-e73c5dea0fd58569c54a3384098e343d9449e2bd.tar.bz2 dali-demo-e73c5dea0fd58569c54a3384098e343d9449e2bd.zip |
All file read operations should be done through FileLoader.
Change-Id: I2078c71affd10d5bcf57c606effd95ae1bc79bd4
Diffstat (limited to 'builder')
-rw-r--r-- | builder/dali-builder.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/builder/dali-builder.cpp b/builder/dali-builder.cpp index 4481c3d5..5445fd19 100644 --- a/builder/dali-builder.cpp +++ b/builder/dali-builder.cpp @@ -27,6 +27,7 @@ //------------------------------------------------------------------------------ #include <dali/dali.h> +#include <dali/devel-api/adaptor-framework/file-loader.h> #include <dali-toolkit/dali-toolkit.h> #include <dali-toolkit/devel-api/builder/builder.h> #include <dali-toolkit/devel-api/builder/tree-node.h> @@ -102,10 +103,16 @@ private: std::time_t mLastTime; std::string mstringPath; - std::string GetFileContents(const std::string &fn) + std::string GetFileContents(const std::string &filename) { - std::ifstream t(fn.c_str()); - return std::string((std::istreambuf_iterator<char>(t)), std::istreambuf_iterator<char>()); + std::streampos bufferSize = 0; + Dali::Vector<char> fileBuffer; + if( !Dali::FileLoader::ReadFile( filename, bufferSize, fileBuffer, FileLoader::FileType::BINARY ) ) + { + return std::string(); + } + + return std::string( &fileBuffer[0], bufferSize ); }; }; |