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=90a87fc509e9dd023f271b4d08b7df0e2b923e75;hp=19d038d6b7457b8cd49fe28b0aa57638727d6811;hb=15867edb828e4414d4e8c465ad3b89290f76ff2c;hpb=6bd46a2944d89638f1c1a1c609f72c9348db6abb diff --git a/dali-toolkit/internal/builder/builder-filesystem.h b/dali-toolkit/internal/builder/builder-filesystem.h old mode 100644 new mode 100755 index 19d038d..90a87fc --- a/dali-toolkit/internal/builder/builder-filesystem.h +++ b/dali-toolkit/internal/builder/builder-filesystem.h @@ -1,57 +1,43 @@ -#ifndef __DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H__ -#define __DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H__ - -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Flora License, Version 1.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://floralicense.org/license/ -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an AS IS BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// +#ifndef DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H +#define DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H + +/* + * Copyright (c) 2019 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ // EXTERNAL INCLUDES #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]; - readlink("/proc/self/exe", buf, sizeof(buf)); - 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__ +#endif // DALI_TOOLKIT_INTERNAL_BUILDER_FILESYSTEM_H