Add LocalFileLocation output operator.

GitOrigin-RevId: a84cd9f30c4797570146cdf6b8ed5aa902fcf273
This commit is contained in:
levlam 2019-01-01 20:02:13 +03:00
parent 594368e571
commit 13769d7410

View File

@ -994,6 +994,20 @@ inline bool operator!=(const LocalFileLocation &lhs, const LocalFileLocation &rh
return !(lhs == rhs); return !(lhs == rhs);
} }
inline StringBuilder &operator<<(StringBuilder &sb, const LocalFileLocation &location) {
switch (location.type()) {
case LocalFileLocation::Type::Empty:
return sb << "[empty local location]";
case LocalFileLocation::Type::Partial:
return sb << location.partial();
case LocalFileLocation::Type::Full:
return sb << location.full();
default:
UNREACHABLE();
return sb;
}
}
struct FullGenerateFileLocation { struct FullGenerateFileLocation {
FileType file_type_{FileType::None}; FileType file_type_{FileType::None};
string original_path_; string original_path_;