| 42 | } |
| 43 | |
| 44 | void filepath::parse_bits() const { |
| 45 | bits.clear(); |
| 46 | int off = 0; |
| 47 | while (off < (int)path.length()) { |
| 48 | int nextslash = path.find('/', off); |
| 49 | if (nextslash < 0) |
| 50 | nextslash = path.length(); // no more slashes |
| 51 | if (((nextslash - off) > 0) || encoded) { |
| 52 | // skip empty components unless they were introduced deliberately |
| 53 | // see commit message for more detail |
| 54 | bits.push_back( path.substr(off,nextslash-off) ); |
| 55 | } |
| 56 | off = nextslash+1; |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | void filepath::set_trimmed() { |
| 61 | if (trimmed) |