classgenericvalues.html

来自「仿真人工智能是指用人工的方法和技术」· HTML 代码 · 共 689 行 · 第 1/3 页

HTML
689
字号
          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strName</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strValue</em></td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method determines the value of the variable of which the name associated with it matches the first argument to the method. The value is converted to a string which is put into the second argument (note that enough memory must be allocated for this char*). This same string is also returned by the method. This enables you to use the method as an argument to a function such as 'strcpy'. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strName</em>&nbsp;</td><td>a string denoting the name associated with the variable of which the value should be returned </td></tr><tr><td valign=top><em>strValue</em>&nbsp;</td><td>a string which after the method call will contain the value of the variable of which the name associated with it matches the first argument to the method </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>a string containing the value of the variable of which the name associated with it matches the first argument to the method </dl><p>Definition at line <a class="el" href="GenericValues_8C-source.html#l00325">325</a> of file <a class="el" href="GenericValues_8C-source.html">GenericValues.C</a>.<p>References <a class="el" href="GenericValues_8C-source.html#l00144">GenericValueT::getValue</a>(), and <a class="el" href="GenericValues_8C-source.html#l00294">getValuePtr</a>().    </td>  </tr></table><a name="c0" doxytag="GenericValues::getValuePtr"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> <a class="el" href="classGenericValueT.html">GenericValueT</a> * GenericValues::getValuePtr </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const char *&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>strName</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [private]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This (private) method returns a pointer to the <a class="el" href="classGenericValueT.html">GenericValueT</a> object of which the name associated with the variable matches the argument passed to the method. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strName</em>&nbsp;</td><td>a string denoting the name associated with the variable of the <a class="el" href="classGenericValueT.html">GenericValueT</a> object to which a pointer should be returned </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>a pointer to the <a class="el" href="classGenericValueT.html">GenericValueT</a> object of which the name associated with the variable matches the argument; 0 when a <a class="el" href="classGenericValueT.html">GenericValueT</a> object with a variable associated with the given name does not exist </dl><p>Definition at line <a class="el" href="GenericValues_8C-source.html#l00294">294</a> of file <a class="el" href="GenericValues_8C-source.html">GenericValues.C</a>.<p>References <a class="el" href="GenericValues_8C-source.html#l00252">getValuesTotal</a>(), and <a class="el" href="GenericValues_8h-source.html#l00121">m_values</a>.<p>Referenced by <a class="el" href="GenericValues_8C-source.html#l00266">addSetting</a>(), <a class="el" href="GenericValues_8C-source.html#l00325">getValue</a>(), and <a class="el" href="GenericValues_8C-source.html#l00348">setValue</a>().    </td>  </tr></table><a name="a3" doxytag="GenericValues::getValuesTotal"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> int GenericValues::getValuesTotal </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Get method for the 'm_iValuesTotal' member variable. <dl compact><dt><b>Returns: </b><dd>the total number of generic values stored in the collection so far </dl><p>Definition at line <a class="el" href="GenericValues_8C-source.html#l00252">252</a> of file <a class="el" href="GenericValues_8C-source.html">GenericValues.C</a>.<p>Referenced by <a class="el" href="GenericValues_8C-source.html#l00294">getValuePtr</a>(), <a class="el" href="GenericValues_8C-source.html#l00460">show</a>(), and <a class="el" href="GenericValues_8C-source.html#l00232">~GenericValues</a>().    </td>  </tr></table><a name="a7" doxytag="GenericValues::readValues"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> bool GenericValues::readValues </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strFile</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strSeparator</em> = 0</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method reads generic values from a file indicated by the first argument to the method and stores them in the collection. In this file the names associated with each value must be listed first followed by a separator and then the value. The names associated with each value should match the string names with which the corresponding generic value is added using 'addSetting'. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strFile</em>&nbsp;</td><td>a string denoting the name of the file from which the values must be read </td></tr><tr><td valign=top><em>strSeparator</em>&nbsp;</td><td>a string representing the separator which is written between name and value in the configuration file </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>a boolean indicating whether the values have been read correctly </dl><p>Definition at line <a class="el" href="GenericValues_8C-source.html#l00372">372</a> of file <a class="el" href="GenericValues_8C-source.html">GenericValues.C</a>.<p>References <a class="el" href="GenericValues_8C-source.html#l00348">setValue</a>().<p>Referenced by <a class="el" href="main_8C-source.html#l00059">main</a>(), and <a class="el" href="ServerSettings_8C-source.html#l00502">ServerSettings::readValues</a>().    </td>  </tr></table><a name="a8" doxytag="GenericValues::saveValues"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0">  <tr>    <td class="md">      <table cellpadding="0" cellspacing="0" border="0">        <tr>          <td class="md" nowrap valign="top"> bool GenericValues::saveValues </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strFile</em>, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>const char *&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>strSeparator</em> = 0, </td>        </tr>        <tr>          <td></td>          <td></td>          <td class="md" nowrap>bool&nbsp;</td>          <td class="mdname" nowrap>&nbsp; <em>bAppend</em> = true</td>        </tr>        <tr>          <td></td>          <td class="md">)&nbsp;</td>          <td class="md" colspan="2"><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>This method writes the generic values in the current collection to a file indicated by the first argument to the method. The string name associated with the value and the value itself are separated by a separator which is specified as the second argument. <dl compact><dt><b>Parameters: </b><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>strFile</em>&nbsp;</td><td>a string denoting the name of the file to which the generic values should be written </td></tr><tr><td valign=top><em>strSeparator</em>&nbsp;</td><td>a string representing the separator which should be written between the name associated with each value and the value itself </td></tr><tr><td valign=top><em>bAppend</em>&nbsp;</td><td>a boolean indicating whether the values should be appended to the given file (=true) or if current contents of the file should be overwritten (=false) </td></tr></table></dl><dl compact><dt><b>Returns: </b><dd>a boolean indicating whether the values in the current collection have been correctly written to the given file </dl>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?