-
-
Notifications
You must be signed in to change notification settings - Fork 113
/
Copy pathdirectory_path.h
37 lines (27 loc) · 860 Bytes
/
directory_path.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#pragma once
#include "stdafx.h"
#include "my_containers.h"
class FilePath;
bool isAbsolutePath(const char* path);
string getAbsolute(const char* path);
class DirectoryPath {
public:
explicit DirectoryPath(string);
FilePath file(const string&) const;
DirectoryPath subdirectory(const string& s) const;
bool exists() const;
void createIfDoesntExist() const;
void removeRecursively() const;
vector<FilePath> getFiles() const;
vector<string> getSubDirs() const;
const char* getPath() const;
static DirectoryPath current();
optional<string> copyRecursively(DirectoryPath to);
bool isAbsolute() const;
DirectoryPath absolute() const;
private:
friend class FilePath;
friend ostream& operator << (ostream& d, const DirectoryPath& path);
string path;
};
extern ostream& operator <<(ostream& d, const DirectoryPath& path);