1 // Copyright 2015 Samsung Electronics Co, Ltd. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "common/file_utils.h"
14 bool Exist(const std::string& path) {
15 return (access(path.c_str(), F_OK) != -1);
18 std::string BaseName(const std::string& path) {
19 char* p = basename(const_cast<char*>(path.c_str()));
20 return std::string(p);
23 std::string DirName(const std::string& path) {
24 char* p = dirname(const_cast<char*>(path.c_str()));
25 return std::string(p);