19 constexpr
bool isSeparator(
char c) {
20 return c ==
'.' || c ==
'/' || c ==
'\\';
28 cname.reserve(input.
size());
32 while (end > 0 && isSeparator(input[end - 1])) {
36 bool ignoreSeparator =
true;
37 for (
size_t idx = 0; idx <
end; ++idx) {
38 if (isSeparator(input[idx])) {
39 if (ignoreSeparator) {
43 ignoreSeparator =
true;
45 cname.push_back(input[idx]);
46 ignoreSeparator =
false;
59 while (end > 0 && isSeparator(name[end - 1])) {
63 bool ignoreSeparator =
true;
64 for (
size_t idx = 0; idx <
end; ++idx) {
66 if (isSeparator(name[idx])) {
67 if (ignoreSeparator) {
71 ignoreSeparator =
true;
73 value =
static_cast<uint8_t>(name[idx]);
74 ignoreSeparator =
false;
76 hash = ((hash << 5) + hash) +
value;
84 while (!
s.empty() && isSeparator(
s.back())) {
85 s.uncheckedSubtract(1);
88 stripTrailingSeparators(a);
89 stripTrailingSeparators(b);
94 while (!
s.empty() && isSeparator(
s.front())) {
95 s.uncheckedAdvance(1);
99 bool ignoreSeparator =
true;
101 if (ignoreSeparator) {
102 skipOverSeparators(a);
103 skipOverSeparators(b);
106 return b.
empty() ? 0 : -1;
107 }
else if (b.
empty()) {
110 if (isSeparator(a.
front())) {
111 if (!isSeparator(b.
front())) {
112 return '.' - b.
front();
114 ignoreSeparator =
true;
119 ignoreSeparator =
false;
131 ssize_t idx = name.
size();
134 while (idx > 0 && isSeparator(name[idx - 1])) {
139 while (idx > 0 && !isSeparator(name[idx - 1])) {
145 while (idx > 0 && isSeparator(name[idx - 1])) {
static int cmp(folly::StringPiece nameA, folly::StringPiece nameB)
static folly::StringPiece getParent(folly::StringPiece name)
constexpr size_type size() const
—— Concurrent Priority Queue Implementation ——
static size_t hash(folly::StringPiece name)
constexpr bool empty() const
static std::string canonicalize(folly::StringPiece name)
auto end(TestAdlIterable &instance)
constexpr Iter begin() const
void uncheckedAdvance(size_type n)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
Range< const char * > StringPiece