Click here to Skip to main content
15,898,222 members
Articles / Programming Languages / C#

An extensible math expression parser with plug-ins

Rate me:
Please Sign up or sign in to vote.
4.92/5 (147 votes)
13 Mar 2008CPOL51 min read 1.5M   29K   364  
Design and code for an extensible, maintainable, robust, and easy to use math parser.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>MTParserLib: MTParserLocalizer Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4 -->
<div class="qindex"><a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>MTParserLocalizer Class Reference</h1><!-- doxytag: class="MTParserLocalizer" --><!-- doxytag: inherits="MTParserLocalizerI" --><code>#include &lt;<a class="el" href="MTParserLocalizer_8h-source.html">MTParserLocalizer.h</a>&gt;</code>
<p>
<p>Inheritance diagram for MTParserLocalizer:
<p><center><img src="classMTParserLocalizer.png" usemap="#MTParserLocalizer_map" border="0" alt=""></center>
<map name="MTParserLocalizer_map">
<area href="classMTParserLocalizerI.html" alt="MTParserLocalizerI" shape="rect" coords="0,0,123,24">
</map>
<a href="classMTParserLocalizer-members.html">List of all members.</a><hr><a name="_details"></a><h2>Detailed Description</h2>
Concrete localizer. 
<p>
This is the place to look for information about functions, operators, constants and variables. XML files are use to store localized information.<p>
Singleton: For memory efficiency, all parser objects share the same MTParserLocalizer object (i.e. no info duplication in memory).
<p>

