# ndk::ScopedAStatus


`#include <binder_auto_utils.h>`

Convenience wrapper.

## Summary

See AStatus.

### Inheritance

Inherits from: [ndk::impl::ScopedAResource\< AStatus \*, AStatus_delete, nullptr \>](https://developer.android.com/ndk/reference/classndk/1-1impl-1-1-scoped-a-resource)

| ### Constructors and Destructors ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a5a0422154576ea0b28ca5d3f075a3a63(AStatus *a)` Takes ownership of a. ||
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a38f5d438c7148b838bf16d96d371732f(https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status &&)` ||
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1ae3c9617cbd28f256bf6862318ac5542b()` ||

| ### Public functions ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1acf0d496b456b933a2dc43cb96a05395c() const ` | `std::string` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1adfdac1e326dc2799bba88354ac63c99a() const ` | `https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1gae15fae7cc96a8b3f0b699523962c09c2` See AStatus_getExceptionCode. |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a8838d20472954226b1a453c366e44e6f() const ` | `const char *` See AStatus_getMessage. |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a0795e3107bcce4cbae44cbe52385276f() const ` | `int32_t` See AStatus_getServiceSpecificError. |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a26e80a36d3c200aa6fb71bb83ff27b02() const ` | `https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1ga26845d019135385e22a356743fdf639f` See AStatus_getStatus. |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1af9a95b2270a0309ce46f90f13242b51a() const ` | `bool` See AStatus_isOk. |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a0ee9ee06ec04d164e3faa89cd6f7d4e1(https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status &&)=default` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status &` |

| ### Public static functions ||
|---|---|
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a2000b9023465907e4909d28e77cba926(https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1gae15fae7cc96a8b3f0b699523962c09c2 exception)` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a934345f2a4adbcff9b77dc161af55059(https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1gae15fae7cc96a8b3f0b699523962c09c2 exception, const char *message)` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a4cad6eed0da6a8ac4b5c4227f52ac1c9(int32_t serviceSpecific)` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a035bc841dc92d0be345e36f6ee06e70a(int32_t serviceSpecific, const char *message)` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1a84d8b005a82aada022da65abb779c5eb(https://developer.android.com/ndk/reference/group/ndk-binder#group___ndk_binder_1ga26845d019135385e22a356743fdf639f status)` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` |
| `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1afd4faef746172297ba58e6375affa7fb()` | `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status` Convenience methods for creating scoped statuses. |

## Public functions

### ScopedAStatus

```
 ScopedAStatus(
  AStatus *a
)
```
Takes ownership of a.

WARNING: this constructor is only expected to be used when reading a status value. Use `https://developer.android.com/ndk/reference/classndk/1-1-scoped-a-status#classndk_1_1_scoped_a_status_1afd4faef746172297ba58e6375affa7fb` instead.

### ScopedAStatus

```
 ScopedAStatus(
  ScopedAStatus &&
)=default
```

### getDescription

```
std::string getDescription() const 
```

### getExceptionCode

```
binder_exception_t getExceptionCode() const 
```
See AStatus_getExceptionCode.

### getMessage

```
const char * getMessage() const 
```
See AStatus_getMessage.

### getServiceSpecificError

```
int32_t getServiceSpecificError() const 
```
See AStatus_getServiceSpecificError.

### getStatus

```
binder_status_t getStatus() const 
```
See AStatus_getStatus.

### isOk

```
bool isOk() const 
```
See AStatus_isOk.

### operator=

```
ScopedAStatus & operator=(
  ScopedAStatus &&
)=default
```

### \~ScopedAStatus

```
 ~ScopedAStatus()
```

## Public static functions

### fromExceptionCode

```
ScopedAStatus fromExceptionCode(
  binder_exception_t exception
)
```

### fromExceptionCodeWithMessage

```
ScopedAStatus fromExceptionCodeWithMessage(
  binder_exception_t exception,
  const char *message
)
```

### fromServiceSpecificError

```
ScopedAStatus fromServiceSpecificError(
  int32_t serviceSpecific
)
```

### fromServiceSpecificErrorWithMessage

```
ScopedAStatus fromServiceSpecificErrorWithMessage(
  int32_t serviceSpecific,
  const char *message
)
```

### fromStatus

```
ScopedAStatus fromStatus(
  binder_status_t status
)
```

### ok

```
ScopedAStatus ok()
```
Convenience methods for creating scoped statuses.