source: trunk/gsinstaller/FilePath.h@ 1539

Last change on this file since 1539 was 1539, checked in by sjboddie, 24 years ago

Got compiling on VC++ 4.2

  • 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)
8using namespace ospace::std;
9#else
10using namespace std;
11#endif
12#endif
13
14class FilePath
15{
16private:
17 string path; // full path of this item
18 bool is_aRoot; // indicates whether this directory/file is a file root
19 void _init(string path, string subPath);
20public:
21 FilePath();
22 FilePath(string filePath);
23 FilePath(string filePath, string filePath2);
24 FilePath(int nPaths, ...);
25 FilePath(FilePath &path, string subPath);
26 bool equals(FilePath &path);
27 bool equals(const char *path);
28 bool isRoot();
29 bool isEmpty();
30 FilePath *append(FilePath &path);
31 FilePath *append(char *path);
32 FilePath *parent();
33 FilePath *root();
34 FilePath *rootDrive();
35 bool ensureWriteablePath();
36 bool exists();
37 const char *cString();
38 string pathString();
39 bool operator==(const FilePath &b) const { return this->path == b.path; }
40 bool operator!=(const FilePath &b) const { return this->path != b.path; }
41 bool operator<(const FilePath &b) const { return this->path < b.path; }
42};
43#endif
Note: See TracBrowser for help on using the repository browser.