forked from approvals/ApprovalTests.cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Path.h
28 lines (21 loc) · 781 Bytes
/
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
#pragma once
#include "ApprovalTests/utilities/StringUtils.h"
#include "ApprovalTests/utilities/SystemUtils.h"
#include <string>
namespace ApprovalTests
{
class Path
{
std::string path_;
std::string separator_ = SystemUtils::getDirectorySeparator();
public:
Path(const std::string& start);
std::string toString() const;
std::string toString(const std::string& directoryPathSeparator) const;
Path operator+(const std::string& addition) const;
Path operator/(const std::string& addition) const;
Path operator/(const Path addition) const;
static std::string normalizeSeparators(const std::string& path);
std::string removeRedundantDirectorySeparators(std::string path) const;
};
}