MCPcopy Create free account
hub / github.com/ablab/spades / root_dir_start

Function root_dir_start

ext/src/llvm/Path.cpp:114–132  ·  view source on GitHub ↗

Returns the position of the root directory in str. If there is no root directory in str, it returns StringRef::npos.

Source from the content-addressed store, hash-verified

112 // Returns the position of the root directory in str. If there is no root
113 // directory in str, it returns StringRef::npos.
114 size_t root_dir_start(StringRef str, Style style) {
115 // case "c:/"
116 if (real_style(style) == Style::windows) {
117 if (str.size() > 2 && str[1] == ':' && is_separator(str[2], style))
118 return 2;
119 }
120
121 // case "//net"
122 if (str.size() > 3 && is_separator(str[0], style) && str[0] == str[1] &&
123 !is_separator(str[2], style)) {
124 return str.find_first_of(separators(style), 2);
125 }
126
127 // case "/"
128 if (str.size() > 0 && is_separator(str[0], style))
129 return 0;
130
131 return StringRef::npos;
132 }
133
134 // Returns the position past the end of the "parent path" of path. The parent
135 // path will not end in '/', unless the parent is the root directory. If the

Callers 2

parent_path_endFunction · 0.85
Path.cppFile · 0.85

Calls 5

real_styleFunction · 0.85
is_separatorFunction · 0.85
separatorsFunction · 0.85
sizeMethod · 0.45
find_first_ofMethod · 0.45

Tested by

no test coverage detected