~ubuntu-branches/ubuntu/karmic/icewm/karmic

« back to all changes in this revision

Viewing changes to src/upath.h

  • Committer: Bazaar Package Importer
  • Author(s): Andrew Starr-Bochicchio
  • Date: 2009-06-05 23:39:03 UTC
  • mfrom: (1.2.12 upstream) (3.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090605233903-an40kzzm9pdp0zue
Tags: 1.2.37+1.3.4pre2-2ubuntu1
* Merge from debian unstable, remaining changes:
 - debian/rules: call dh_icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __UPATH_H
 
2
#define __UPATH_H
 
3
 
 
4
#include "mstring.h"
 
5
 
 
6
typedef mstring pstring;
 
7
 
 
8
class upath {
 
9
public:
 
10
    upath(const class null_ref &): fPath(null) {}
 
11
    upath(pstring path): fPath(path) {}
 
12
    upath(const char *path): fPath(path) {}
 
13
    upath(): fPath(null) {};
 
14
 
 
15
    upath parent() const;
 
16
    pstring name() const;
 
17
    upath relative(const upath &path) const;
 
18
    upath child(const char *path) const;
 
19
 
 
20
    bool isAbsolute();
 
21
    bool fileExists();
 
22
    bool dirExists();
 
23
    bool isReadable();
 
24
    int access(int mode);
 
25
    upath addExtension(const char *ext) const;
 
26
 
 
27
    upath operator=(const upath& p) {
 
28
        fPath = p.fPath;
 
29
        return *this;
 
30
    }
 
31
 
 
32
    upath operator=(const class null_ref &) {
 
33
        fPath = null;
 
34
        return *this;
 
35
    }
 
36
 
 
37
    bool operator==(const class null_ref &) const { return fPath == null; }
 
38
    bool operator!=(const class null_ref &) const { return fPath != null; }
 
39
 
 
40
    bool equals(const upath &s) const;
 
41
 
 
42
    pstring path() const { return fPath; }
 
43
private:
 
44
    pstring fPath;
 
45
};
 
46
 
 
47
#endif