init
This commit is contained in:
70
device/exception/myexception.cpp
Normal file
70
device/exception/myexception.cpp
Normal file
@@ -0,0 +1,70 @@
|
||||
#include "myexception.h"
|
||||
|
||||
MyException::MyException(ExceptLevel value)
|
||||
{
|
||||
exceptInfo = QString("");
|
||||
level = value;
|
||||
exceptCode = NOTHING;
|
||||
}
|
||||
|
||||
MyException::MyException(const QString& text,ExceptLevel value)
|
||||
{
|
||||
exceptInfo = text;
|
||||
level = value;
|
||||
exceptCode = NOTHING;
|
||||
}
|
||||
|
||||
MyException::MyException(int exceptCodeValue,ExceptLevel value)
|
||||
{
|
||||
exceptCode = exceptCodeValue;
|
||||
level = value;
|
||||
exceptInfo = QString("");
|
||||
}
|
||||
|
||||
MyException::MyException(QString text,int exceptCodeValue,ExceptLevel value)
|
||||
{
|
||||
exceptInfo = text;
|
||||
exceptCode = exceptCodeValue;
|
||||
level = value;
|
||||
}
|
||||
|
||||
void MyException::setExceptLevel(ExceptLevel levelValue)
|
||||
{
|
||||
level = levelValue;
|
||||
}
|
||||
|
||||
QString MyException::getExceptInfo()
|
||||
{
|
||||
return exceptInfo;
|
||||
}
|
||||
|
||||
QString MyException::getExceptInfoWithExceptCode()
|
||||
{
|
||||
return exceptInfo+getExceptCodeText();
|
||||
}
|
||||
|
||||
int MyException::getExceptCode()
|
||||
{
|
||||
return exceptCode;
|
||||
}
|
||||
void MyException::setExceptCode(int value)
|
||||
{
|
||||
exceptCode = value;
|
||||
}
|
||||
|
||||
ExceptLevel MyException::getExceptLevel()
|
||||
{
|
||||
return level;
|
||||
}
|
||||
|
||||
void MyException::setExceptInfo(QString text)
|
||||
{
|
||||
exceptInfo = text;
|
||||
}
|
||||
|
||||
QString MyException::getExceptCodeText()
|
||||
{
|
||||
return QString(" 异常代码为:%1").arg(exceptCode);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user