#ifndef _FILEPATH_H_ #define _FILEPATH_H_ #include using namespace std; class FilePath { private: string path; // full path of this item bool is_aRoot; // indicates whether this directory/file is a file root void _init(string path, string subPath); public: FilePath(); FilePath(string filePath); FilePath(string filePath, string filePath2); FilePath(int nPaths, ...); FilePath(FilePath &path, string subPath); bool equals(FilePath &path); bool equals(const char *path); bool isRoot(); bool isEmpty(); FilePath *append(FilePath &path); FilePath *append(char *path); FilePath *parent(); FilePath *root(); FilePath *rootDrive(); bool ensureWriteablePath(); bool exists(); const char *cString(); string pathString(); bool operator==(const FilePath &b) { return this->path == b.path; } bool operator!=(const FilePath &b) { return this->path != b.path; } bool operator<(const FilePath &b) { return this->path < b.path; } }; #endif