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.

Parameters
  • 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.

Returns

Enum of status code.

inline std::string ToString() const

Exchange status to string.

Returns

Status code exchanged to string.

int GetLineOfCode() const

Get line of status code.

Returns

Line of code to get.

inline std::string GetFileName() const

Get file name of status.

Returns

File name to get.

inline std::string GetErrDescription() const

Get error description of status.

Returns

Error description to get.

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

Get error description of status.

Parameters

err_description[in] Error description to be set.

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

Status message to be set.

Parameters

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.

Returns

True if it is ok.

bool IsError() const

Getting back if it is error.

Returns

True if it is error.

Public Static Functions

static Status OK()

Getting back the status of OK.

Returns

Status Code of ok.

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

Getting back the code as string.

Returns

The code name as string type.

Friends

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

Operator <<.