path.cxx File Reference
File/directory path related functions. More...
#include <vector>
#include <basis/config.h>
#include <stdlib.h>
#include <string.h>
#include <cctype>
#include <algorithm>
#include <sys/stat.h>
#include <basis/except.h>
#include <basis/os.h>
#include <basis/os/path.h>
Include dependency graph for path.cxx:
Go to the source code of this file.
Namespaces | |
namespace | basis |
namespace | basis::os |
namespace | basis::os::path |
Functions | |
std::string | basis::os::path::abspath (const std::string &path) |
Make path absolute. | |
std::string | basis::os::path::basename (const std::string &path) |
Get file name. | |
std::string | basis::os::path::dirname (const std::string &path) |
Get file directory. | |
bool | basis::os::path::exists (const std::string path) |
Test the existance of a file or directory. | |
bool | basis::os::path::hasext (const std::string &path, const std::set< std::string > *exts=NULL) |
Test whether a given path has an extension. | |
bool | basis::os::path::isabs (const std::string &path) |
Test whether a given path is absolute. | |
bool | basis::os::path::isdir (const std::string path) |
Test whether a given path is the path of an existent directory. | |
bool | basis::os::path::isfile (const std::string path) |
Test whether a given path is the path of an existent file. | |
bool | basis::os::path::islink (const std::string &path) |
Whether a given path is a symbolic link. | |
bool | basis::os::path::issep (char c) |
Determine if a given character is a path separator. | |
std::string | basis::os::path::join (const std::string &base, const std::string &path) |
Join two paths, e.g., base path and relative path. | |
std::string | basis::os::path::normpath (const std::string &path) |
Normalize path, i.e., remove occurences of "./", duplicate slashes,... | |
std::string | basis::os::path::ntpath (const std::string &path) |
Convert path to Windows representation. | |
std::string | basis::os::path::posixpath (const std::string &path) |
Convert path to Posix (e.g., Unix, Mac OS) representation. | |
std::string | basis::os::path::realpath (const std::string &path) |
Get canonical file path. | |
std::string | basis::os::path::relpath (const std::string &path, const std::string &base=std::string()) |
Make path relative. | |
void | basis::os::path::split (const std::string &path, std::string &head, std::string &tail) |
Split path into two parts. | |
std::vector< std::string > | basis::os::path::split (const std::string &path) |
Split path into two parts. | |
void | basis::os::path::splitdrive (const std::string &path, std::string &drive, std::string &tail) |
Get drive specification of Windows path. | |
std::vector< std::string > | basis::os::path::splitdrive (const std::string &path) |
Get drive specification of Windows path. | |
void | basis::os::path::splitext (const std::string &path, std::string &head, std::string &ext, const std::set< std::string > *exts=NULL, bool icase=false) |
Get file name extension. | |
std::vector< std::string > | basis::os::path::splitext (const std::string &path, const std::set< std::string > *exts=NULL) |
Get file name extension. |
Detailed Description
File/directory path related functions.
Copyright (c) 2011, 2012 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
Contact: SBIA Group <sbia-software at uphs.upenn.edu>
Definition in file path.cxx.