--------------------------------------------------------------------------- \brief Define a new string constant. \param [in] a_strName The name of the constant. \param [in] a_strVal the value of the constant. */
| 594 | \param [in] a_strVal the value of the constant. |
| 595 | */ |
| 596 | void ParserBase::DefineStrConst(const string_type& a_strName, const string_type& a_strVal) |
| 597 | { |
| 598 | // Test if a constant with that names already exists |
| 599 | if (m_StrVarDef.find(a_strName) != m_StrVarDef.end()) |
| 600 | Error(ecNAME_CONFLICT); |
| 601 | |
| 602 | CheckName(a_strName, ValidNameChars()); |
| 603 | |
| 604 | m_vStringVarBuf.push_back(a_strVal); // Store variable string in internal buffer |
| 605 | m_StrVarDef[a_strName] = m_vStringVarBuf.size() - 1; // bind buffer index to variable name |
| 606 | |
| 607 | ReInit(); |
| 608 | } |
| 609 | |
| 610 | //--------------------------------------------------------------------------- |
| 611 | /** \brief Add a user defined variable. |
no test coverage detected