1 #ifndef _XRDOSSCSICONFIG_H
2 #define _XRDOSSCSICONFIG_H
52 if (!path || !*path)
return false;
60 if (
prefix_.length() == s.length())
return true;
61 if (s[
prefix_.length()] ==
'/')
return true;
66 const size_t haystack = s.length();
67 const size_t needle = suffix_.length();
68 if (haystack >= needle && s.substr(haystack-needle, std::string::npos) == suffix_)
return true;
74 if (!v.empty() && v[0] !=
'/')
76 Eroute.
Emsg(
"Config",
"prefix must be empty or start with /");
90 if (!path || *path !=
'/' ||
prefix_.empty())
return std::string();
93 if (p.length()>1)
return prefix_ + p;
102 if (!path || *path !=
'/' ||
prefix_.empty())
return false;
105 if (prefixstart_ == p)
return true;
118 if (!path || *path !=
'/')
return std::string();
127 void calcPrefixElements()
129 prefixstart_.clear();
133 const size_t idx =
prefix_.rfind(
"/");
134 prefixstart_ =
prefix_.substr(0,idx);
135 if (prefixstart_.empty()) prefixstart_ = std::string(
"/");
136 prefixend_ =
prefix_.substr(idx+1,std::string::npos);
139 void simplePath(std::string &str)
144 i = str.find(
"//", i);
145 if (i == std::string::npos)
break;
147 }
while (!str.empty());
150 if (str.length()>1 && str[str.length()-1] ==
'/')
152 str.erase( str.end()-1 );
156 std::string prefixstart_;
157 std::string prefixend_;
165 XrdOssCsiConfig() : fillFileHole_(true), xrdtSpaceName_(
"public"), allowMissingTags_(true), disablePgExtend_(false), disableLooseWrite_(false) { }
190 std::string xrdtSpaceName_;
191 bool allowMissingTags_;
192 bool disablePgExtend_;
193 bool disableLooseWrite_;
std::string getPrefixName()
bool matchPrefixDir(const char *path)
std::string makeBaseDirname(const char *path)
std::string makeTagFilename(const char *path)
bool isTagFile(const char *path)
int SetPrefix(XrdSysError &Eroute, const std::string &v)
bool fillFileHole() const
std::string xrdtSpaceName() const
int Init(XrdSysError &, const char *, const char *, XrdOucEnv *)
bool disableLooseWrite() const
bool disablePgExtend() const
bool allowMissingTags() const
int Emsg(const char *esfx, int ecode, const char *text1, const char *text2=0)