For nothrow methods set Q_DECL_NOEXCEPT.

--HG--
branch : feature
This commit is contained in:
dismine 2014-05-02 11:43:02 +03:00
parent 79ef0e914e
commit 9ca9455c80
9 changed files with 68 additions and 68 deletions

View file

@ -95,7 +95,7 @@ QmuParserBase::~QmuParserBase()
* @return *this
* @throw nothrow
*/
QmuParserBase& QmuParserBase::operator=(const QmuParserBase &a_Parser)
QmuParserBase& QmuParserBase::operator=(const QmuParserBase &a_Parser) Q_DECL_NOEXCEPT
{
Assign(a_Parser);
return *this;
@ -198,7 +198,7 @@ void QmuParserBase::ResetLocale()
* @post m_pTokenReader.get()!=0
* @throw nothrow
*/
void QmuParserBase::InitTokenReader()
void QmuParserBase::InitTokenReader() Q_DECL_NOEXCEPT
{
m_pTokenReader.reset(new token_reader_type(this));
}
@ -210,7 +210,7 @@ void QmuParserBase::InitTokenReader()
* Clear bytecode, reset the token reader.
* @throw nothrow
*/
void QmuParserBase::ReInit() const
void QmuParserBase::ReInit() const Q_DECL_NOEXCEPT
{
m_pParseFormula = &QmuParserBase::ParseString;
m_vStringBuf.clear();
@ -977,7 +977,7 @@ const valmap_type& QmuParserBase::GetConst() const
* parser functions. String functions are not part of this map. The Prototype definition is encapsulated in objects
* of the class FunProt one per parser function each associated with function names via a map construct.
*/
const funmap_type& QmuParserBase::GetFunDef() const
const funmap_type& QmuParserBase::GetFunDef() const Q_DECL_NOEXCEPT
{
return m_FunDef;
}
@ -2082,7 +2082,7 @@ void Q_NORETURN QmuParserBase::Error(EErrorCodes a_iErrc, int a_iPos, const QStr
* Resets the parser to string parsing mode by calling #ReInit.
*/
// cppcheck-suppress unusedFunction
void QmuParserBase::ClearVar()
void QmuParserBase::ClearVar() Q_DECL_NOEXCEPT
{
m_VarDef.clear();
ReInit();
@ -2095,7 +2095,7 @@ void QmuParserBase::ClearVar()
*
* Removes a variable if it exists. If the Variable does not exist nothing will be done.
*/
void QmuParserBase::RemoveVar(const QString &a_strVarName)
void QmuParserBase::RemoveVar(const QString &a_strVarName) Q_DECL_NOEXCEPT
{
varmap_type::iterator item = m_VarDef.find(a_strVarName);
if (item!=m_VarDef.end())
@ -2112,7 +2112,7 @@ void QmuParserBase::RemoveVar(const QString &a_strVarName)
* @throw nothrow
*/
// cppcheck-suppress unusedFunction
void QmuParserBase::ClearFun()
void QmuParserBase::ClearFun() Q_DECL_NOEXCEPT
{
m_FunDef.clear();
ReInit();
@ -2126,7 +2126,7 @@ void QmuParserBase::ClearFun()
* @post Resets the parser to string parsing mode.
* @throw nothrow
*/
void QmuParserBase::ClearConst()
void QmuParserBase::ClearConst() Q_DECL_NOEXCEPT
{
m_ConstDef.clear();
m_StrVarDef.clear();
@ -2139,7 +2139,7 @@ void QmuParserBase::ClearConst()
* @post Resets the parser to string parsing mode.
* @throw nothrow
*/
void QmuParserBase::ClearPostfixOprt()
void QmuParserBase::ClearPostfixOprt() Q_DECL_NOEXCEPT
{
m_PostOprtDef.clear();
ReInit();
@ -2152,7 +2152,7 @@ void QmuParserBase::ClearPostfixOprt()
* @throw nothrow
*/
// cppcheck-suppress unusedFunction
void QmuParserBase::ClearOprt()
void QmuParserBase::ClearOprt() Q_DECL_NOEXCEPT
{
m_OprtDef.clear();
ReInit();
@ -2165,7 +2165,7 @@ void QmuParserBase::ClearOprt()
* @throw nothrow
*/
// cppcheck-suppress unusedFunction
void QmuParserBase::ClearInfixOprt()
void QmuParserBase::ClearInfixOprt() Q_DECL_NOEXCEPT
{
m_InfixOprtDef.clear();
ReInit();
@ -2177,7 +2177,7 @@ void QmuParserBase::ClearInfixOprt()
* @post Resets the parser to string parser mode.
* @throw nothrow
*/
void QmuParserBase::EnableOptimizer(bool a_bIsOn)
void QmuParserBase::EnableOptimizer(bool a_bIsOn) Q_DECL_NOEXCEPT
{
m_vRPN.EnableOptimizer(a_bIsOn);
ReInit();
@ -2208,7 +2208,7 @@ void QmuParserBase::EnableDebugDump(bool bDumpCmd, bool bDumpStack)
* manually one by one. It is not possible to disable built in operators selectively. This function will Reinitialize
* the parser by calling ReInit().
*/
void QmuParserBase::EnableBuiltInOprt(bool a_bIsOn)
void QmuParserBase::EnableBuiltInOprt(bool a_bIsOn) Q_DECL_NOEXCEPT
{
m_bBuiltInOp = a_bIsOn;
ReInit();
@ -2220,7 +2220,7 @@ void QmuParserBase::EnableBuiltInOprt(bool a_bIsOn)
* @return #m_bBuiltInOp; true if built in operators are enabled.
* @throw nothrow
*/
bool QmuParserBase::HasBuiltInOprt() const
bool QmuParserBase::HasBuiltInOprt() const Q_DECL_NOEXCEPT
{
return m_bBuiltInOp;
}

View file

@ -64,7 +64,7 @@ public:
QmuParserBase();
QmuParserBase(const QmuParserBase &a_Parser);
QmuParserBase& operator=(const QmuParserBase &a_Parser);
QmuParserBase& operator=(const QmuParserBase &a_Parser) Q_DECL_NOEXCEPT;
virtual ~QmuParserBase();
static void EnableDebugDump(bool bDumpCmd, bool bDumpStack);
@ -77,9 +77,9 @@ public:
void SetDecSep(char_type cDecSep);
void SetThousandsSep(char_type cThousandsSep = 0);
void ResetLocale();
void EnableOptimizer(bool a_bIsOn=true);
void EnableBuiltInOprt(bool a_bIsOn=true);
bool HasBuiltInOprt() const;
void EnableOptimizer(bool a_bIsOn=true) Q_DECL_NOEXCEPT;
void EnableBuiltInOprt(bool a_bIsOn=true) Q_DECL_NOEXCEPT;
bool HasBuiltInOprt() const Q_DECL_NOEXCEPT;
void AddValIdent(identfun_type a_pCallback);
void DefineOprt(const QString &a_strName, fun_type2 a_pFun, unsigned a_iPri=0,
EOprtAssociativity a_eAssociativity = oaLEFT, bool a_bAllowOpt = false);
@ -90,18 +90,18 @@ public:
void DefineInfixOprt(const QString &a_strName, fun_type1 a_pOprt, int a_iPrec=prINFIX,
bool a_bAllowOpt=true);
// Clear user defined variables, constants or functions
void ClearVar();
void ClearFun();
void ClearConst();
void ClearInfixOprt();
void ClearPostfixOprt();
void ClearOprt();
void RemoveVar(const QString &a_strVarName);
void ClearVar() Q_DECL_NOEXCEPT;
void ClearFun() Q_DECL_NOEXCEPT;
void ClearConst() Q_DECL_NOEXCEPT;
void ClearInfixOprt() Q_DECL_NOEXCEPT;
void ClearPostfixOprt() Q_DECL_NOEXCEPT;
void ClearOprt() Q_DECL_NOEXCEPT;
void RemoveVar(const QString &a_strVarName) Q_DECL_NOEXCEPT;
const varmap_type& GetUsedVar() const;
const varmap_type& GetVar() const;
const valmap_type& GetConst() const;
const QString& GetExpr() const;
const funmap_type& GetFunDef() const;
const funmap_type& GetFunDef() const Q_DECL_NOEXCEPT;
static QString GetVersion(EParserVersionInfo eInfo = pviFULL);
static const QStringList& GetOprtDef();
void DefineNameChars(const QString &a_szCharset);
@ -235,8 +235,8 @@ private:
mutable int m_nFinalResultIdx;
void Assign(const QmuParserBase &a_Parser);
void InitTokenReader();
void ReInit() const;
void InitTokenReader() Q_DECL_NOEXCEPT;
void ReInit() const Q_DECL_NOEXCEPT;
void AddCallback(const QString &a_strName, const QmuParserCallback &a_Callback,
funmap_type &a_Storage, const QString &a_szCharSet );
void ApplyRemainingOprt(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal) const;

View file

@ -104,7 +104,7 @@ void QmuParserByteCode::Assign(const QmuParserByteCode &a_ByteCode)
* @param a_pVar Pointer to be added.
* @throw nothrow
*/
void QmuParserByteCode::AddVar(qreal *a_pVar)
void QmuParserByteCode::AddVar(qreal *a_pVar) Q_DECL_NOEXCEPT
{
++m_iStackPos;
m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast<size_t>(m_iStackPos));
@ -132,7 +132,7 @@ void QmuParserByteCode::AddVar(qreal *a_pVar)
* @param a_pVal Value to be added.
* @throw nothrow
*/
void QmuParserByteCode::AddVal(qreal a_fVal)
void QmuParserByteCode::AddVal(qreal a_fVal) Q_DECL_NOEXCEPT
{
++m_iStackPos;
m_iMaxStackSize = qMax(m_iMaxStackSize, static_cast<size_t>(m_iStackPos));
@ -623,7 +623,7 @@ void QmuParserByteCode::AddBulkFun(generic_fun_type a_pFun, int a_iArgc)
* A string function entry consists of the stack position of the return value, followed by a cmSTRFUNC code, the
* function pointer and an index into the string buffer maintained by the parser.
*/
void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx)
void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx) Q_DECL_NOEXCEPT
{
m_iStackPos = m_iStackPos - a_iArgc + 1;
@ -643,7 +643,7 @@ void QmuParserByteCode::AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iI
*
* @throw nothrow
*/
void QmuParserByteCode::Finalize()
void QmuParserByteCode::Finalize() Q_DECL_NOEXCEPT
{
SToken tok;
tok.Cmd = cmEND;
@ -812,7 +812,7 @@ std::size_t QmuParserByteCode::GetSize() const
* The name of this function is a violation of my own coding guidelines but this way it's more in line with the STL
* functions thus more intuitive.
*/
void QmuParserByteCode::clear()
void QmuParserByteCode::clear() Q_DECL_NOEXCEPT
{
m_vRPN.clear();
m_iStackPos = 0;

View file

@ -85,17 +85,17 @@ public:
QmuParserByteCode(const QmuParserByteCode &a_ByteCode);
QmuParserByteCode& operator=(const QmuParserByteCode &a_ByteCode);
void Assign(const QmuParserByteCode &a_ByteCode);
void AddVar(qreal *a_pVar);
void AddVal(qreal a_fVal);
void AddVar(qreal *a_pVar) Q_DECL_NOEXCEPT;
void AddVal(qreal a_fVal) Q_DECL_NOEXCEPT;
void AddOp(ECmdCode a_Oprt);
void AddIfElse(ECmdCode a_Oprt);
void AddAssignOp(qreal *a_pVar);
void AddFun(generic_fun_type a_pFun, int a_iArgc);
void AddBulkFun(generic_fun_type a_pFun, int a_iArgc);
void AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx);
void AddStrFun(generic_fun_type a_pFun, int a_iArgc, int a_iIdx) Q_DECL_NOEXCEPT;
void EnableOptimizer(bool bStat);
void Finalize();
void clear();
void Finalize() Q_DECL_NOEXCEPT;
void clear() Q_DECL_NOEXCEPT;
std::size_t GetMaxStackSize() const;
std::size_t GetSize() const;
const SToken* GetBase() const;

View file

@ -338,7 +338,7 @@ QmuParserCallback* QmuParserCallback::Clone() const
* @throw nothrow
*/
// cppcheck-suppress unusedFunction
bool QmuParserCallback::IsOptimizable() const
bool QmuParserCallback::IsOptimizable() const Q_DECL_NOEXCEPT
{
return m_bAllowOpti;
}
@ -352,7 +352,7 @@ bool QmuParserCallback::IsOptimizable() const
* @throw nothrow
* @return #pFun
*/
void* QmuParserCallback::GetAddr() const
void* QmuParserCallback::GetAddr() const Q_DECL_NOEXCEPT
{
return m_pFun;
}
@ -379,7 +379,7 @@ ETypeCode QmuParserCallback::GetType() const
*
* Only valid if the callback token is an operator token (binary or infix).
*/
int QmuParserCallback::GetPri() const
int QmuParserCallback::GetPri() const Q_DECL_NOEXCEPT
{
return m_iPri;
}
@ -391,7 +391,7 @@ int QmuParserCallback::GetPri() const
*
* Only valid if the callback token is a binary operator token.
*/
EOprtAssociativity QmuParserCallback::GetAssociativity() const
EOprtAssociativity QmuParserCallback::GetAssociativity() const Q_DECL_NOEXCEPT
{
return m_eOprtAsct;
}

View file

@ -79,12 +79,12 @@ public:
QmuParserCallback(const QmuParserCallback &a_Fun);
QmuParserCallback* Clone() const;
bool IsOptimizable() const;
void* GetAddr() const;
bool IsOptimizable() const Q_DECL_NOEXCEPT;
void* GetAddr() const Q_DECL_NOEXCEPT;
ECmdCode GetCode() const;
ETypeCode GetType() const;
int GetPri() const;
EOprtAssociativity GetAssociativity() const;
int GetPri() const Q_DECL_NOEXCEPT;
EOprtAssociativity GetAssociativity() const Q_DECL_NOEXCEPT;
int GetArgc() const;
private:
void *m_pFun; ///< Pointer to the callback function, casted to void

View file

@ -270,7 +270,7 @@ public:
* @return #m_iType
* @throw nothrow
*/
ECmdCode GetCode() const
ECmdCode GetCode() const Q_DECL_NOEXCEPT
{
if ( m_pCallback.get() )
{
@ -510,7 +510,7 @@ public:
* @throw nothrow
* @sa m_strTok
*/
const TString& GetAsString() const
const TString& GetAsString() const Q_DECL_NOEXCEPT
{
return m_strTok;
}

View file

@ -63,7 +63,7 @@ QmuParserTokenReader::QmuParserTokenReader ( const QmuParserTokenReader &a_Reade
* @param a_Reader Object to copy to this token reader.
* @throw nothrow
*/
QmuParserTokenReader& QmuParserTokenReader::operator= ( const QmuParserTokenReader &a_Reader )
QmuParserTokenReader& QmuParserTokenReader::operator= ( const QmuParserTokenReader &a_Reader ) Q_DECL_NOEXCEPT
{
if ( &a_Reader != this )
{
@ -80,7 +80,7 @@ QmuParserTokenReader& QmuParserTokenReader::operator= ( const QmuParserTokenRead
* @param a_Reader Object from which the state should be copied.
* @throw nothrow
*/
void QmuParserTokenReader::Assign ( const QmuParserTokenReader &a_Reader )
void QmuParserTokenReader::Assign ( const QmuParserTokenReader &a_Reader ) Q_DECL_NOEXCEPT
{
m_pParser = a_Reader.m_pParser;
m_strFormula = a_Reader.m_strFormula;
@ -135,7 +135,7 @@ QmuParserTokenReader::QmuParserTokenReader ( QmuParserBase *a_pParent )
* @return A new QParserTokenReader object.
* @throw nothrow
*/
QmuParserTokenReader* QmuParserTokenReader::Clone ( QmuParserBase *a_pParent ) const
QmuParserTokenReader* QmuParserTokenReader::Clone ( QmuParserBase *a_pParent ) const Q_DECL_NOEXCEPT
{
std::unique_ptr<QmuParserTokenReader> ptr ( new QmuParserTokenReader ( *this ) );
ptr->SetParent ( a_pParent );
@ -175,7 +175,7 @@ void QmuParserTokenReader::SetVarCreator ( facfun_type a_pFactory, void *pUserDa
* @return #m_iPos
* @throw nothrow
*/
int QmuParserTokenReader::GetPos() const
int QmuParserTokenReader::GetPos() const Q_DECL_NOEXCEPT
{
return m_iPos;
}
@ -187,7 +187,7 @@ int QmuParserTokenReader::GetPos() const
* @return #m_strFormula
* @throw nothrow
*/
const QString& QmuParserTokenReader::GetExpr() const
const QString& QmuParserTokenReader::GetExpr() const Q_DECL_NOEXCEPT
{
return m_strFormula;
}
@ -237,7 +237,7 @@ void QmuParserTokenReader::IgnoreUndefVar ( bool bIgnore )
* @throw nothrow
* @sa ESynCodes
*/
void QmuParserTokenReader::ReInit()
void QmuParserTokenReader::ReInit() Q_DECL_NOEXCEPT
{
m_iPos = 0;
m_iSynFlags = sfSTART_OF_LINE;
@ -362,7 +362,7 @@ void QmuParserTokenReader::SetParent ( QmuParserBase *a_pParent )
* @return The Position of the first character not listed in a_szCharSet.
* @throw nothrow
*/
int QmuParserTokenReader::ExtractToken ( const QString &a_szCharSet, QString &a_sTok, int a_iPos ) const
int QmuParserTokenReader::ExtractToken ( const QString &a_szCharSet, QString &a_sTok, int a_iPos ) const Q_DECL_NOEXCEPT
{
#if defined(_UNICODE)
const std::wstring m_strFormulaStd = m_strFormula.toStdWString();
@ -599,7 +599,7 @@ bool QmuParserTokenReader::IsArgSep ( token_type &a_Tok )
* @throw nothrow
* @sa IsOprt, IsFunTok, IsStrFunTok, IsValTok, IsVarTok, IsString, IsInfixOpTok, IsPostOpTok
*/
bool QmuParserTokenReader::IsEOF ( token_type &a_Tok )
bool QmuParserTokenReader::IsEOF ( token_type &a_Tok ) Q_DECL_NOEXCEPT
{
#if defined(_UNICODE)
const char_type* szFormula = m_strFormula.toStdWString().c_str();
@ -996,7 +996,7 @@ bool QmuParserTokenReader::IsStrVarTok ( token_type &a_Tok )
* @return true if a variable token has been found.
* @throw nothrow
*/
bool QmuParserTokenReader::IsUndefVarTok ( token_type &a_Tok )
bool QmuParserTokenReader::IsUndefVarTok ( token_type &a_Tok ) Q_DECL_NOEXCEPT
{
QString strTok;
int iEnd ( ExtractToken ( m_pParser->ValidNameChars(), strTok, m_iPos ) );
@ -1051,7 +1051,7 @@ bool QmuParserTokenReader::IsUndefVarTok ( token_type &a_Tok )
* @sa IsOprt, IsFunTok, IsStrFunTok, IsValTok, IsVarTok, IsEOF, IsInfixOpTok, IsPostOpTok
* @throw nothrow
*/
bool QmuParserTokenReader::IsString ( token_type &a_Tok )
bool QmuParserTokenReader::IsString ( token_type &a_Tok ) Q_DECL_NOEXCEPT
{
if ( m_strFormula[m_iPos] != '"' )
{

View file

@ -57,20 +57,20 @@ namespace qmu
public:
QmuParserTokenReader(QmuParserBase *a_pParent);
QmuParserTokenReader* Clone(QmuParserBase *a_pParent) const;
QmuParserTokenReader* Clone(QmuParserBase *a_pParent) const Q_DECL_NOEXCEPT;
void AddValIdent(identfun_type a_pCallback);
void SetVarCreator(facfun_type a_pFactory, void *pUserData);
void SetFormula(const QString &a_strFormula);
void SetArgSep(char_type cArgSep);
int GetPos() const;
const QString &GetExpr() const;
int GetPos() const Q_DECL_NOEXCEPT;
const QString &GetExpr() const Q_DECL_NOEXCEPT;
varmap_type& GetUsedVar();
QChar GetArgSep() const;
void IgnoreUndefVar(bool bIgnore);
void ReInit();
void ReInit() Q_DECL_NOEXCEPT;
token_type ReadNextToken();
private:
@ -102,16 +102,16 @@ namespace qmu
};
QmuParserTokenReader(const QmuParserTokenReader &a_Reader);
QmuParserTokenReader& operator=(const QmuParserTokenReader &a_Reader);
void Assign(const QmuParserTokenReader &a_Reader);
QmuParserTokenReader& operator=(const QmuParserTokenReader &a_Reader) Q_DECL_NOEXCEPT;
void Assign(const QmuParserTokenReader &a_Reader) Q_DECL_NOEXCEPT;
void SetParent(QmuParserBase *a_pParent);
int ExtractToken(const QString &a_szCharSet, QString &a_strTok, int a_iPos) const;
int ExtractToken(const QString &a_szCharSet, QString &a_strTok, int a_iPos) const Q_DECL_NOEXCEPT;
int ExtractOperatorToken(QString &a_sTok, int a_iPos) const;
bool IsBuiltIn(token_type &a_Tok);
bool IsArgSep(token_type &a_Tok);
bool IsEOF(token_type &a_Tok);
bool IsEOF(token_type &a_Tok) Q_DECL_NOEXCEPT;
bool IsInfixOpTok(token_type &a_Tok);
bool IsFunTok(token_type &a_Tok);
bool IsPostOpTok(token_type &a_Tok);
@ -119,8 +119,8 @@ namespace qmu
bool IsValTok(token_type &a_Tok);
bool IsVarTok(token_type &a_Tok);
bool IsStrVarTok(token_type &a_Tok);
bool IsUndefVarTok(token_type &a_Tok);
bool IsString(token_type &a_Tok);
bool IsUndefVarTok(token_type &a_Tok) Q_DECL_NOEXCEPT;
bool IsString(token_type &a_Tok) Q_DECL_NOEXCEPT;
void Error(EErrorCodes a_iErrc,
int a_iPos = -1,
const QString &a_sTok = QString() ) const;