Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
fml::Status Class Referencefinal

#include <status.h>

Public Member Functions

 Status ()
 Creates an 'ok' status.
 
 Status (fml::StatusCode code, std::string_view message)
 
fml::StatusCode code () const
 
void IgnoreError () const
 
bool ok () const
 
std::string_view message () const
 

Detailed Description

Class that represents the resolution of the execution of a procedure. This is used similarly to how exceptions might be used, typically as the return value to a synchronous procedure or an argument to an asynchronous callback.

Definition at line 35 of file status.h.

Constructor & Destructor Documentation

◆ Status() [1/2]

fml::Status::Status ( )
inline

Creates an 'ok' status.

Definition at line 58 of file status.h.

58: code_(fml::StatusCode::kOk), message_() {}

◆ Status() [2/2]

fml::Status::Status ( fml::StatusCode  code,
std::string_view  message 
)
inline

Definition at line 60 of file status.h.

61 : code_(code), message_(message) {}
fml::StatusCode code() const
Definition status.h:63
std::string_view message() const
Definition status.h:75

Member Function Documentation

◆ code()

fml::StatusCode fml::Status::code ( ) const
inline

Definition at line 63 of file status.h.

63 {
64 return code_;
65}

◆ IgnoreError()

void fml::Status::IgnoreError ( ) const
inline

A noop that helps with static analysis tools if you decide to ignore an error.

Definition at line 67 of file status.h.

67 {
68 // noop
69}

◆ message()

std::string_view fml::Status::message ( ) const
inline

Definition at line 75 of file status.h.

75 {
76 return message_;
77}

◆ ok()

bool fml::Status::ok ( ) const
inline
Returns
'true' when the code is kOk.

Definition at line 71 of file status.h.

71 {
72 return code_ == fml::StatusCode::kOk;
73}

The documentation for this class was generated from the following file: