summaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
diff options
context:
space:
mode:
authormikhnenko <[email protected]>2023-10-11 11:15:58 +0300
committermikhnenko <[email protected]>2023-10-11 12:05:11 +0300
commit84c5d4bb733b49d5f9f36dbf0c22ec200d9e6334 (patch)
tree8dc43a7531874e613966d58a48af6acda89954fe /contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
parentb95dc8e862f26368aa0275e2571eefe238c1951e (diff)
Upd libc++ to 0cc34ca7ecfc9d0efee322f60ed6c3169f4f70ca (12 Apr 2022)
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp')
-rw-r--r--contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
index 82d321942a6..5db0115f650 100644
--- a/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
+++ b/contrib/libs/cxxsupp/libcxx/src/filesystem/operations.cpp
@@ -214,14 +214,14 @@ public:
switch (State) {
case PS_BeforeBegin:
case PS_AtEnd:
- return PS("");
+ return PATHSTR("");
case PS_InRootDir:
if (RawEntry[0] == '\\')
- return PS("\\");
+ return PATHSTR("\\");
else
- return PS("/");
+ return PATHSTR("/");
case PS_InTrailingSep:
- return PS("");
+ return PATHSTR("");
case PS_InRootName:
case PS_InFilenames:
return RawEntry;
@@ -391,8 +391,8 @@ private:
};
string_view_pair separate_filename(string_view_t const& s) {
- if (s == PS(".") || s == PS("..") || s.empty())
- return string_view_pair{s, PS("")};
+ if (s == PATHSTR(".") || s == PATHSTR("..") || s.empty())
+ return string_view_pair{s, PATHSTR("")};
auto pos = s.find_last_of('.');
if (pos == string_view_t::npos || pos == 0)
return string_view_pair{s, string_view_t{}};
@@ -1620,7 +1620,7 @@ path& path::replace_extension(path const& replacement) {
}
if (!replacement.empty()) {
if (replacement.native()[0] != '.') {
- __pn_ += PS(".");
+ __pn_ += PATHSTR(".");
}
__pn_.append(replacement.__pn_);
}
@@ -1742,14 +1742,14 @@ enum PathPartKind : unsigned char {
static PathPartKind ClassifyPathPart(string_view_t Part) {
if (Part.empty())
return PK_TrailingSep;
- if (Part == PS("."))
+ if (Part == PATHSTR("."))
return PK_Dot;
- if (Part == PS(".."))
+ if (Part == PATHSTR(".."))
return PK_DotDot;
- if (Part == PS("/"))
+ if (Part == PATHSTR("/"))
return PK_RootSep;
#if defined(_LIBCPP_WIN32API)
- if (Part == PS("\\"))
+ if (Part == PATHSTR("\\"))
return PK_RootSep;
#endif
return PK_Filename;
@@ -1799,7 +1799,7 @@ path path::lexically_normal() const {
NewPathSize -= Parts.back().first.size();
Parts.pop_back();
} else if (LastKind != PK_RootSep)
- AddPart(PK_DotDot, PS(".."));
+ AddPart(PK_DotDot, PATHSTR(".."));
MaybeNeedTrailingSep = LastKind == PK_Filename;
break;
}
@@ -1814,7 +1814,7 @@ path path::lexically_normal() const {
}
// [fs.path.generic]p6.8: If the path is empty, add a dot.
if (Parts.empty())
- return PS(".");
+ return PATHSTR(".");
// [fs.path.generic]p6.7: If the last filename is dot-dot, remove any
// trailing directory-separator.
@@ -1826,7 +1826,7 @@ path path::lexically_normal() const {
Result /= PK.first;
if (NeedTrailingSep)
- Result /= PS("");
+ Result /= PATHSTR("");
Result.make_preferred();
return Result;
@@ -1836,9 +1836,9 @@ static int DetermineLexicalElementCount(PathParser PP) {
int Count = 0;
for (; PP; ++PP) {
auto Elem = *PP;
- if (Elem == PS(".."))
+ if (Elem == PATHSTR(".."))
--Count;
- else if (Elem != PS(".") && Elem != PS(""))
+ else if (Elem != PATHSTR(".") && Elem != PATHSTR(""))
++Count;
}
return Count;
@@ -1885,15 +1885,15 @@ path path::lexically_relative(const path& base) const {
return {};
// if n == 0 and (a == end() || a->empty()), returns path("."); otherwise
- if (ElemCount == 0 && (PP.atEnd() || *PP == PS("")))
- return PS(".");
+ if (ElemCount == 0 && (PP.atEnd() || *PP == PATHSTR("")))
+ return PATHSTR(".");
// return a path constructed with 'n' dot-dot elements, followed by the the
// elements of '*this' after the mismatch.
path Result;
// FIXME: Reserve enough room in Result that it won't have to re-allocate.
while (ElemCount--)
- Result /= PS("..");
+ Result /= PATHSTR("..");
for (; PP; ++PP)
Result /= *PP;
return Result;
@@ -1906,7 +1906,7 @@ static int CompareRootName(PathParser *LHS, PathParser *RHS) {
return 0;
auto GetRootName = [](PathParser *Parser) -> string_view_t {
- return Parser->inRootName() ? **Parser : PS("");
+ return Parser->inRootName() ? **Parser : PATHSTR("");
};
int res = GetRootName(LHS).compare(GetRootName(RHS));
ConsumeRootName(LHS);