#include "Files.hh"
#include <string>
#include <stdexcept>
#include <sstream>
#include <iomanip>
#include <sys/stat.h>
#include <unistd.h>
#include <sys/param.h>
#include <pwd.h>
#include <sys/types.h>
Namespaces | |
namespace | PIRL |
The Planetary Image Research Laboratory. | |
Defines | |
#define | S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
#define | S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) |
#define | S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) |
#define | PATHNAME_DELIMITER_UNIX '/' |
#define | PATHNAME_DELIMITER_WIN32 '\\' |
#define | PATHNAME_DELIMITER PATHNAME_DELIMITER_UNIX |
#define | EXTENSION_DELIMITER '.' |
Functions | |
bool | PIRL::file_exists (const std::string &pathname) |
Test if a file exists at a pathname. | |
bool | PIRL::file_is_normal (const std::string &pathname) |
Test if a file at a pathname is a normal file. | |
bool | PIRL::file_is_directory (const std::string &pathname) |
Test if a file at a pathname is a directory. | |
bool | PIRL::file_is_link (const std::string &pathname) |
Test if a file at a pathname is a link file. | |
off_t | PIRL::file_size (const std::string &pathname) |
Get the size of a file. | |
bool | PIRL::file_is_absolute (const std::string &pathname) |
Test if a pathname is an absolute pathname. | |
std::string & | PIRL::clean_pathname (std::string &pathname) |
Clean a pathname of redundant segments. | |
std::string | PIRL::CWD () |
Get the current working directory of the process. | |
std::string | PIRL::file_pathname (const std::string &filename) |
Get the full pathname for a filename. | |
std::string | PIRL::file_pathname (const std::string &directory, const std::string &filename) |
Get the full pathname for a filename. | |
std::string | PIRL::file_directory (const std::string &pathname) |
Get the leading directory portion of a pathname. | |
std::string | PIRL::file_directory_pathname (const std::string &pathname) |
Get the leading directory pathname portion of a pathname. | |
std::string | PIRL::file_name (const std::string &pathname) |
Get the final name portion of a pathname. | |
std::string | PIRL::file_basename (const std::string &pathname) |
Get the basename of a file's pathname. | |
std::string | PIRL::file_extension (const std::string &pathname) |
Get a file's extension. | |
bool | PIRL::file_is_readable (const std::string &pathname) |
Test if a file at a pathname is readable. | |
bool | PIRL::file_is_writeable (const std::string &pathname) |
Test if a file at a pathname is writeable. | |
std::string | PIRL::home_directory_pathname () |
Get the user's home directory pathname. | |
std::string | PIRL::username () |
Get the effective username. | |
unsigned int | PIRL::UID () |
Get the effective user ID. | |
unsigned int | PIRL::GID () |
Get the effective group ID. | |
std::string | PIRL::hostname () |
Get the name of the host system. | |
Variables | |
const char * | PIRL::Files_ID = "PIRL::Files ($Revision: 2.4 $ $Date: 2010/11/21 20:33:26 $)" |
Module identification name with source code version and date. | |
const char | PIRL::FILE_PATHNAME_DELIMITER = PATHNAME_DELIMITER |
Host filesystem pathname delimiter ('/'). | |
const char | PIRL::FILE_EXTENSION_DELIMITER = EXTENSION_DELIMITER |
Filename extension delimiter ('.'). |
#define S_ISREG | ( | m ) | (((m) & S_IFMT) == S_IFREG) |
Referenced by PIRL::file_is_normal().
#define S_ISDIR | ( | m ) | (((m) & S_IFMT) == S_IFDIR) |
Referenced by PIRL::file_is_directory().
#define S_ISLNK | ( | m ) | (((m) & S_IFMT) == S_IFLNK) |
Referenced by PIRL::file_is_link().
#define PATHNAME_DELIMITER_UNIX '/' |
Referenced by PIRL::file_is_absolute().
#define PATHNAME_DELIMITER_WIN32 '\\' |
Referenced by PIRL::file_is_absolute().
#define PATHNAME_DELIMITER PATHNAME_DELIMITER_UNIX |
#define EXTENSION_DELIMITER '.' |