| 391 | } |
| 392 | |
| 393 | String Path::getDirectory(U32 count) const |
| 394 | { |
| 395 | if (mPath.isEmpty()) |
| 396 | return String(); |
| 397 | |
| 398 | U32 offset = 0; |
| 399 | |
| 400 | if (mPath.c_str()[0] == '/') |
| 401 | offset++; |
| 402 | |
| 403 | while (count && offset < mPath.length()) |
| 404 | { |
| 405 | if (mPath[offset++] == '/') |
| 406 | count--; |
| 407 | } |
| 408 | |
| 409 | U32 end = offset; |
| 410 | |
| 411 | while (end < mPath.length() && mPath[end] != '/') |
| 412 | end++; |
| 413 | |
| 414 | return mPath.substr(offset,end - offset); |
| 415 | } |
| 416 | |
| 417 | //----------------------------------------------------------------------------- |
| 418 |
no test coverage detected