X-Git-Url: https://git.saurik.com/apple/system_cmds.git/blobdiff_plain/1a7e3f61d38d679bba59130891c2031b5a0092b6..bd6521f0fc816ab056bc71376f9706a69b3b52c1:/CPPUtil/UtilPath.hpp diff --git a/CPPUtil/UtilPath.hpp b/CPPUtil/UtilPath.hpp new file mode 100644 index 0000000..6eb2bb9 --- /dev/null +++ b/CPPUtil/UtilPath.hpp @@ -0,0 +1,34 @@ +// +// UtilPath.hpp +// CPPUtil +// +// Created by James McIlree on 4/8/13. +// Copyright (c) 2013 Apple. All rights reserved. +// + +#ifndef CPPUtil_UtilPath_hpp +#define CPPUtil_UtilPath_hpp + +class Path { + public: + /* + * INPUT OUTPUT + * + * /tmp/scratch.tiff scratch.tiff + * /tmp/scratch scratch + * /tmp/ tmp + * scratch scratch + * /mach_kernel mach_kernel + * / / + */ + static std::string basename(const char* path); + static std::string basename(std::string& path); + + static bool exists(const char* path); + static bool exists(std::string& path); + + static bool is_file(const char* path, bool should_resolve_symlinks); + static bool is_file(std::string& path, bool should_resolve_symlinks); +}; + +#endif