Shared representation of a status code across the enclave boundary.
More...
#include <asylo/platform/primitives/primitive_status.h>
|
static constexpr size_t | kMessageMax = 1024 |
| Maximum error string length in characters. More...
|
|
Shared representation of a status code across the enclave boundary.
PrimitiveStatus does not include an error space and always refers to a google::GoogleError value.
◆ PrimitiveStatus() [1/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
| ) |
|
|
inline |
◆ PrimitiveStatus() [2/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
int |
code | ) |
|
|
inlineexplicit |
Builds a status with an error code and an empty message.
- Parameters
-
code | An error code that is interpreted as a google::GoogleError value. |
◆ PrimitiveStatus() [3/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
int |
code, |
|
|
const char * |
message |
|
) |
| |
|
inline |
Builds a status with an error code and error message.
- Parameters
-
code | An error code that is interpreted as a google::GoogleError value. |
message | A message string that is truncated if longer than kMessageMax - 1 characters. The length is computed with strlen. |
◆ PrimitiveStatus() [4/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
int |
code, |
|
|
const char * |
message, |
|
|
size_t |
message_size |
|
) |
| |
|
inline |
Builds a status with an error code and a message of size message_size
.
- Parameters
-
code | An error code that is interpreted as a google::GoogleError value. |
message | A message string that is truncated if longer than kMessageMax - 1 characters. |
message_size | The size of the message to copy, which will not exceed kMessageMax - 1 characters. |
◆ PrimitiveStatus() [5/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
int |
code, |
|
|
const std::string & |
message |
|
) |
| |
|
inline |
Builds a status with an error code and a message in string format.
◆ PrimitiveStatus() [6/6]
asylo::primitives::PrimitiveStatus::PrimitiveStatus |
( |
const PrimitiveStatus & |
other | ) |
|
|
inline |
Copy constructor.
- Parameters
-
other | The status to copy. Strings are memcpy'd. |
◆ error_code()
int asylo::primitives::PrimitiveStatus::error_code |
( |
| ) |
const |
|
inline |
Getter for this object's error code.
- Returns
- The integer error code for this object.
◆ error_message()
const char* asylo::primitives::PrimitiveStatus::error_message |
( |
| ) |
const |
|
inline |
Getter for this object's error message.
returns The string error message for this object.
◆ ok()
bool asylo::primitives::PrimitiveStatus::ok |
( |
| ) |
const |
|
inline |
Predicate for non-error status.
- Returns
- True if and only if this object is OK (indicates no error).
◆ OkStatus()
◆ operator=()
◆ kMessageMax
constexpr size_t asylo::primitives::PrimitiveStatus::kMessageMax = 1024 |
|
static |
Maximum error string length in characters.
The documentation for this class was generated from the following file: