Class Status

Class Documentation

class Status

Public Functions

Status()

Constructor of Status.

inline Status(enum StatusCode status_code, const std::string &status_msg = "")

Constructor of Status.

参数
  • status_code[in] Status code.

  • status_msg[in] Status message.

inline Status(const StatusCode code, int line_of_code, const char *file_name, const std::string &extra = "")

Constructor of Status.

~Status() = default

Destructor of Status.

enum StatusCode StatusCode() const

Status code of status.

返回

Enum of status code.

inline std::string ToString() const

Exchange status to string.

返回

Status code exchanged to string.

int GetLineOfCode() const

Get line of status code.

返回

Line of code to get.

inline std::string GetFileName() const

Get file name of status.

返回

File name to get.

inline std::string GetErrDescription() const

Get error description of status.

返回

Error description to get.

inline std::string SetErrDescription(const std::string &err_description)

Get error description of status.

参数

err_description[in] Error description to be set.

inline void SetStatusMsg(const std::string &status_msg)

Status message to be set.

参数

status_msg[in] Status message to be set.

bool operator==(const Status &other) const

Operator ==.

bool operator==(enum StatusCode other_code) const

Operator ==.

bool operator!=(const Status &other) const

Operator !=.

bool operator!=(enum StatusCode other_code) const

Operator !=.

explicit operator bool() const

Operator bool().

explicit operator int() const

Operator int().

bool IsOk() const

Getting back if it is ok.

返回

True if it is ok.

bool IsError() const

Getting back if it is error.

返回

True if it is error.

Public Static Functions

static Status OK()

Getting back the status of OK.

返回

Status Code of ok.

static inline std::string CodeAsString(enum StatusCode c)

Getting back the code as string.

返回

The code name as string type.

Friends

friend std::ostream &operator<<(std::ostream &os, const Status &s)

Operator <<.