aboutsummaryrefslogblamecommitdiffstats
path: root/doc/api-documentation/html/swld_8cpp-source.html
blob: b5a2a61c2424c9ab9ee96391b2a12a5415528592 (plain) (tree)




































































                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         
<!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>swld.cpp Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.15 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="namespaces.html">Namespace List</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="classes.html">Alphabetical List</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center>
<hr><h1>swld.cpp</h1><div class="fragment"><pre>00001 <font class="comment">/******************************************************************************</font>
00002 <font class="comment"> *  swld.cpp   - code for base class 'SWLD'.  SWLD is the basis for all</font>
00003 <font class="comment"> *                              types of Lexicon and Dictionary modules (hence the 'LD').</font>
00004 <font class="comment"> */</font>
00005 
00006 <font class="preprocessor">#include &lt;swld.h&gt;</font>
00007 
00008 
00009 <font class="comment">/******************************************************************************</font>
00010 <font class="comment"> * SWLD Constructor - Initializes data for instance of SWLD</font>
00011 <font class="comment"> *</font>
00012 <font class="comment"> * ENT: imodname - Internal name for module</font>
00013 <font class="comment"> *      imoddesc - Name to display to user for module</font>
00014 <font class="comment"> *      idisp    - Display object to use for displaying</font>
00015 <font class="comment"> */</font>
00016 
<a name="l00017"></a><a class="code" href="class_s_w_l_d.html#a0">00017</a> <a class="code" href="class_s_w_l_d.html#a0">SWLD::SWLD</a>(<font class="keyword">const</font> <font class="keywordtype">char</font> *imodname, <font class="keyword">const</font> <font class="keywordtype">char</font> *imoddesc, <a class="code" href="class_s_w_display.html">SWDisplay</a> *idisp, SWTextEncoding enc, SWTextDirection dir, SWTextMarkup mark, <font class="keyword">const</font> <font class="keywordtype">char</font>* ilang) : <a class="code" href="class_s_w_module.html">SWModule</a>(imodname, imoddesc, idisp, "Lexicons / Dictionaries", enc, dir, mark, ilang)
00018 {
00019         <font class="keyword">delete</font> <a class="code" href="class_s_w_module.html#n6">key</a>;
00020         <a class="code" href="class_s_w_module.html#n6">key</a> = <a class="code" href="class_s_w_l_d.html#a2">CreateKey</a>();
00021         entkeytxt = <font class="keyword">new</font> <font class="keywordtype">char</font> [1];
00022         *entkeytxt = 0;
00023 }
00024 
00025 
00026 <font class="comment">/******************************************************************************</font>
00027 <font class="comment"> * SWLD Destructor - Cleans up instance of SWLD</font>
00028 <font class="comment"> */</font>
00029 
00030 SWLD::~SWLD()
00031 {
00032         <font class="keywordflow">if</font> (entkeytxt)
00033                 <font class="keyword">delete</font> [] entkeytxt;
00034 }
00035 
00036 
00037 <font class="comment">/******************************************************************************</font>
00038 <font class="comment"> * SWLD::KeyText - Sets/gets module KeyText, getting from saved text if key is</font>
00039 <font class="comment"> *                              persistent</font>
00040 <font class="comment"> *</font>
00041 <font class="comment"> * ENT: ikeytext - value which to set keytext</font>
00042 <font class="comment"> *              [0] - only get</font>
00043 <font class="comment"> *</font>
00044 <font class="comment"> * RET: pointer to keytext</font>
00045 <font class="comment"> */</font>
00046 
<a name="l00047"></a><a class="code" href="class_s_w_l_d.html#a3">00047</a> <font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="class_s_w_l_d.html#a3">SWLD::KeyText</a>(<font class="keyword">const</font> <font class="keywordtype">char</font> *ikeytext)
00048 {
00049         <font class="keywordflow">if</font> (<a class="code" href="class_s_w_module.html#n6">key</a>-&gt;<a class="code" href="class_s_w_key.html#a4">Persist</a>() &amp;&amp; !ikeytext) {
00050                 <a class="code" href="class_s_w_module.html#a28">getRawEntry</a>();  <font class="comment">// force module key to snap to entry</font>
00051                 <font class="keywordflow">return</font> entkeytxt;
00052         }
00053         <font class="keywordflow">else</font> <font class="keywordflow">return</font> <a class="code" href="class_s_w_module.html#a12">SWModule::KeyText</a>(ikeytext);
00054 }
00055 
</pre></div><hr><address align="right"><small>Generated on Thu Jun 20 22:13:00 2002 for The Sword Project by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 
width=110 height=53></a>1.2.15 </small></address>
</body>
</html>