MCPcopy Create free account
hub / github.com/LibreCAD/LibreCAD / DefineStrConst

Method DefineStrConst

libraries/muparser/src/muParserBase.cpp:596–608  ·  view source on GitHub ↗

--------------------------------------------------------------------------- \brief Define a new string constant. \param [in] a_strName The name of the constant. \param [in] a_strVal the value of the constant. */

Source from the content-addressed store, hash-verified

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.

Callers 1

muParserDLL.cppFile · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected