1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26

ash / components / arc / session / arc_stop_reason.cc [blame]

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "ash/components/arc/session/arc_stop_reason.h"

namespace arc {

std::ostream& operator<<(std::ostream& os, ArcStopReason reason) {
  switch (reason) {
#define CASE_IMPL(val)     \
  case ArcStopReason::val: \
    return os << #val

    CASE_IMPL(SHUTDOWN);
    CASE_IMPL(GENERIC_BOOT_FAILURE);
    CASE_IMPL(LOW_DISK_SPACE);
    CASE_IMPL(CRASH);
#undef CASE_IMPL
  }

  // In case of unexpected value, output the int value.
  return os << "ArcStopReason(" << static_cast<int>(reason) << ")";
}

}  // namespace arc