DALi Version 1.9.13
[platform/core/uifw/dali-demo.git] / builder / dali-builder.cpp
index 4481c3d..a688f58 100644 (file)
@@ -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 );
   };
 };
 
@@ -208,9 +215,9 @@ private:
     if(!layer)
     {
       layer = Layer::New();
-      layer.SetParentOrigin(ParentOrigin::CENTER);
-      layer.SetAnchorPoint(AnchorPoint::CENTER);
-      layer.SetSize( stage.GetRootLayer().GetCurrentSize() );
+      layer.SetProperty( Actor::Property::PARENT_ORIGIN,ParentOrigin::CENTER);
+      layer.SetProperty( Actor::Property::ANCHOR_POINT,AnchorPoint::CENTER);
+      layer.SetSize( stage.GetRootLayer().GetCurrentProperty< Vector3 >( Actor::Property::SIZE ) );
       stage.GetRootLayer().Add(layer);
 
       // render tasks may have been setup last load so remove them