123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- #include "update_engine/omaha_utils.h"
- #include <base/logging.h>
- namespace chromeos_update_engine {
- namespace {
- const char kEolStatusSupported[] = "supported";
- const char kEolStatusSecurityOnly[] = "security-only";
- const char kEolStatusEol[] = "eol";
- }
- const char* EolStatusToString(EolStatus eol_status) {
- switch (eol_status) {
- case EolStatus::kSupported:
- return kEolStatusSupported;
- case EolStatus::kSecurityOnly:
- return kEolStatusSecurityOnly;
- case EolStatus::kEol:
- return kEolStatusEol;
- }
-
- LOG(WARNING) << "Invalid EolStatus value: " << static_cast<int>(eol_status);
- return kEolStatusSupported;
- }
- EolStatus StringToEolStatus(const std::string& eol_status) {
- if (eol_status == kEolStatusSupported || eol_status.empty())
- return EolStatus::kSupported;
- if (eol_status == kEolStatusSecurityOnly)
- return EolStatus::kSecurityOnly;
- if (eol_status == kEolStatusEol)
- return EolStatus::kEol;
- LOG(WARNING) << "Invalid end-of-life attribute: " << eol_status;
- return EolStatus::kSupported;
- }
- }
|