X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fbuilder%2Fbuilder-filesystem.h;h=5e032a08b2245b88c4269a7d97f1f7e9a7a2ae04;hp=75e9d286091b7e4e977bb2b6ca8a3b89c5e64eb0;hb=7018f61b640b6fcf9cb576b537bafcb6bb8240e8;hpb=b694e7e2ae624e206e1548b1a863c554eb9cd4d7 diff --git a/dali-toolkit/internal/builder/builder-filesystem.h b/dali-toolkit/internal/builder/builder-filesystem.h old mode 100755 new mode 100644 index 75e9d28..5e032a0 --- a/dali-toolkit/internal/builder/builder-filesystem.h +++ b/dali-toolkit/internal/builder/builder-filesystem.h @@ -2,7 +2,7 @@ #define DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H /* - * Copyright (c) 2019 Samsung Electronics Co., Ltd. + * Copyright (c) 2021 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,43 +19,24 @@ */ // EXTERNAL INCLUDES -#include #include #include +#include -#include #include -#include -inline std::string ExpandPath(const std::string &name) +#include + +inline std::string GetFileContents(const std::string& fn) { - wordexp_t p; - char** w; - wordexp( name.c_str(), &p, 0 ); - w = p.we_wordv; - std::stringstream s; - for (size_t i=0; i fileBuffer; + if(!Dali::FileLoader::ReadFile(fn, bufferSize, fileBuffer, Dali::FileLoader::FileType::BINARY)) { - s << w[i]; + return std::string(); } - wordfree( &p ); - return s.str(); -} - -inline std::string ExePath(void) -{ - char buf[256]; - ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1); - len = len > 0 ? len : 0; - buf[len] = '\0'; - return std::string(buf); -} - -inline std::string GetFileContents(const std::string &fn) -{ - std::ifstream t(fn.c_str()); - return std::string((std::istreambuf_iterator(t)), std::istreambuf_iterator()); + return std::string(&fileBuffer[0], bufferSize); } #endif // DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H