<p>
Definition at line <a class="el" href="MTParserLocalizer_8h-source.html#l00023">23</a> of file <a class="el" href="MTParserLocalizer_8h-source.html">MTParserLocalizer.h</a>.<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a0">registerLibrary</a> (const MTCHAR *infoFile)  throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register a library info file.  <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a1">registerAllLibraries</a> (const MTCHAR *directory, const MTCHAR *searchPattern)  throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Register all libraries info files present in a directory.  <a href="#a1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a2">setLocale</a> (const MTCHAR *locale)  throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Set the locale.  <a href="#a2"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a3"></a><!-- doxytag: member="MTParserLocalizer::getLocale" ref="a3" args="()" -->
virtual MTSTRING&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a3">getLocale</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the current locale. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a4"></a><!-- doxytag: member="MTParserLocalizer::getNbFuncs" ref="a4" args="() const " -->
virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a4">getNbFuncs</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of available functions. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a5"></a><!-- doxytag: member="MTParserLocalizer::getNbOps" ref="a5" args="() const " -->
virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a5">getNbOps</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of available operators. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a6"></a><!-- doxytag: member="MTParserLocalizer::getNbConsts" ref="a6" args="() const " -->
virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a6">getNbConsts</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of available constants. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a7"></a><!-- doxytag: member="MTParserLocalizer::getNbVars" ref="a7" args="() const " -->
virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a7">getNbVars</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the number of available variables. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SFuncInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a8">getFuncInfo</a> (unsigned int id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a function.  <a href="#a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SOpInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a9">getOpInfo</a> (unsigned int id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about an operator.  <a href="#a9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SConstInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a10">getConstInfo</a> (unsigned int id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a constant.  <a href="#a10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SVarInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a11">getVarInfo</a> (unsigned int id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a variable.  <a href="#a11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SFuncInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a12">getFuncInfo</a> (const MTCHAR *id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a function.  <a href="#a12"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SOpInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a13">getOpInfo</a> (const MTCHAR *id) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about an operator.  <a href="#a13"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SConstInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a14">getConstInfo</a> (const MTCHAR *symbol) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a constant.  <a href="#a14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual SVarInfo&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a15">getVarInfo</a> (const MTCHAR *symbol) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized information about a variable.  <a href="#a15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual MTSTRING&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#a16">getExcep</a> (const <a class="el" href="classMTExcepData.html">MTExcepData</a> &amp;data) const   throw (MTParserException)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the localized exception text message.  <a href="#a16"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="classMTParserLocalizer.html">MTParserLocalizer</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#e0">getInstance</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Get the unique instance.  <a href="#e0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static MTSTRING&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#e1">formatFuncPrototype</a> (const SFuncInfo &amp;info, const <a class="el" href="structMTSyntax.html">MTSyntax</a> &amp;syntax)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Helper method to format the function arguments into a prototype string.  <a href="#e1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static MTSTRING&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classMTParserLocalizer.html#e2">formatOpPrototype</a> (const SOpInfo &amp;info)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Helper method to format the operator arguments into a prototype string.  <a href="#e2"></a><br></td></tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e1"></a><!-- doxytag: member="MTParserLocalizer::formatFuncPrototype" ref="e1" args="(const SFuncInfo &amp;info, const MTSyntax &amp;syntax)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTSTRING MTParserLocalizer::formatFuncPrototype           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const SFuncInfo &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>info</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const <a class="el" href="structMTSyntax.html">MTSyntax</a> &amp;&nbsp;</td>
          <td class="mdname" nowrap> <em>syntax</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Helper method to format the function arguments into a prototype string. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>info</em>&nbsp;</td><td>The function information </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>syntax</em>&nbsp;</td><td>The syntax to be used</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A string prototype like: fct(a, b)</dd></dl>

<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00232">232</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserPublic_8h-source.html#l00381">MTSyntax::argumentSeparator</a>, <a class="el" href="MTParserPublic_8h-source.html#l00074">MTCLOSE_BRACKET</a>, <a class="el" href="MTParserPublic_8h-source.html#l00071">MTOPEN_BRACKET</a>, and <a class="el" href="MTUnicodeANSIDefs_8h-source.html#l00068">MTSTRING</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e2"></a><!-- doxytag: member="MTParserLocalizer::formatOpPrototype" ref="e2" args="(const SOpInfo &amp;info)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTSTRING MTParserLocalizer::formatOpPrototype           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const SOpInfo &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>info</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Helper method to format the operator arguments into a prototype string. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>info</em>&nbsp;</td><td>The operator information</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>A string prototype like: x+y</dd></dl>

<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00253">253</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTUnicodeANSIDefs_8h-source.html#l00068">MTSTRING</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a14"></a><!-- doxytag: member="MTParserLocalizer::getConstInfo" ref="a14" args="(const MTCHAR *symbol) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SConstInfo MTParserLocalizer::getConstInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>symbol</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a constant. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>symbol</em>&nbsp;</td><td>The constantymbol</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a14">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00194">194</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member="MTParserLocalizer::getConstInfo" ref="a10" args="(unsigned int id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SConstInfo MTParserLocalizer::getConstInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a constant. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>The constant index ranging from 0 to the number of available constants-1</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a10">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00149">149</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTTools_8cpp-source.html#l00296">MTTools::longToS()</a>, <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a16"></a><!-- doxytag: member="MTParserLocalizer::getExcep" ref="a16" args="(const MTExcepData &amp;data) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTSTRING MTParserLocalizer::getExcep           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const <a class="el" href="classMTExcepData.html">MTExcepData</a> &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>data</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized exception text message. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>data</em>&nbsp;</td><td>The exception data </td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The exception text message</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a16">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00219">219</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserExcepStrEng_8cpp-source.html#l00089">MTParserExcepStrEng::format()</a>, <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a12"></a><!-- doxytag: member="MTParserLocalizer::getFuncInfo" ref="a12" args="(const MTCHAR *id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SFuncInfo MTParserLocalizer::getFuncInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a function. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>The function string identifier. Not its symbol since there are overloaded functions.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a12">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00171">171</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member="MTParserLocalizer::getFuncInfo" ref="a8" args="(unsigned int id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SFuncInfo MTParserLocalizer::getFuncInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a function. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>The function index ranging from 0 to the number of available functions-1</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a8">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00128">128</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTTools_8cpp-source.html#l00296">MTTools::longToS()</a>, <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="e0"></a><!-- doxytag: member="MTParserLocalizer::getInstance" ref="e0" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="classMTParserLocalizer.html">MTParserLocalizer</a> * MTParserLocalizer::getInstance           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the unique instance. 
<p>
<dl compact><dt><b>Returns:</b></dt><dd>The singleton object</dd></dl>

<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00014">14</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a13"></a><!-- doxytag: member="MTParserLocalizer::getOpInfo" ref="a13" args="(const MTCHAR *id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SOpInfo MTParserLocalizer::getOpInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about an operator. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>id</em>&nbsp;</td><td>The operator string identifier. Not its symbol since there are overloaded operators.</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a13">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00182">182</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member="MTParserLocalizer::getOpInfo" ref="a9" args="(unsigned int id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SOpInfo MTParserLocalizer::getOpInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about an operator. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>The operator index ranging from 0 to the number of available operators-1</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a9">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00138">138</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTTools_8cpp-source.html#l00296">MTTools::longToS()</a>, <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a15"></a><!-- doxytag: member="MTParserLocalizer::getVarInfo" ref="a15" args="(const MTCHAR *symbol) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SVarInfo MTParserLocalizer::getVarInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>symbol</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a variable. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>symbol</em>&nbsp;</td><td>The variable symbol</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a15">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00206">206</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member="MTParserLocalizer::getVarInfo" ref="a11" args="(unsigned int id) const " --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">MTParserLocalizer::SVarInfo MTParserLocalizer::getVarInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>id</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Get the localized information about a variable. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>index</em>&nbsp;</td><td>The variable index ranging from 0 to the number of available variable-1</td></tr>
  </table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>The information structure</dd></dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a11">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00160">160</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTTools_8cpp-source.html#l00296">MTTools::longToS()</a>, <a class="el" href="MTParserException_8h-source.html#l00048">MTDEFEXCEP_ItemNotFound</a>, <a class="el" href="MTParserException_8h-source.html#l00302">MTEXCEPARG_ITEMNAME</a>, and <a class="el" href="MTParserPrivate_8h-source.html#l00024">MTTHROW</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member="MTParserLocalizer::registerAllLibraries" ref="a1" args="(const MTCHAR *directory, const MTCHAR *searchPattern)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void MTParserLocalizer::registerAllLibraries           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname" nowrap> <em>directory</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>const MTCHAR *&nbsp;</td>
          <td class="mdname" nowrap> <em>searchPattern</em></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2">  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Register all libraries info files present in a directory. 
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>directory</em>&nbsp;</td><td>The directory where to look for info files. Sub-directories will be searched too. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>searchPattern</em>&nbsp;</td><td>File search pattern like *.xml or *.*.</td></tr>
  </table>
</dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a1">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00037">37</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTException_8h-source.html#l00217">MTChainedExceptions&lt; TExcepData &gt;::add()</a>, <a class="el" href="MTSearchFile_8cpp-source.html#l00004">MTSearchFile::search()</a>, and <a class="el" href="MTException_8h-source.html#l00257">MTChainedExceptions&lt; TExcepData &gt;::size()</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member="MTParserLocalizer::registerLibrary" ref="a0" args="(const MTCHAR *infoFile)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void MTParserLocalizer::registerLibrary           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>infoFile</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Register a library info file. 
<p>
Make available the information contained in this library info file.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>infoFile</em>&nbsp;</td><td>The library info file name</td></tr>
  </table>
</dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a0">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00019">19</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.    </td>
  </tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member="MTParserLocalizer::setLocale" ref="a2" args="(const MTCHAR *locale)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void MTParserLocalizer::setLocale           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const MTCHAR *&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>locale</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw (<a class="el" href="classMTChainedExceptions.html">MTParserException</a>)<code> [virtual]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Set the locale. 
<p>
All information will be returned in this locale.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>locale</em>&nbsp;</td><td>A locale string identifier like "en" for english or "fr" for french.</td></tr>
  </table>
</dl>

<p>
Implements <a class="el" href="classMTParserLocalizerI.html#a2">MTParserLocalizerI</a>.
<p>
Definition at line <a class="el" href="MTParserLocalizer_8cpp-source.html#l00068">68</a> of file <a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a>.
<p>
References <a class="el" href="MTException_8h-source.html#l00217">MTChainedExceptions&lt; TExcepData &gt;::add()</a>, and <a class="el" href="MTException_8h-source.html#l00257">MTChainedExceptions&lt; TExcepData &gt;::size()</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="MTParserLocalizer_8h-source.html">MTParserLocalizer.h</a><li><a class="el" href="MTParserLocalizer_8cpp-source.html">MTParserLocalizer.cpp</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Sun Mar 9 17:39:37 2008 for MTParserLib by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
Software Engineer working at a fun and smart startup company

Comments and Discussions