CernVM-FS
2.12.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
lease_path_util.cc
Go to the documentation of this file.
1
5
#include "
lease_path_util.h
"
6
7
namespace
receiver {
8
9
bool
IsSubPath
(
const
PathString
& parent,
const
PathString
& path) {
10
// If parent is "", then any path is a subpath
11
if
(parent.
GetLength
() == 0) {
12
return
true
;
13
}
14
15
// If the parent string is the prefix of the path string and either
16
// the strings are identical or the separator character is a "/",
17
// then the path is a subpath
18
if
(path.
StartsWith
(parent) &&
19
((path.
GetLength
() == parent.
GetLength
()) ||
20
(path.
GetChars
()[parent.
GetLength
()] ==
'/'
) ||
21
(path.
GetChars
()[parent.
GetLength
() - 1] ==
'/'
))) {
22
return
true
;
23
}
24
25
return
false
;
26
}
27
28
}
// namespace receiver
receiver::IsSubPath
bool IsSubPath(const PathString &parent, const PathString &path)
Definition:
lease_path_util.cc:9
lease_path_util.h
ShortString::StartsWith
bool StartsWith(const ShortString &other) const
Definition:
shortstring.h:189
ShortString::GetLength
unsigned GetLength() const
Definition:
shortstring.h:131
ShortString::GetChars
const char * GetChars() const
Definition:
shortstring.h:123
ShortString
Definition:
shortstring.h:27
cvmfs
cvmfs
receiver
lease_path_util.cc
Generated on Sun Oct 13 2024 00:21:14 for CernVM-FS by
1.8.5