Last change
on this file since 13624 was 11664, checked in by mdewsnip, 18 years ago |
Fixed the line endings... for real this time, I hope.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.2 KB
|
Rev | Line | |
---|
[11664] | 1 | #ifndef _FILEPATH_H_
|
---|
| 2 | #define _FILEPATH_H_
|
---|
| 3 | #include <string>
|
---|
| 4 |
|
---|
| 5 | // use the standard namespace
|
---|
| 6 | #if !defined (GSDL_NAMESPACE_BROKEN)
|
---|
| 7 | #if defined(GSDL_USE_OBJECTSPACE)
|
---|
| 8 | using namespace ospace::std;
|
---|
| 9 | #else
|
---|
| 10 | using namespace std;
|
---|
| 11 | #endif
|
---|
| 12 | #endif
|
---|
| 13 |
|
---|
| 14 | #include <string.h>
|
---|
| 15 |
|
---|
| 16 | class FilePath
|
---|
| 17 | {
|
---|
| 18 | private:
|
---|
| 19 | bool is_aRoot; // indicates whether this directory/file is a file root
|
---|
| 20 | void _init(string path, string subPath);
|
---|
| 21 | protected:
|
---|
| 22 | string path; // full path of this item
|
---|
| 23 | public:
|
---|
| 24 | FilePath();
|
---|
| 25 | FilePath(string filePath);
|
---|
| 26 | FilePath(string filePath, string filePath2);
|
---|
| 27 | FilePath(int nPaths, ...);
|
---|
| 28 | FilePath(FilePath &path, string subPath);
|
---|
| 29 | bool isRoot();
|
---|
| 30 | bool isEmpty();
|
---|
| 31 | int compare(const FilePath &other) const;
|
---|
| 32 | int compare(const char *other) const;
|
---|
| 33 | FilePath *append(FilePath &path);
|
---|
| 34 | FilePath *append(char *path);
|
---|
| 35 | FilePath *parent();
|
---|
| 36 | FilePath *root();
|
---|
| 37 | FilePath *rootDrive();
|
---|
| 38 | bool isAncestorOf(string pathString);
|
---|
| 39 | bool ensureWriteablePath();
|
---|
| 40 | bool exists();
|
---|
| 41 | const char *cString();
|
---|
| 42 | string pathString();
|
---|
| 43 | bool operator==(const FilePath &b) const { return this->compare(b) == 0; }
|
---|
| 44 | bool operator!=(const FilePath &b) const { return this->compare(b) != 0; }
|
---|
| 45 | bool operator<(const FilePath &b) const { return this->compare(b) < 0; }
|
---|
| 46 | };
|
---|
| 47 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.