Classes

file.h File Reference

#include "common/common.h"
#include <dirent.h>
#include <unistd.h>
#include <sys/errno.h>
#include <sys/file.h>
Include dependency graph for file.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  smart_fd
 smart file descriptor -- only use this for low-level objects! You probably want to use nstream or iostreams instead. More...
class  smart_dir
 smart directory handle. More...
class  AdvisoryLock
 advisory locking object WARNING: has no effect in Windows More...



#define THROW_ERROR(error, args)
 throws a (hopefully) descriptive error based on errno passed in
const char * GetExtension (IN const char *filename) throw ()
bool hasExtension (IN const char *filename, IN const char *extension) throw ()
 returns true if the given filename ends with the specified string (NOT case-sensitive)
void GetFileRoot (IN const char *filename, OUT std::string &file_root)
void GetParentDirectory (IN const char *filename, OUT std::string &directory) throw ()
const char * getTopDirectory (IN const char *filename, OUT std::string &topDir)
 retrieves the highest known folder for the given file.
std::string getPathRelativeTo (IN const char *startFilename, IN const char *relFilename)
 given a starting filename, and then a path relative to that, return the full path of the file.
void appendPath (IN const char *parentDirectory, IN const char *nextPath, OUT std::string &path)
 given a starting path (directory), append another piece of the path
const char * GetFilename (IN const char *path) throw ()
void getTempfile (IN const char *path, OUT std::string &tempfile) throw ()
void getUserHomePath (OUT std::string &path)
bool ContainsWhitespace (IN const char *test) throw ()
bool doesPathExist (IN const char *path) throw ()
void createEmptyFileIfDoesNotExist (IN const char *path) throw ()
void walkDirectoryTree (IN const char *rootDirectory, IN const char *matchExtension, OUT VecString &paths)
 does a recursive directory walk, and returns all paths relative to root