azure-core
operation_status.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
10 #pragma once
11 
13 
14 #include <string>
15 #include <utility> // for std::move
16 
18 
19 namespace Azure { namespace Core {
20 
24  class OperationStatus final {
25  std::string m_value;
26 
27  public:
33  explicit OperationStatus(const std::string& value) : m_value(value) {}
34 
40  explicit OperationStatus(std::string&& value) : m_value(std::move(value)) {}
41 
47  explicit OperationStatus(const char* value) : m_value(value) {}
48 
56  bool operator==(const OperationStatus& other) const noexcept
57  {
58  return _internal::StringExtensions::LocaleInvariantCaseInsensitiveEqual(
59  m_value, other.m_value);
60  }
61 
69  bool operator!=(const OperationStatus& other) const noexcept { return !(*this == other); }
70 
75  const std::string& Get() const noexcept { return m_value; }
76 
102  };
103 
104 }} // namespace Azure::Core
strings.hpp
Internal utility functions for strings.
Azure::Core::OperationStatus::Succeeded
static AZ_CORE_DLLEXPORT const OperationStatus Succeeded
The Azure::Core::Operation Succeeded.
Definition: operation_status.hpp:91
AZ_CORE_DLLEXPORT
#define AZ_CORE_DLLEXPORT
Applies DLL export attribute, when applicable.
Definition: dll_import_export.hpp:93
Azure::Core::OperationStatus::Running
static AZ_CORE_DLLEXPORT const OperationStatus Running
The Azure::Core::Operation is Running.
Definition: operation_status.hpp:86
Azure::Core::OperationStatus::NotStarted
static AZ_CORE_DLLEXPORT const OperationStatus NotStarted
The Azure::Core::Operation is Not Started.
Definition: operation_status.hpp:81
Azure::Core::OperationStatus::OperationStatus
OperationStatus(const char *value)
Constructs an OperationStatus with value.
Definition: operation_status.hpp:47
Azure::Core::OperationStatus::operator==
bool operator==(const OperationStatus &other) const noexcept
Compares two OperationStatus objects for equality.
Definition: operation_status.hpp:56
Azure::Core::OperationStatus::OperationStatus
OperationStatus(std::string &&value)
Constructs an OperationStatus with value.
Definition: operation_status.hpp:40
Azure
Azure SDK abstractions.
Definition: azure_assert.hpp:55
dll_import_export.hpp
DLL export macro.
Azure::Core::OperationStatus::operator!=
bool operator!=(const OperationStatus &other) const noexcept
Compares two OperationStatus objects for equality.
Definition: operation_status.hpp:69
Azure::Core::OperationStatus
Long-running operation states.
Definition: operation_status.hpp:24
Azure::Core::OperationStatus::Failed
static AZ_CORE_DLLEXPORT const OperationStatus Failed
The Azure::Core::Operation Failed.
Definition: operation_status.hpp:101
Azure::Core::OperationStatus::Get
const std::string & Get() const noexcept
Gets the std::string representation of the operation status.
Definition: operation_status.hpp:75
Azure::Core::OperationStatus::Cancelled
static AZ_CORE_DLLEXPORT const OperationStatus Cancelled
The Azure::Core::Operation was Cancelled.
Definition: operation_status.hpp:96
Azure::Core::OperationStatus::OperationStatus
OperationStatus(const std::string &value)
Constructs an OperationStatus with value.
Definition: operation_status.hpp:33