Last change
on this file since 1673 was 1544, checked in by cs025, 24 years ago |
Made comparison in FilePath case-insensitive.
|
-
Property svn:keywords
set to
Author Date Id Revision
|
File size:
1.2 KB
|
Line | |
---|
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 ensureWriteablePath();
|
---|
39 | bool exists();
|
---|
40 | const char *cString();
|
---|
41 | string pathString();
|
---|
42 | bool operator==(const FilePath &b) const { return this->compare(b) == 0; }
|
---|
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 | };
|
---|
46 | #endif
|
---|
Note:
See
TracBrowser
for help on using the repository browser.