QVector instead std::vector.

--HG--
branch : feature
This commit is contained in:
dismine 2014-04-26 11:00:42 +03:00
parent 541a5becbd
commit 5c3845ff00
6 changed files with 9 additions and 9 deletions

View File

@ -748,7 +748,7 @@ void QmuParserBase::SetExpr(const string_type &a_sExpr)
\throw exception_type If the function token is not a string function \throw exception_type If the function token is not a string function
*/ */
QmuParserBase::token_type QmuParserBase::ApplyStrFunc(const token_type &a_FunTok, QmuParserBase::token_type QmuParserBase::ApplyStrFunc(const token_type &a_FunTok,
const std::vector<token_type> &a_vArg) const const QVector<token_type> &a_vArg) const
{ {
if (a_vArg.back().GetCode()!=cmSTRING) if (a_vArg.back().GetCode()!=cmSTRING)
Error(ecSTRING_EXPECTED, m_pTokenReader->GetPos(), a_FunTok.GetAsString()); Error(ecSTRING_EXPECTED, m_pTokenReader->GetPos(), a_FunTok.GetAsString());
@ -824,7 +824,7 @@ void QmuParserBase::SetExpr(const string_type &a_sExpr)
// Collect the numeric function arguments from the value stack and store them // Collect the numeric function arguments from the value stack and store them
// in a vector // in a vector
std::vector<token_type> stArg; QVector<token_type> stArg;
for (int i=0; i<iArgNumerical; ++i) for (int i=0; i<iArgNumerical; ++i)
{ {
stArg.push_back( a_stVal.pop() ); stArg.push_back( a_stVal.pop() );

View File

@ -71,10 +71,10 @@ private:
typedef qreal (QmuParserBase::*ParseFunction)() const; typedef qreal (QmuParserBase::*ParseFunction)() const;
/** \brief Type used for storing an array of values. */ /** \brief Type used for storing an array of values. */
typedef std::vector<qreal> valbuf_type; typedef QVector<qreal> valbuf_type;
/** \brief Type for a vector of strings. */ /** \brief Type for a vector of strings. */
typedef std::vector<string_type> stringbuf_type; typedef QVector<string_type> stringbuf_type;
/** \brief Typedef for the token reader. */ /** \brief Typedef for the token reader. */
typedef QmuParserTokenReader token_reader_type; typedef QmuParserTokenReader token_reader_type;
@ -245,7 +245,7 @@ private:
void ApplyFunc(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal, int iArgCount) const; void ApplyFunc(QStack<token_type> &a_stOpt, QStack<token_type> &a_stVal, int iArgCount) const;
token_type ApplyStrFunc(const token_type &a_FunTok, token_type ApplyStrFunc(const token_type &a_FunTok,
const std::vector<token_type> &a_vArg) const; const QVector<token_type> &a_vArg) const;
int GetOprtPrecedence(const token_type &a_Tok) const; int GetOprtPrecedence(const token_type &a_Tok) const;
EOprtAssociativity GetOprtAssociativity(const token_type &a_Tok) const; EOprtAssociativity GetOprtAssociativity(const token_type &a_Tok) const;

View File

@ -90,7 +90,7 @@ private:
typedef QmuParserToken<qreal, string_type> token_type; typedef QmuParserToken<qreal, string_type> token_type;
/** \brief Token vector for storing the RPN. */ /** \brief Token vector for storing the RPN. */
typedef std::vector<SToken> rpn_type; typedef QVector<SToken> rpn_type;
/** \brief Position in the Calculation array. */ /** \brief Position in the Calculation array. */
unsigned m_iStackPos; unsigned m_iStackPos;

View File

@ -110,7 +110,7 @@ public:
string_type operator[](unsigned a_iIdx) const; string_type operator[](unsigned a_iIdx) const;
private: private:
std::vector<string_type> m_vErrMsg; ///< A vector with the predefined error messages QVector<string_type> m_vErrMsg; ///< A vector with the predefined error messages
static const self_type m_Instance; ///< The instance pointer static const self_type m_Instance; ///< The instance pointer
}; };

View File

@ -1228,7 +1228,7 @@ namespace qmu
try try
{ {
// Test copy constructor // Test copy constructor
std::vector<qmu::QmuParser> vParser; QVector<qmu::QmuParser> vParser;
vParser.push_back(*(p1.get())); vParser.push_back(*(p1.get()));
qmu::QmuParser p2 = vParser[0]; // take parser from vector qmu::QmuParser p2 = vParser[0]; // take parser from vector

View File

@ -183,7 +183,7 @@ namespace qmu
void Run(); void Run();
private: private:
std::vector<testfun_type> m_vTestFun; QVector<testfun_type> m_vTestFun;
void AddTest(testfun_type a_pFun); void AddTest(testfun_type a_pFun);
// Test Double Parser // Test Double Parser