DtkCore
DTK Core module
载入中...
搜索中...
未找到
Dtk::Core::DError类 参考

对于错误的包装类 更多...

#include <derror.h>

Public 成员函数

 DError () noexcept
 默认构造函数
 
 DError (const DError &e) noexcept
 拷贝构造函数
 
 DError (DError &&e) noexcept
 移动构造函数
 
 DError (qint64 code, const QString &msg) noexcept
 构造函数
 
 DError (qint64 code, QString &&msg) noexcept
 构造函数
 
DErroroperator= (const DError &e)
 重载拷贝赋值运算符
 
DErroroperator= (DError &&e)
 重载移动赋值运算符
 
 ~DError ()=default
 默认析构函数
 
qint64 getErrorCode () const noexcept
 获取错误代码
 
void setErrorCode (qint64 code) &noexcept
 设置错误代码
 
const QString & getErrorMessage () const &
 获取错误信息
 
QString getErrorMessage () const &&
 获取错误信息
 
void setErrorMessage (const QString &msg) &
 设置错误信息
 

友元

bool operator== (const DError &x, const DError &y) noexcept
 重载相等运算符
 
bool operator!= (const DError &x, const DError &y) noexcept
 重载不等运算符
 
QDebug operator<< (QDebug debug, const DError &e)
 重载输出运算符
 

详细描述

对于错误的包装类

构造及析构函数说明

◆ DError() [1/4]

Dtk::Core::DError::DError ( )
inlinenoexcept

默认构造函数

注意
错误代码默认为-1,错误信息默认为空

◆ DError() [2/4]

Dtk::Core::DError::DError ( DError &&  e)
inlinenoexcept

移动构造函数

注意
移动后原对象不可用

◆ DError() [3/4]

Dtk::Core::DError::DError ( qint64  code,
const QString &  msg 
)
inlinenoexcept

构造函数

参数
[in]code错误代码
[in]msg错误信息

◆ DError() [4/4]

Dtk::Core::DError::DError ( qint64  code,
QString &&  msg 
)
inlinenoexcept

构造函数

参数
[in]code错误代码
[in]msg错误信息
注意
使用此构造函数后原错误信息不可用

成员函数说明

◆ getErrorCode()

qint64 Dtk::Core::DError::getErrorCode ( ) const
inlinenoexcept

获取错误代码

返回
错误代码

◆ getErrorMessage() [1/2]

const QString & Dtk::Core::DError::getErrorMessage ( ) const &
inline

获取错误信息

返回
错误信息的const引用

◆ getErrorMessage() [2/2]

QString Dtk::Core::DError::getErrorMessage ( ) const &&
inline

获取错误信息

注意
函数返回错误信息后,原信息不可用
返回
错误信息

◆ operator=()

DError & Dtk::Core::DError::operator= ( DError &&  e)
inline

重载移动赋值运算符

注意
赋值后原对象不可用

◆ setErrorCode()

void Dtk::Core::DError::setErrorCode ( qint64  code) &
inlinenoexcept

设置错误代码

参数
[in]code错误代码

◆ setErrorMessage()

void Dtk::Core::DError::setErrorMessage ( const QString &  msg) &
inline

设置错误信息

参数
[in]msg错误信息

该类的文档由以下文件生成: