-
Notifications
You must be signed in to change notification settings - Fork 2
/
chord.path.h
72 lines (43 loc) · 1.36 KB
/
chord.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#pragma once
#include <iosfwd>
#include <filesystem>
#include <set>
#include <string>
#include <string_view>
#include <fmt/ostream.h>
#include <spdlog/fmt/ostr.h>
namespace chord {
class path {
private:
std::filesystem::path _path;
public:
path() = default;
path(const chord::path &other) = default;
path(std::filesystem::path path);
virtual ~path() = default;
std::set<path> all_paths() const;
path canonical() const;
path filename() const;
path extension() const;
path parent_path() const;
std::set<path> recursive_contents() const;
std::set<path> contents() const;
std::string string() const;
bool empty() const noexcept ;
operator std::string() const;
path operator/=(const path &p);
path operator-(const path &p) const;
path operator/(const path& p) const;
path operator/(const std::string_view p) const;
bool operator==(const path &p) const;
bool operator!=(const path &p) const;
bool operator<(const path &p) const;
bool operator<=(const path &p) const;
bool operator>(const path &p) const;
bool operator>=(const path &p) const;
bool operator==(const std::string &s) const;
friend bool operator==(const std::string &p1, const path &p2);
friend std::ostream &operator<<(std::ostream &os, const path &path);
};
} //namespace chord
template<> struct fmt::formatter<chord::path> : ostream_formatter {};