Shaka Packager SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
Public Member Functions | List of all members
shaka::Status Class Reference

Public Member Functions

 Status ()
 Creates a "successful" status.
 
 Status (error::Code error_code, const std::string &error_message)
 
void SetError (error::Code error_code, const std::string &error_message)
 
void Update (const Status &new_status)
 
void Clear ()
 Clear this status object to contain the OK code and no error message.
 
bool ok () const
 
error::Code error_code () const
 
const std::string & error_message () const
 
bool operator== (const Status &x) const
 
bool operator!= (const Status &x) const
 
bool Matches (const Status &x) const
 
std::string ToString () const
 
void Swap (Status *other)
 

Static Public Attributes

Some pre-defined Status objects.
static const Status OK = Status(error::OK, "")
 
static const Status UNKNOWN = Status(error::UNKNOWN, "")
 

Detailed Description

Definition at line 110 of file status.h.

Constructor & Destructor Documentation

shaka::Status::Status ( error::Code  error_code,
const std::string &  error_message 
)
inline

Create a status with the specified code, and error message. If "error_code == error::OK", error_message is ignored and a Status object identical to Status::OK is constructed.

Definition at line 118 of file status.h.

Member Function Documentation

bool shaka::Status::Matches ( const Status x) const
inline
Returns
true iff this has the same error_code as "x", i.e., the two Status objects are identical except possibly for the error message.

Definition at line 175 of file status.h.

void shaka::Status::SetError ( error::Code  error_code,
const std::string &  error_message 
)
inline

Store the specified error in this Status object. If "error_code == error::OK", error_message is ignored and a Status object identical to Status::OK is constructed.

Definition at line 135 of file status.h.

std::string shaka::Status::ToString ( ) const
Returns
A combination of the error code name and message.

Definition at line 67 of file status.cc.

void shaka::Status::Update ( const Status new_status)
inline

If "ok()", stores "new_status" into *this. If "!ok()", preserves the current "error_code()/error_message()",

Convenient way of keeping track of the first error encountered. Instead of: if (overall_status.ok()) overall_status = new_status Use: overall_status.Update(new_status);

Definition at line 152 of file status.h.


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