Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 2134

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: iutil/pluginconfig.h Source File (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li><a href="classes.html"><span>Classes</span></a></li>
    <li class="current"><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>iutil/pluginconfig.h</h1><a href="pluginconfig_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">    Copyright (C) 1998 by Jorrit Tyberghein</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">    This library is free software; you can redistribute it and/or</span>
<a name="l00005"></a>00005 <span class="comment">    modify it under the terms of the GNU Library General Public</span>
<a name="l00006"></a>00006 <span class="comment">    License as published by the Free Software Foundation; either</span>
<a name="l00007"></a>00007 <span class="comment">    version 2 of the License, or (at your option) any later version.</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">    This library is distributed in the hope that it will be useful,</span>
<a name="l00010"></a>00010 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00011"></a>00011 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00012"></a>00012 <span class="comment">    Library General Public License for more details.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">    You should have received a copy of the GNU Library General Public</span>
<a name="l00015"></a>00015 <span class="comment">    License along with this library; if not, write to the Free</span>
<a name="l00016"></a>00016 <span class="comment">    Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span>
<a name="l00017"></a>00017 <span class="comment">*/</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#ifndef __CS_IUTIL_PLUGINCONFIG_H__</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_IUTIL_PLUGINCONFIG_H__</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="scf_8h.html" title="Crystal Space Shared Class Facility (SCF).">csutil/scf.h</a>"</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include "<a class="code" href="scfstr_8h.html" title="Implementation for iString.">csutil/scfstr.h</a>"</span>
<a name="l00029"></a>00029 
<a name="l00031"></a><a class="code" href="group__util.html#g91624a433f78618fba6823a5d79bdb52">00031</a> <span class="keyword">enum</span> <a class="code" href="group__util.html#g91624a433f78618fba6823a5d79bdb52" title="Types that can be contained within a variant.">csVariantType</a>
<a name="l00032"></a>00032 {
<a name="l00034"></a><a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb522214fd7cbaeede53271fb01107889556">00034</a>   <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb522214fd7cbaeede53271fb01107889556" title="long">CSVAR_LONG</a>,
<a name="l00036"></a><a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52f17bc3eb7bd1d4e1fc0613efbfa10517">00036</a>   <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52f17bc3eb7bd1d4e1fc0613efbfa10517" title="bool">CSVAR_BOOL</a>,
<a name="l00038"></a><a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52d54f393a047982f3d1cf4d1d619d17a9">00038</a>   <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52d54f393a047982f3d1cf4d1d619d17a9" title="a command">CSVAR_CMD</a>,
<a name="l00040"></a><a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52889201a771dfd2a1496b23e69a94c18f">00040</a>   <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52889201a771dfd2a1496b23e69a94c18f" title="float">CSVAR_FLOAT</a>,
<a name="l00042"></a><a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2">00042</a>   <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>
<a name="l00043"></a>00043 };
<a name="l00044"></a>00044 
<a name="l00050"></a><a class="code" href="structcsVariant.html">00050</a> <span class="keyword">struct </span><a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>
<a name="l00051"></a>00051 {
<a name="l00052"></a>00052 <span class="keyword">private</span>:
<a name="l00053"></a>00053   <a class="code" href="group__util.html#g91624a433f78618fba6823a5d79bdb52" title="Types that can be contained within a variant.">csVariantType</a> type;
<a name="l00054"></a>00054   <span class="keyword">union </span>value
<a name="l00055"></a>00055   {
<a name="l00056"></a>00056     <span class="keywordtype">long</span> l;
<a name="l00057"></a>00057     <span class="keywordtype">bool</span> b;
<a name="l00058"></a>00058     <span class="keywordtype">float</span> f;
<a name="l00059"></a>00059     <a class="code" href="structiString.html" title="This is a SCF-compatible interface for csString.">iString</a>* s;
<a name="l00060"></a>00060   } v;
<a name="l00061"></a>00061   <span class="keywordtype">void</span> Clear()
<a name="l00062"></a>00062   {
<a name="l00063"></a>00063     <span class="keywordflow">if</span> ((type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>) &amp;&amp; (v.s != 0)) v.s-&gt;DecRef();
<a name="l00064"></a>00064   }
<a name="l00065"></a>00065 <span class="keyword">public</span>:
<a name="l00066"></a><a class="code" href="structcsVariant.html#6594afe4ffa4a685e030779a9a811975">00066</a>   <a class="code" href="structcsVariant.html#6594afe4ffa4a685e030779a9a811975">csVariant</a> () { type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb522214fd7cbaeede53271fb01107889556" title="long">CSVAR_LONG</a>; memset (&amp;v, 0, <span class="keyword">sizeof</span> (v)); }
<a name="l00067"></a><a class="code" href="structcsVariant.html#1be8c7cdc8e6205ce578bf34d7567349">00067</a>   <a class="code" href="structcsVariant.html#1be8c7cdc8e6205ce578bf34d7567349">~csVariant</a> () { Clear(); }
<a name="l00068"></a>00068 
<a name="l00070"></a><a class="code" href="structcsVariant.html#4ebfd4836c17bc6b3a1ddc97c8e513db">00070</a>   <a class="code" href="structcsVariant.html#6594afe4ffa4a685e030779a9a811975">csVariant</a> (<span class="keyword">const</span> <a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>&amp; var)
<a name="l00071"></a>00071   {
<a name="l00072"></a>00072     memset (&amp;v, 0, <span class="keyword">sizeof</span> (v));
<a name="l00073"></a>00073     
<a name="l00074"></a>00074     type = var.<a class="code" href="structcsVariant.html#ee8051b9b8120c48dde8836db9327cac">type</a>;
<a name="l00075"></a>00075     v = var.<a class="code" href="structcsVariant.html#38cc2a09f134cd5ae32e085e4b96c967">v</a>;
<a name="l00076"></a>00076     <span class="keywordflow">if</span> ((type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>) &amp;&amp; (v.s != 0)) v.s-&gt;IncRef(); 
<a name="l00077"></a>00077   }
<a name="l00078"></a>00078 
<a name="l00080"></a><a class="code" href="structcsVariant.html#8becb055148eb778d7100400b9f7263a">00080</a>   <span class="keyword">const</span> <a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>&amp; <a class="code" href="structcsVariant.html#8becb055148eb778d7100400b9f7263a" title="Assignment operator. As with the copy-ctor, only IncRef&amp;#39;s the string.">operator = </a>(<span class="keyword">const</span> <a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>&amp; var)
<a name="l00081"></a>00081   {
<a name="l00082"></a>00082     Clear ();
<a name="l00083"></a>00083     type = var.<a class="code" href="structcsVariant.html#ee8051b9b8120c48dde8836db9327cac">type</a>;
<a name="l00084"></a>00084     v = var.<a class="code" href="structcsVariant.html#38cc2a09f134cd5ae32e085e4b96c967">v</a>;
<a name="l00085"></a>00085     <span class="keywordflow">if</span> ((type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>) &amp;&amp; (v.s != 0)) v.s-&gt;IncRef ();
<a name="l00086"></a>00086     <span class="keywordflow">return</span> var;
<a name="l00087"></a>00087   }
<a name="l00088"></a>00088   
<a name="l00090"></a><a class="code" href="structcsVariant.html#6ae9d0b1f1dbe2b0d190425d1b584f68">00090</a>   <span class="keywordtype">void</span> <a class="code" href="structcsVariant.html#6ae9d0b1f1dbe2b0d190425d1b584f68" title="Assign a long.">SetLong</a> (<span class="keywordtype">long</span> l)
<a name="l00091"></a>00091   {
<a name="l00092"></a>00092     Clear();
<a name="l00093"></a>00093     type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb522214fd7cbaeede53271fb01107889556" title="long">CSVAR_LONG</a>;
<a name="l00094"></a>00094     v.l = l;
<a name="l00095"></a>00095   }
<a name="l00097"></a><a class="code" href="structcsVariant.html#6c45850ca04ce0b460a95c4433a584b5">00097</a>   <span class="keywordtype">void</span> <a class="code" href="structcsVariant.html#6c45850ca04ce0b460a95c4433a584b5" title="Assign a bool.">SetBool</a> (<span class="keywordtype">bool</span> b)
<a name="l00098"></a>00098   {
<a name="l00099"></a>00099     Clear();
<a name="l00100"></a>00100     type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52f17bc3eb7bd1d4e1fc0613efbfa10517" title="bool">CSVAR_BOOL</a>;
<a name="l00101"></a>00101     v.b = b;
<a name="l00102"></a>00102   }
<a name="l00104"></a><a class="code" href="structcsVariant.html#8c0a880bd68da00c11776cb4b75ce291">00104</a>   <span class="keywordtype">void</span> <a class="code" href="structcsVariant.html#8c0a880bd68da00c11776cb4b75ce291" title="Assign a float.">SetFloat</a> (<span class="keywordtype">float</span> f)
<a name="l00105"></a>00105   {
<a name="l00106"></a>00106     Clear();
<a name="l00107"></a>00107     type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52889201a771dfd2a1496b23e69a94c18f" title="float">CSVAR_FLOAT</a>;
<a name="l00108"></a>00108     v.f = f;
<a name="l00109"></a>00109   }
<a name="l00111"></a><a class="code" href="structcsVariant.html#70568ffe2ca094b6da29a5264da53fa6">00111</a>   <span class="keywordtype">void</span> <a class="code" href="structcsVariant.html#70568ffe2ca094b6da29a5264da53fa6" title="Assign a string.">SetString</a> (<span class="keyword">const</span> <span class="keywordtype">char</span>* s)
<a name="l00112"></a>00112   {
<a name="l00113"></a>00113     Clear();
<a name="l00114"></a>00114     type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>;
<a name="l00115"></a>00115     <span class="keywordflow">if</span> (s)
<a name="l00116"></a>00116       v.s = <span class="keyword">new</span> <a class="code" href="classscfString.html" title="This is a thin SCF wrapper around csString.">scfString</a> (s);
<a name="l00117"></a>00117     <span class="keywordflow">else</span>
<a name="l00118"></a>00118       v.s = 0;
<a name="l00119"></a>00119   }
<a name="l00121"></a><a class="code" href="structcsVariant.html#1f651e489b425485c7ba4620b8b571b4">00121</a>   <span class="keywordtype">void</span> <a class="code" href="structcsVariant.html#1f651e489b425485c7ba4620b8b571b4" title="Assign a command.">SetCommand</a> ()
<a name="l00122"></a>00122   {
<a name="l00123"></a>00123     Clear();
<a name="l00124"></a>00124     type = <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52d54f393a047982f3d1cf4d1d619d17a9" title="a command">CSVAR_CMD</a>;
<a name="l00125"></a>00125   }
<a name="l00126"></a>00126 
<a name="l00128"></a><a class="code" href="structcsVariant.html#babd9d1ee88facf3a25afc5911d4fdee">00128</a>   <span class="keywordtype">long</span> <a class="code" href="structcsVariant.html#babd9d1ee88facf3a25afc5911d4fdee" title="Retrieve a long.">GetLong</a> ()<span class="keyword"> const</span>
<a name="l00129"></a>00129 <span class="keyword">  </span>{
<a name="l00130"></a>00130     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb522214fd7cbaeede53271fb01107889556" title="long">CSVAR_LONG</a>);
<a name="l00131"></a>00131     <span class="keywordflow">return</span> v.l;
<a name="l00132"></a>00132   }
<a name="l00134"></a><a class="code" href="structcsVariant.html#36fa1d06d3d829ca555a9985a596b43c">00134</a>   <span class="keywordtype">bool</span> <a class="code" href="structcsVariant.html#36fa1d06d3d829ca555a9985a596b43c" title="Retrieve a bool.">GetBool</a> ()<span class="keyword"> const</span>
<a name="l00135"></a>00135 <span class="keyword">  </span>{
<a name="l00136"></a>00136     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52f17bc3eb7bd1d4e1fc0613efbfa10517" title="bool">CSVAR_BOOL</a>);
<a name="l00137"></a>00137     <span class="keywordflow">return</span> v.b;
<a name="l00138"></a>00138   }
<a name="l00140"></a><a class="code" href="structcsVariant.html#d4ffafd84f2eac8e44ced0bb87312e4e">00140</a>   <span class="keywordtype">float</span> <a class="code" href="structcsVariant.html#d4ffafd84f2eac8e44ced0bb87312e4e" title="Retrieve a float.">GetFloat</a> ()<span class="keyword"> const</span>
<a name="l00141"></a>00141 <span class="keyword">  </span>{
<a name="l00142"></a>00142     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb52889201a771dfd2a1496b23e69a94c18f" title="float">CSVAR_FLOAT</a>);
<a name="l00143"></a>00143     <span class="keywordflow">return</span> v.f;
<a name="l00144"></a>00144   }
<a name="l00146"></a><a class="code" href="structcsVariant.html#2ad7fab5668e57b446c12e8bed91e3b0">00146</a>   <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="structcsVariant.html#2ad7fab5668e57b446c12e8bed91e3b0" title="Retrieve a string.">GetString</a> ()<span class="keyword"> const</span>
<a name="l00147"></a>00147 <span class="keyword">  </span>{
<a name="l00148"></a>00148     <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (type == <a class="code" href="group__util.html#gg91624a433f78618fba6823a5d79bdb528ac63ce74118d6c3336dacf0e766cdb2" title="string">CSVAR_STRING</a>);
<a name="l00149"></a>00149     <span class="keywordflow">return</span> v.s-&gt;GetData();
<a name="l00150"></a>00150   }
<a name="l00151"></a><a class="code" href="structcsVariant.html#0aa9f6d202cc90e06447f70c238f44c2">00151</a>   <a class="code" href="group__util.html#g91624a433f78618fba6823a5d79bdb52" title="Types that can be contained within a variant.">csVariantType</a> <a class="code" href="structcsVariant.html#0aa9f6d202cc90e06447f70c238f44c2">GetType</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> type; }
<a name="l00152"></a>00152 };
<a name="l00153"></a>00153 
<a name="l00155"></a><a class="code" href="structcsOptionDescription.html">00155</a> <span class="keyword">struct </span><a class="code" href="structcsOptionDescription.html" title="Configuration option description.">csOptionDescription</a>
<a name="l00156"></a>00156 {
<a name="l00158"></a><a class="code" href="structcsOptionDescription.html#1fcfa6e84f9824d42fc33de2f23828e8">00158</a>   <span class="keywordtype">int</span> <a class="code" href="structcsOptionDescription.html#1fcfa6e84f9824d42fc33de2f23828e8" title="Description ID.">id</a>;
<a name="l00160"></a><a class="code" href="structcsOptionDescription.html#c3240e41e8d1b9d50a39e4d46968da37">00160</a>   <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="structcsOptionDescription.html#c3240e41e8d1b9d50a39e4d46968da37" title="Short name of this option.">name</a>;             
<a name="l00162"></a><a class="code" href="structcsOptionDescription.html#c2707be8d678a22bced964de823d0f48">00162</a>   <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="structcsOptionDescription.html#c2707be8d678a22bced964de823d0f48" title="Description for this option.">description</a>;      
<a name="l00164"></a><a class="code" href="structcsOptionDescription.html#faca340d0a15c527c960e3c1cb9b6ff6">00164</a>   <a class="code" href="group__util.html#g91624a433f78618fba6823a5d79bdb52" title="Types that can be contained within a variant.">csVariantType</a> <a class="code" href="structcsOptionDescription.html#faca340d0a15c527c960e3c1cb9b6ff6" title="Type to use for this option.">type</a>;   
<a name="l00165"></a>00165 };
<a name="l00166"></a>00166 
<a name="l00182"></a><a class="code" href="structiPluginConfig.html">00182</a> <span class="keyword">struct </span><a class="code" href="structiPluginConfig.html" title="Interface to a configurator object.">iPluginConfig</a> : <span class="keyword">public</span> <span class="keyword">virtual</span> <a class="code" href="structiBase.html" title="This is the basic interface: all other interfaces should be derived from this one...">iBase</a>
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184   SCF_INTERFACE(<a class="code" href="structiPluginConfig.html" title="Interface to a configurator object.">iPluginConfig</a>,2,1,0);
<a name="l00186"></a>00186   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiPluginConfig.html#c461a6a85570948f2d92d639a2654857" title="Get option description; return FALSE if there is no such option.">GetOptionDescription</a> (<span class="keywordtype">int</span> idx, <a class="code" href="structcsOptionDescription.html" title="Configuration option description.">csOptionDescription</a> *<a class="code" href="getopt_8h.html#df33c342f1f93d3574188740b6d00a59" title="Quirk: so that using the word &amp;#39;option&amp;#39; in any doxygen comments doesn&amp;#39;t...">option</a>) = 0;
<a name="l00188"></a>00188   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiPluginConfig.html#f80fa679ca28a82f3a8e55a51efc26b0" title="Set option.">SetOption</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>* value) = 0;
<a name="l00190"></a>00190   <span class="keyword">virtual</span> <span class="keywordtype">bool</span> <a class="code" href="structiPluginConfig.html#5b696e4beacd0b33195980b362d720bc" title="Get option.">GetOption</a> (<span class="keywordtype">int</span> <span class="keywordtype">id</span>, <a class="code" href="structcsVariant.html" title="Variant, means that type of contained data is set at runtime.">csVariant</a>* value) = 0;
<a name="l00191"></a>00191 };
<a name="l00194"></a>00194 <span class="preprocessor">#endif // __CS_IUTIL_PLUGINCONFIG_H__</span>
</pre></div><hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>