Sophie

Sophie

distrib > Mandriva > 9.1 > ppc > by-pkgid > a74ec78bdb789d910d054e3918f3f007 > files > 439

libsword1-devel-1.5.5-2mdk.ppc.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>rawgbf.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>rawgbf.cpp</h1><div class="fragment"><pre>00001 <font class="comment">/******************************************************************************</font>
00002 <font class="comment"> *  rawgbf.cpp - code for class 'RawGBF'- a module that reads raw text files:</font>
00003 <font class="comment"> *                ot and nt using indexs ??.bks ??.cps ??.vss</font>
00004 <font class="comment"> */</font>
00005 
00006 
00007 <font class="preprocessor">#include &lt;ctype.h&gt;</font>
00008 <font class="preprocessor">#include &lt;stdio.h&gt;</font>
00009 <font class="preprocessor">#include &lt;fcntl.h&gt;</font>
00010 
00011 <font class="preprocessor">#ifndef __GNUC__</font>
00012 <font class="preprocessor"></font><font class="preprocessor">#include &lt;io.h&gt;</font>
00013 <font class="preprocessor">#else</font>
00014 <font class="preprocessor"></font><font class="preprocessor">#include &lt;unistd.h&gt;</font>
00015 <font class="preprocessor">#endif</font>
00016 <font class="preprocessor"></font>
00017 <font class="preprocessor">#include &lt;string.h&gt;</font>
00018 <font class="preprocessor">#include &lt;utilfuns.h&gt;</font>
00019 <font class="preprocessor">#include &lt;rawverse.h&gt;</font>
00020 <font class="preprocessor">#include &lt;rawgbf.h&gt;</font>
00021 
00022 
00023 <font class="comment">/******************************************************************************</font>
00024 <font class="comment"> * RawGBF Constructor - Initializes data for instance of RawGBF</font>
00025 <font class="comment"> *</font>
00026 <font class="comment"> * ENT: iname - Internal name for module</font>
00027 <font class="comment"> *      idesc - Name to display to user for module</font>
00028 <font class="comment"> *      idisp    - Display object to use for displaying</font>
00029 <font class="comment"> */</font>
00030 
00031 RawGBF::RawGBF(<font class="keyword">const</font> <font class="keywordtype">char</font> *ipath, <font class="keyword">const</font> <font class="keywordtype">char</font> *iname, <font class="keyword">const</font> <font class="keywordtype">char</font> *idesc, <a class="code" href="class_s_w_display.html">SWDisplay</a> *idisp) : <a class="code" href="class_s_w_text.html">SWText</a>(iname, idesc, idisp), RawVerse(ipath)
00032 {
00033 }
00034 
00035 
00036 <font class="comment">/******************************************************************************</font>
00037 <font class="comment"> * RawGBF Destructor - Cleans up instance of RawGBF</font>
00038 <font class="comment"> */</font>
00039 
00040 RawGBF::~RawGBF()
00041 {
00042 }
00043 
00044 
00045 <font class="comment">/******************************************************************************</font>
00046 <font class="comment"> * RawGBF::operator char *      - Returns the correct verse when char * cast</font>
00047 <font class="comment"> *                                      is requested</font>
00048 <font class="comment"> *</font>
00049 <font class="comment"> * RET: string buffer with verse</font>
00050 <font class="comment"> */</font>
00051 
00052 RawGBF::operator char*()
00053 {
00054         <font class="keywordtype">long</font>  start;
00055         <font class="keywordtype">unsigned</font> <font class="keywordtype">short</font> size;
00056         <a class="code" href="class_verse_key.html">VerseKey</a> *key = 0;
00057 
00058 <font class="preprocessor">#ifndef _WIN32_WCE</font>
00059 <font class="preprocessor"></font>        <font class="keywordflow">try</font> {
00060 <font class="preprocessor">#endif</font>
00061 <font class="preprocessor"></font>                key = SWDYNAMIC_CAST(<a class="code" href="class_verse_key.html">VerseKey</a>, this-&gt;key);
00062 <font class="preprocessor">#ifndef _WIN32_WCE</font>
00063 <font class="preprocessor"></font>        }
00064         <font class="keywordflow">catch</font> ( ... ) {}
00065 <font class="preprocessor">#endif</font>
00066 <font class="preprocessor"></font>        <font class="keywordflow">if</font> (!key)
00067                 key = <font class="keyword">new</font> <a class="code" href="class_verse_key.html">VerseKey</a>(this-&gt;key);
00068 
00069 
00070         findoffset(key-&gt;<a class="code" href="class_verse_key.html#a22">Testament</a>(), key-&gt;<a class="code" href="class_verse_key.html#a34">Index</a>(), &amp;start, &amp;size);
00071 
00072         <font class="keywordflow">if</font> (entrybuf)
00073                 <font class="keyword">delete</font> [] entrybuf;
00074         entrybuf = <font class="keyword">new</font> <font class="keywordtype">char</font> [ size * 3 ];               <font class="comment">// extra for conversion to RTF or other.</font>
00075 
00076         gettext(key-&gt;<a class="code" href="class_verse_key.html#a22">Testament</a>(), start, size + 1, entrybuf);
00077         preptext(entrybuf);
00078         RenderText(entrybuf, size * 3);
00079         
00080         <font class="keywordflow">if</font> (key != this-&gt;key)
00081                 <font class="keyword">delete</font> key;
00082 
00083         <font class="keywordflow">return</font> entrybuf;
00084 }
</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>