| 44 | } |
| 45 | |
| 46 | string GetDirectory(string const & name) |
| 47 | { |
| 48 | auto const sep = GetNativeSeparator(); |
| 49 | size_t const sepSize = sizeof(sep); |
| 50 | |
| 51 | string::size_type i = name.rfind(sep); |
| 52 | if (i == string::npos) |
| 53 | return "."; |
| 54 | while (i > sepSize && (name[i - sepSize] == sep)) |
| 55 | i -= sepSize; |
| 56 | return name.substr(0, i ? i : sepSize); |
| 57 | } |
| 58 | |
| 59 | string::value_type GetNativeSeparator() |
| 60 | { |