summaryrefslogtreecommitdiff
path: root/utils.cc
diff options
context:
space:
mode:
Diffstat (limited to 'utils.cc')
-rw-r--r--utils.cc15
1 files changed, 14 insertions, 1 deletions
diff --git a/utils.cc b/utils.cc
index 62581f4f..2bcc311d 100644
--- a/utils.cc
+++ b/utils.cc
@@ -802,7 +802,7 @@ string ToString(bool b) {
return (b ? "true" : "false");
}
-std::string ToString(DownloadSource source) {
+string ToString(DownloadSource source) {
switch (source) {
case kDownloadSourceHttpsServer: return "HttpsServer";
case kDownloadSourceHttpServer: return "HttpServer";
@@ -814,6 +814,19 @@ std::string ToString(DownloadSource source) {
return "Unknown";
}
+string ToString(PayloadType payload_type) {
+ switch (payload_type) {
+ case kPayloadTypeDelta: return "Delta";
+ case kPayloadTypeFull: return "Full";
+ case kPayloadTypeForcedFull: return "ForcedFull";
+ case kNumPayloadTypes: return "Unknown";
+ // Don't add a default case to let the compiler warn about newly added
+ // payload types which should be added here.
+ }
+
+ return "Unknown";
+}
+
ErrorCode GetBaseErrorCode(ErrorCode code) {
// Ignore the higher order bits in the code by applying the mask as
// we want the enumerations to be in the small contiguous range