MapClientFileNameToServerAbs converts a client file name to an absolute path on server. For example, /proj/1.cpp maps to /tmp/nocc/cpp/clients/{clientID}/proj/1.cpp. Note, that system files like /usr/local/include are required to be equal on both sides. (if not, a server session will fail to start,
(clientFileName string)
| 76 | // Note, that system files like /usr/local/include are required to be equal on both sides. |
| 77 | // (if not, a server session will fail to start, and a client will fall back to local compilation) |
| 78 | func (client *Client) MapClientFileNameToServerAbs(clientFileName string) string { |
| 79 | if clientFileName[0] == '/' { |
| 80 | if IsSystemHeaderPath(clientFileName) { |
| 81 | return clientFileName |
| 82 | } |
| 83 | return client.workingDir + clientFileName |
| 84 | } |
| 85 | return path.Join(client.workingDir, clientFileName) |
| 86 | } |
| 87 | |
| 88 | // MapServerAbsToClientFileName converts an absolute path on server relatively to the client working dir. |
| 89 | // For example, /tmp/nocc/cpp/clients/{clientID}/proj/1.cpp maps to /proj/1.cpp. |
no test coverage detected