| 133 | } |
| 134 | |
| 135 | String File::relativeTo(String const& relativeTo, String const& path) { |
| 136 | if (path.beginsWith('/') || path.beginsWith('\\') || path.regexMatch("^[a-z]:", false, false)) |
| 137 | return path; |
| 138 | |
| 139 | String finalPath; |
| 140 | if (relativeTo.endsWith('\\') || relativeTo.endsWith('/')) |
| 141 | finalPath = relativeTo.substr(0, relativeTo.size() - 1); |
| 142 | else if (relativeTo.endsWith("\\.") || relativeTo.endsWith("/.")) |
| 143 | finalPath = relativeTo.substr(0, relativeTo.size() - 2); |
| 144 | else |
| 145 | finalPath = relativeTo; |
| 146 | |
| 147 | if (path.beginsWith(".\\") || path.beginsWith("./")) |
| 148 | finalPath += '\\' + path.substr(2); |
| 149 | else |
| 150 | finalPath += '\\' + path; |
| 151 | |
| 152 | return finalPath; |
| 153 | } |
| 154 | |
| 155 | String File::temporaryFileName() { |
| 156 | WCHAR tempPath[MAX_PATH]; |
nothing calls this directly
no test coverage detected