MCPcopy Create free account
hub / github.com/catboost/catboost / SplitUserInfo

Function SplitUserInfo

library/cpp/neh/location.cpp:12–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10 }
11
12 bool SplitUserInfo(TStringBuf& path, TStringBuf& userInfo, bool mayHaveSpecificUserInfo) {
13 const size_t pos = path.find_first_of(mayHaveSpecificUserInfo ? TStringBuf("?@") : TStringBuf("?@/"));
14
15 if (TStringBuf::npos != pos && '@' == path[pos]) {
16 if (mayHaveSpecificUserInfo) {
17 if (!(path.StartsWith("cert=") || path.StartsWith("key="))) {
18 return false;
19 }
20 }
21
22 path.SplitAt(pos, userInfo, path);
23 path.Skip(1);
24 }
25
26 return true;
27 }
28}
29
30TParsedLocation::TParsedLocation(TStringBuf path) {

Callers 1

TParsedLocationMethod · 0.85

Calls 4

SplitAtMethod · 0.80
find_first_ofMethod · 0.45
StartsWithMethod · 0.45
SkipMethod · 0.45

Tested by

no test coverage detected